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 " " ?
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.