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;
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
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
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.