BookmarkSubscribeRSS Feed
danweifis
Calcite | Level 5

Hi, I have a macro that is compiled "somewhere" once SAS does AUTOEXEC.

 

I know the macro's name: "%UPDD" - but I don't know where is the code that compile it. 

 

I tried several options such as : MAUTOLOCDISPLAY, and others and it doesn't work.

 

I made a test, I created a  a macrotest.sas file located in C:/TMP with a macro called %macrotest. THen in another program editor, in the same session using all those options, still in the log its not displayed the location: C:/TMP/macrotest.sas which I am looking for.

 

Please help

 

THanks

7 REPLIES 7
andreas_lds
Jade | Level 19

In SAS EG the view sashelp.vextfl contains all paths that have been added to SASAUTOS. If MAUTOLOCDISPLAY doesn't display the path to the file containing the definition of the macro is not in SASAUTOS.

 

Why can't you look at the files used during session start?

 

 

danweifis
Calcite | Level 5

Thank you for the answer.

 

I guess I should be more accurate... the macro is executed on SCL frame ---- I guess. Is there a code available in order to help me on this?

 

THanks again

ballardw
Super User

@danweifis wrote:

Thank you for the answer.

 

I guess I should be more accurate... the macro is executed on SCL frame ---- I guess. Is there a code available in order to help me on this?

 

THanks again


That likely means that the code is in a catalog that the SCL is using, possibly as an SLIST entry (IIRC). Maybe.

So try to determine the catalogs used.

Then search the contents.

 

Or talk to the SAS admin about where that SCL source is. May be easier.

danweifis
Calcite | Level 5

thank you for the answer, seems this table stores macro values... what I am looking for is where is located the macro code: path + filename

 

 

LinusH
Tourmaline | Level 20

In this thread @Tom published a utility program that might help:

https://communities.sas.com/t5/SAS-Programming/Finding-Location-of-SAS-Macros/m-p/292713/highlight/t...

 

Data never sleeps
Tom
Super User Tom
Super User

Then most likely it is NOT an autocall macro.  When the macro is not compiled via autocall then it does not display an locaiton with that option.

 

Example:

3258  %macro updd;
3259  %put Note: Running &sysmacroname.;
3260  %mend updd;
3261  option mautolocdisplay;
3262  %updd;
Note: Running UPDD
3263  %put %tslit(xxx);
MAUTOLOCDISPLAY(TSLIT):  This macro was compiled from the autocall file C:\Program
                         Files\SASHome\SASFoundation\9.4\core\sasmacro\tslit.sas
'xxx'

So you need to look at your AUTOEXEC setting and the code it is running.

If you are using some tool like Enterprise Guide or SAS/Studio to send your code to SAS then you need to also look at what macros those tools have defined in your environment.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 7 replies
  • 477 views
  • 3 likes
  • 6 in conversation