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

Hi,

Under Unix I will start program_A, this program will call program_B at a certain moment.
In program_B I like to check out some macro variables.

Can someone tell me which value macrovariable SYSJOBID would have, at the moment of executing program_B ?

I'm hoping for a automatic macro variable which will contain such like /<path>/program_A.sas (the calling program).

Sorry, but I can't test it on my own due to a lack of authorisation in Unix.

In SAS Enterprise_Guide the variable _SASPROGRAMFILE would have a value of program_A.
But this programs are meant to run under SAS-Unix commandline-mode.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Peter_C
Rhodochrosite | Level 12

SYSJOBID

might be the processID of the SAS session that is running (A or B)

when a sas task is launched, the name of the initial program invoked as SAS starts (as a "batch SAS task" is stored in the system option SYSIN

retrieve the value with base SAS code like

%put %sysfunc( getoption( sysin )) ;

View solution in original post

2 REPLIES 2
Peter_C
Rhodochrosite | Level 12

SYSJOBID

might be the processID of the SAS session that is running (A or B)

when a sas task is launched, the name of the initial program invoked as SAS starts (as a "batch SAS task" is stored in the system option SYSIN

retrieve the value with base SAS code like

%put %sysfunc( getoption( sysin )) ;

Hans_Netherlands
Calcite | Level 5

Thanks a lot Peter, it works great.

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
  • 941 views
  • 0 likes
  • 2 in conversation