BookmarkSubscribeRSS Feed
shawnyap
Calcite | Level 5

Hi, I am a new beginner on SAS. Get a script from a programmer.

 

Anyone would be able to explain what does '&schema.' mean? what is the relationship between lib and db shown as below? Thanks.

 

%conn;
%conxn(P_AU_EDW1_FC_V,fc,lib);


proc sql;
%conxn(&schema., PAT, db);

...

quit;

2 REPLIES 2
ballardw
Super User

@shawnyap wrote:

Hi, I am a new beginner on SAS. Get a script from a programmer.

 

Anyone would be able to explain what does '&schema.' mean? what is the relationship between lib and db shown as below? Thanks.

 

%conn;
%conxn(P_AU_EDW1_FC_V,fc,lib);


proc sql;
%conxn(&schema., PAT, db);

...

quit;


This "means" that your programmer needs to learn how to document code shared or used by others.

 

&schema refers to a macro variable which would resolve to some text. Where the value is set depends on previous code or environment perhaps. Your shown use implies that at least one use of the macro variable is to pass the first parameter to another macro code block (the %conxn() bit). The documentation for the macro should tell someone what is expected for that first positional parameter.

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
  • 2 replies
  • 1211 views
  • 0 likes
  • 3 in conversation