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! 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 6 replies
  • 1120 views
  • 3 likes
  • 3 in conversation