DATA Step, Macro, Functions and more

Unix - called programs - automatic macro variables

Accepted Solution Solved
Reply
New Contributor
Posts: 4
Accepted Solution

Unix - called programs - automatic macro variables

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


Accepted Solutions
Solution
‎01-31-2013 06:59 PM
Valued Guide
Posts: 2,174

Re: Unix - called programs - automatic macro variables

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


All Replies
Solution
‎01-31-2013 06:59 PM
Valued Guide
Posts: 2,174

Re: Unix - called programs - automatic macro variables

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 )) ;

New Contributor
Posts: 4

Re: Unix - called programs - automatic macro variables

Thanks a lot Peter, it works great.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 250 views
  • 0 likes
  • 2 in conversation