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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 502 views
  • 0 likes
  • 3 in conversation