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;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.