BookmarkSubscribeRSS Feed
vishalrajpoot3
Obsidian | Level 7

Please help me here as I am using below code I am getting multiple spaces within the ABC_clm. 

 

proc sql outobs=100;
create table test as
SELECT
C.CLM_ID,
C.CLM_VER_NBR,
cats('0000'||C.CLM_ID||(put(c.CLM_VER_NBR,z2.))) as ABC_clm
from NET.CLAIM C
where CLM_VER_NBR ne 0;
QUIT;

 

vishalrajpoot3_0-1736169219036.png

 

 

2 REPLIES 2
UnknownCS
Calcite | Level 5

The actual length of the CLM_ID column is longer than it is displayed. To resolve this, you can add strip function to remove the trailing blanks.

cats('0000'||strip(C.CLM_ID)||(put(c.CLM_VER_NBR,z2.))) as ABC_clm

PaigeMiller
Diamond | Level 26

Your syntax inside the CATS() function is incorrect. You want to use commas (not || ) to separate the different text strings to be concatenated.

 

cats('0000',C.CLM_ID,put(c.CLM_VER_NBR,z2.)) as ABC_clm

 

 

--
Paige Miller

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 554 views
  • 0 likes
  • 3 in conversation