Hello everyone,
[Updated]
Thank you very much for all your helps.
after saving to CSV file. It worked.
Thank you very much
proc import datafile="&dirdata.umaru.csv" out=umaru dbms=csv
replace;
delimiter=',';
getnames=yes;
run;
proc print data=umaru;
run;
I have been a while not use SAS but I am not so sure of this.
The data is like this:
The biggest column for "id" is 3 integers
for variable "back" the biggest space is 6.
What I used was:
Data umaru;
INFILE "&dirdata.umaru.xlsx" dlm="," dsd;
INPUT id 1-3 age beck 7. ivhx 14-15 ndrugtx 16-17 race 18-19 treat 20-21 site 22-23 dfree 24-25;
run;
Thank you very much!
A appreciated all the advice. Thanks!
id age beck ivhx ndrugtx race treat site dfree
1 39 9 3 1 0 1 0 0
2 33 34 2 8 0 1 0 0
3 33 10 3 3 0 1 0 0
Or save the XLSX as CSV and use a delimited input.
It is hard to get fixed column text out of Excel but easy to get delimited: go to file>Save As> select CSV
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.