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 " " ?
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 save with the early bird rate—just $795!
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.