I want to instead of A B C to Name Height Weight ? Thank you .
If you are reading from an actual EXCEL file (an XLSX file or even an old style XLS file) then use the RANGE option on PROC IMPORT. For that example tell it the range starts in A3 instead of the default of A1.
proc import datafile='myfile.xlxs' dbms=xlsx out=want replace ;
range='$A3:' ;
run;
Example you can use to test:
filename x temp;
proc export data=sashelp.class file=x dbms=xlsx replace;
run;
proc import datafile=x out=want replace dbms=xlsx;
range='$A2:';
run;
proc print data=sashelp.class(obs=2); run;
proc print data=want(obs=1); run;
Results:
If you are reading from an actual EXCEL file (an XLSX file or even an old style XLS file) then use the RANGE option on PROC IMPORT. For that example tell it the range starts in A3 instead of the default of A1.
proc import datafile='myfile.xlxs' dbms=xlsx out=want replace ;
range='$A3:' ;
run;
Example you can use to test:
filename x temp;
proc export data=sashelp.class file=x dbms=xlsx replace;
run;
proc import datafile=x out=want replace dbms=xlsx;
range='$A2:';
run;
proc print data=sashelp.class(obs=2); run;
proc print data=want(obs=1); run;
Results:
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.