BookmarkSubscribeRSS Feed
soujik
Calcite | Level 5

%add_project_specifics;
%if &jumptoexit %then %goto StopProcessingMacro;

 

How do I see this macro program in sas viya ( add_project_specifics).... if I save this program in my local drive

 

Thank you 

souj

5 REPLIES 5
yabwon
Onyx | Level 15

#Maxim1

 

GoTo macro statement: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p0jfeh75p72icen1ddd9una5zbmm.htm

 

The %goto allows to "jump" directly from one place in the code to other.

 

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



Tom
Super User Tom
Super User

You have not shared a macro.  You appear to have shared two lines from the middle of a macro.  So we don't know anything about the macro, not even the name of the macro.

 

The first line is a call to a macro named ADD_PROJECT_SPECIFICS.

The second line is a conditional branch to a label named STOPPROCESSINGMACRO in the unnamed macro.  If you are looking at the full code of this macro look for a line that has STOPPROCESSINGMACRO  followed by a colon.  That is where it will jump when the macro variable JUMPTOEXIT has a non-zero numeric value.

 

 

s_lassen
Meteorite | Level 14

How do I see this macro program?

 

Good question. Basically, look in the code above (and code that may have been %INCLUDEd along the way). If the macro is not defined there, you will have to look at the autocall macros. Start by submitting

proc options option=sasautos;run;

and then look in the places listed - some of them may be physical file names (like "c:\somebody\wrote\these\macros"), others can be logical filenames (like SASMACRO or MACROS - they do not have to be capitalized, but they are not in quotes). Then look for the file in these places, beginning with the ones first mentioned - if there are two versions of your macro in different places, then it is the one in the directory mentioned first that will be used. 

 

If you just want to get an idea of what is going on, try setting the options MPRINT, SYMBOLGEN or MLOGIC, these will show a lot about what happened in the log after submitting your macro call.

Tom
Super User Tom
Super User

If the macro is being found via AUTOCALL you could use this macro to help you get a list of currently compiled macros and what filename in the autocall path(s) looks like it might be the source.

 

https://github.com/sasutils/macros/blob/master/maclist.sas

 

Patrick
Opal | Level 21

There are a few SAS options to write more macro info to the SAS log.

MAUTOLOCDISPLAY will write to the SAS log the location from where an Autocall macro has been compiled from. Once you have this path you can look into the macro definition (the code).

And then there are of course also options MPRINT, SYMBOLGEN, MLOGIC and a few others.

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
  • 5 replies
  • 764 views
  • 2 likes
  • 5 in conversation