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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
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.