1) IML code. 2) Write a macro and CALL EXECUTE: %macro xx(dsn=); proc print data=&dsn; var variables-list ; run; %mend; data _null_; set sashelp.members(where=(libname='WORK')); call execute('%xx(dsn=work.'||memname||')'); run;
You still need to post more details...
What are are you trying to do? What do you have for starter, text files, sas datasets, SQL DB? What do you mean by read variables? What do you need as output?
Here are some guidelines on asking good questions
http://stackoverflow.com/help/how-to-ask
That was the question? Word for word?
How familiar are you with SAS?
That's a too generic and unspecified question to just give a straight answer.
Such a question in an interview situation provides you with the opportunity to demonstrate your analytical approach to requirement analysis and to showcase your understanding of SAS by asking back the right questions to get to the necessary level of detail for an answer.
It's in this regard a really good interview question as you need actual experience and knowledge to deal with it.
Last set of interviews I did, they received a technical take home exam, and I asked a question I thought was totally clear.
Of the 6 candidates - one candidate realized it was ambiguous and asked clarifying questions. That's the one I hired.
3 others interpreted it one way and 2 the other way.
1) IML code. 2) Write a macro and CALL EXECUTE: %macro xx(dsn=); proc print data=&dsn; var variables-list ; run; %mend; data _null_; set sashelp.members(where=(libname='WORK')); call execute('%xx(dsn=work.'||memname||')'); run;
1) IML code. 2) Write a macro and CALL EXECUTE: %macro xx(dsn=); proc print data=&dsn; var variables-list ; run; %mend; data _null_; set sashelp.members(where=(libname='WORK')); call execute('%xx(dsn=work.'||memname||')'); run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.