Hi,
Environment : SAS ODAMID/ SAS Studio
I am trying to create a dataset using datalines, wherein one of the columns has leading spaces. I want to keep the leading spaces in the created dataset which is not happening by default.
Would appreciate any help. Thanks in advance.
Example
data exp3;
infile datalines delimiter=",";
INPUT SNO :8. cat :$150.;
datalines;
1, main category
2, sub category
;
run;
Output (Default)
It's an informat thing. Use the $Charw. instead like this
data exp3;
infile datalines delimiter=",";
INPUT SNO :8. cat :$char150.;
datalines;
1, main category
2, sub category
;
run;
It's an informat thing. Use the $Charw. instead like this
data exp3;
infile datalines delimiter=",";
INPUT SNO :8. cat :$char150.;
datalines;
1, main category
2, sub category
;
run;
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.