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;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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