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_: 

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