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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.