Hello
I want to combine 10 char columns and add a comma separator.
The problem that some columns has null value and then in the resulted field there are
For example:
The resulted value in first row is looking like that::
118-106-201-.-.-.-.-.-.-.
I would like to see it as 118-106-201
What is the way to do it please?
The code statement that I run is
Reason_Reject=CATX('-',OF _temp1-_temp10);
These cannot be missing character variables, as this works perfectly:
data test;
infile datalines dlm="," dsd truncover;
input (_temp1-_temp10) (:$3.);
Reason_Reject = CATX('-',OF _temp1-_temp10);
datalines;
118,106,201
;
Maxim 3: Know Your Data. Types, formats, content.
These cannot be missing character variables, as this works perfectly:
data test;
infile datalines dlm="," dsd truncover;
input (_temp1-_temp10) (:$3.);
Reason_Reject = CATX('-',OF _temp1-_temp10);
datalines;
118,106,201
;
Maxim 3: Know Your Data. Types, formats, content.
Does _temp4 contain a "." or an actual missing value " " ?
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.