The following is the raw data set in a txt file , suppose there are two variable , one is named ID, the other is named Name . I want to read the data set , how should I do ? Thank you.
1 Nay Rong
2 Kelly Windsor
3 Julio Meraz
4 Richard Krabill
data ABC;
infile datalines;
input ID
Name&:$15.;
datalines;
1 Nay Rong
2 Kelly Windsor
3 Julio Meraz
4 Richard Krabill
;
run;
proc print data = ABC noobs;
run;
This works for me:
data have;
infile cards;
input ID Name $50.;
cards;
1 Nay Rong
2 Kelly Windsor
3 Julio Meraz
4 Richard Krabill
;;;;
run;
@tianerhu wrote:
The following is the raw data set in a txt file , suppose there are two variable , one is named ID, the other is named Name . I want to read the data set , how should I do ? Thank you.
1 Nay Rong
2 Kelly Windsor
3 Julio Meraz
4 Richard Krabill
Thank you. But it doesn't work.
above is the result.
I have sloved it . Thank you very much.
data ABC;
infile datalines;
input ID
Name&:$15.;
datalines;
1 Nay Rong
2 Kelly Windsor
3 Julio Meraz
4 Richard Krabill
;
run;
proc print data = ABC noobs;
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 lock in 2025 pricing—just $495!
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.