I want to import excel sheet which have multiple sheet and load the sheet's data in uppercase (i.e. everything in uppercase- variables and observations all ).
Can you post an example of how the resulting dataset should look like?
Using sashelp.cars a data step changing all alphanumeric vars to uppercase could look like this:
/* untested */
data want;
set sashelp.cars;
array cvars _character_;
do i = 1 to dim(cvars);
cvars[i] = upcase(cvars[i]);
end;
drop i;
run;
Do the import into a SAS data set, then you can convert everything to uppercase using the UPCASE function.
data want;
set have;
array text _character_;
do i=1 to dim(text);
text(i)=upcase(text(i));
end;
run;
Can you post an example of how the resulting dataset should look like?
Using sashelp.cars a data step changing all alphanumeric vars to uppercase could look like this:
/* untested */
data want;
set sashelp.cars;
array cvars _character_;
do i = 1 to dim(cvars);
cvars[i] = upcase(cvars[i]);
end;
drop i;
run;
The following example is copying sheets of excel "c:\temp\date.xlsx" into WORK library.
Change the path of excel file and libname according to yours.
options validvarname=any validmemname=extend;
libname x xlsx 'c:\temp\date.xlsx';
filename x temp;
proc cport library=x file=x OUTTYPE=UPCASE;
run;
proc cimport library=work infile=x;
run;
libname x clear;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.