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

Hello,

I am trying to code a simple program in which the user inputs the libname then the dataset once and several proc's and data steps are used with this dataset.  I'd like to have the option for the user to block off portions of code to run one proc or one data set independently, so I can't put everything in one giant macro.  How can I have the user input the dataset location just once then have some sort of alias or another way of referring to this dataset multiple times?  Thanks for helping out a newbie!

-Charles

1 ACCEPTED SOLUTION

Accepted Solutions
LinusH
Tourmaline | Level 20

Sorry, since you mentioned "giant macro" I asumed you were familiar with concept:

%Let myTab = MyLibref.MyLongTableNameIWant2Query;

proc print data=&MyTab.;

run;

Data never sleeps

View solution in original post

6 REPLIES 6
LinusH
Tourmaline | Level 20

Macro variable?

Data never sleeps
CharlesC
Calcite | Level 5

I'm very new to SAS-- could you give me an example?  Thanks.

CharlesC
Calcite | Level 5

Thank you very much!  Macros are still unfamiliar territory as we didn't really cover them in Base SAS Programming... I appreciate the help.

LinusH
Tourmaline | Level 20

Sorry, since you mentioned "giant macro" I asumed you were familiar with concept:

%Let myTab = MyLibref.MyLongTableNameIWant2Query;

proc print data=&MyTab.;

run;

Data never sleeps
CharlesC
Calcite | Level 5

Thank you very much! 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 6 replies
  • 1972 views
  • 3 likes
  • 3 in conversation