BookmarkSubscribeRSS Feed
HeatherNewton
Quartz | Level 8

I find a macro variable &g_job_date in sas programs but could not find the %let statement at all. Not even in autoexec.sas. Could it be some macro variable from SAS from a long time ago. The programs I am looking at were created over a decade ago I believe.

5 REPLIES 5
Kurt_Bremser
Super User

Macro variables can be set in numerous ways, e.g. CALL SYMPUT in a DATA step or SELECT INTO in PROC SQL.

Codes used in EG or as a stored process can receive the macro variable from a defined prompt.

 

If the use of the macro variable does not result in a WARNING, then it has been defined.

HeatherNewton
Quartz | Level 8
I searched all sas files with g_job_date and excluding those show up with &g_job_date, there much be a line somewhere defining g_job_date, right? there are no call symput or select into... what can it be??

what is EG and stored process?
Kurt_Bremser
Super User

EG is short for Enterprise Guide, the (most) widely used Windiws-based frontend for the SAS system.

A Stored Process is similar to those in SQL. It is a SAS program stored on a server, defined in SAS metadata and accessible through the Stored Process Server (a bundled pool of permanently active SAS processes accessible through an IP port). Stored processes are usually developed in EG and take the prompt definition with them into SAS metadata when the definition is made.

HeatherNewton
Quartz | Level 8

also i see variable declaration G_IFC_UTILITY_PATH using %global and it is defined as store 3rd-party software and macro, what does this mean, who is the third party here

 

there is a line in the initial sas file that runs all program and it says 

%Include "&G_IFC_UTILITY_PATH/utilities.sas"

 

what does this file do? is it a generic file from SAS?

Tom
Super User Tom
Super User

%INCLUDE means to source in the content of a text file as lines of code.

So you would want to also search such files to see if the macro is assigned its value there.

You might not be able to find the code that is setting the value of your original macro because the code is generating the name to use for the macro variable.

So I could use this statement in a data step to create G_JOB_DATE.

call symputx(catx('_','g','job','date'),today());

And you would have a hard time finding G_JOB_DATE in the code.  Even harder if part of the name comes from a variable.

 

I have seen systems that store name value pairs in text files that are read in at the top of the program.  

data _null_;
  infile 'vars.txt' truncover;
  input name :$32.  value $500.;
  call symputx(name,value);
run;

Perhaps your INCLUDE file is doing that?

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of 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
  • 5 replies
  • 559 views
  • 1 like
  • 3 in conversation