BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Cruise
Ammonite | Level 13

Hi All, 

 

I'm using proc import to read in my excel data to SAS. I have many variables and would like to drop variables with names starting with raw_. 

 

How can I achieve to allow limited variables based on the common prefix of variable names in the proc import or in data step using the data imported if doing this in proc import was impossible? 

 

Thank you very much for your time. 

Cruise

proc import 
datafile="mydata_Jan11.xlsx"
out=ipd
dbms=xlsx replace;
getnames=yes;
run;

 

1 ACCEPTED SOLUTION

Accepted Solutions
novinosrin
Tourmaline | Level 20
proc import 
datafile="mydata_Jan11.xlsx"
out=ipd(drop=raw_:)
dbms=xlsx replace;
getnames=yes;
run;

drop=raw_: 

View solution in original post

1 REPLY 1
novinosrin
Tourmaline | Level 20
proc import 
datafile="mydata_Jan11.xlsx"
out=ipd(drop=raw_:)
dbms=xlsx replace;
getnames=yes;
run;

drop=raw_: 

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
  • 1 reply
  • 446 views
  • 0 likes
  • 2 in conversation