BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
varshabansal
Obsidian | Level 7

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 ).

 

1 ACCEPTED SOLUTION

Accepted Solutions
andreas_lds
Jade | Level 19

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;

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

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;

 

--
Paige Miller
andreas_lds
Jade | Level 19

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;
Ksharp
Super User

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;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1726 views
  • 0 likes
  • 4 in conversation