Capturing return value from SASGSUB command

Reply
Occasional Contributor
Posts: 13

Capturing return value from SASGSUB command

Hi Team,

 

I am using Shell Scripts to invoke SASGSUB command. I recently noticed that irrespective of whether the job is successful or not, the return code in Shell Script is 0(Success)

Extract from my shell script is below:

 

sasgsub -gridsubmitpgm $PGMDIR/$PGM -gridwait -gridwork $LOGLOC -gridsasopts "(-autoexec $AUTOEXE -config $CONFIG)"

rval=$?

 

How can i capture SASRC onto rval in the above shell script?

 

Regards,

Vimal

Occasional Contributor
Posts: 8

Re: Capturing return value from SASGSUB command

Posted in reply to Vimal_Kurup

Hi Vimal

 

Could you try running like this:

 

sasgsub -gridsubmitpgm $PGMDIR/$PGM -gridwork $LOGLOC -gridsasopts "(-autoexec $AUTOEXE -config $CONFIG)" -gridwaitresults -gridwatchout

 

rval=$?

Occasional Contributor
Posts: 13

Re: Capturing return value from SASGSUB command

Hi Sowmya,

I am working on SAS 9.3. Probably that's why it is stating the below error -
"ERROR: An unknown command line option gridwatchout was specified. Review the documentation and any previously issued error messages for resolution.
Failed to initialize cradle support"
Occasional Contributor
Posts: 8

Re: Capturing return value from SASGSUB command

Posted in reply to Vimal_Kurup

Hi Vimal,

 

Please check this link:

http://support.sas.com/resources/papers/proceedings13/470-2013.pdf

 

In it says that 

To be able to use the grid with other workload automation before SAS 9.4, SAS recommended that you use
SASGSUB in a script to do the following:
1. Run SASGSUB to submit a SAS program to the grid.
2. Run SASGSUB to determine the status of the grid job. Repeat this step until the grid job has completed.
3. Run SASGSUB to retrieve the results of the grid job.
4. Parse the results to determine whether the grid job succeeded or failed.
SAS even provides shell scripts to do this “submit/wait/get results” looping, but they are less than ideal. Starting in the
second maintenance release of SAS 9.3, SASGSUB had a GRIDWAIT option to merge step #1 and step #2, but you
still had to at least perform step #1 along with steps #3 and #4.

 

Check your sas release and may be try out some of this.

Ask a Question
Discussion stats
  • 3 replies
  • 561 views
  • 0 likes
  • 2 in conversation