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:
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.