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

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.

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisBrooks
Ammonite | Level 13

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

3 REPLIES 3
ChrisBrooks
Ammonite | Level 13

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".

ballardw
Super User

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.

poo
Calcite | Level 5 poo
Calcite | Level 5

Thanks ChrisBrooks and Ballardw. That is very helpful answer.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

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
  • 3 replies
  • 3203 views
  • 5 likes
  • 3 in conversation