DATA Step, Macro, Functions and more

Question regarding Syslast Automatic macro variable

Accepted Solution Solved
Reply
Occasional Contributor poo
Occasional Contributor
Posts: 10
Accepted Solution

Question regarding Syslast Automatic macro variable

The following SAS code is submitted:

%macro houses(dsn = houses,sub = RANCH);

data &dsn;

set sasuser.houses;

if style = "&sub";

run;

%mend;

%houses(sub = SPLIT)

%houses(dsn = ranch)

%houses(sub = TWOSTORY)

Which one of the following is the value of the automatic macro variable SYSLAST?

A. work.ranch

B. work.houses

C. WORK.RANCH

D. WORK.HOUSES

It should be work.ranch but I have different answer in answer sheet.


Accepted Solutions
Solution
‎06-16-2014 08:30 PM
Super Contributor
Posts: 438

Re: Question regarding Syslast Automatic macro variable

It's WORK.HOUSES - the final macro call doesn't override the default data set name, it only overrides the default subset value so you have a data set called WORK.HOUSES only containing records where style="TWOSTORY".

View solution in original post


All Replies
Solution
‎06-16-2014 08:30 PM
Super Contributor
Posts: 438

Re: Question regarding Syslast Automatic macro variable

It's WORK.HOUSES - the final macro call doesn't override the default data set name, it only overrides the default subset value so you have a data set called WORK.HOUSES only containing records where style="TWOSTORY".

Super User
Posts: 11,343

Re: Question regarding Syslast Automatic macro variable

And it is the upper case value because that's the way SAS considers all library, table and variable names since it is case insensitive generally.

Occasional Contributor poo
Occasional Contributor
Posts: 10

Re: Question regarding Syslast Automatic macro variable

Thanks ChrisBrooks and Ballardw. That is very helpful answer.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 1035 views
  • 5 likes
  • 3 in conversation