change the status code in unix

Reply
Contributor LRN
Contributor
Posts: 57

change the status code in unix

Hi

could someone help me on how to change the status code in unix. Warning messages gives status code = 1. which is causing my control-m jobs to throw error. i would like to change the status code = 0 when there is warning messages (status code=1).

Thank you

LR

Super User
Posts: 5,257

Re: change the status code in unix

Are you using a SAS configuration (Lev1/SASApp etc)?

If so, edit the wrapper script in the BatchServer directory. Usually it has some commented code which you easily could edit for this purpose.

If not, you can create a wrapper script on your own, where check for the SAS return code, and alter if necessary.

But, why do you have warnings? Perhaps it's better to create "better" programs that does not throw warnings Smiley Wink

Data never sleeps
Contributor LRN
Contributor
Posts: 57

Re: change the status code in unix

Hi,

I wish i could work on the code. But that is done by different team. Smiley Sad

Contributor LRN
Contributor
Posts: 57

Re: change the status code in unix

Hi LinusH,

if you have any sample wrapper script, could you please share it with me.

Thank you

Super User
Posts: 5,257

Re: change the status code in unix

Check at the bottom of this page, should apply independent of Scheduling SW:

Scheduling in SAS(R) 9.4

Data never sleeps
Contributor LRN
Contributor
Posts: 57

Re: change the status code in unix

Hi, I got the script. it worked fine. Thank you Smiley Happy

Respected Advisor
Posts: 3,777

Re: change the status code in unix

%let syscc=0;

Contributor LRN
Contributor
Posts: 57

Re: change the status code in unix

Hi, I am still getting the same error.

Trusted Advisor
Posts: 1,300

Re: change the status code in unix

The SYSCC macro variable is what you want to use.  If this is not resolving you issue, your will need to provide some more context to your problem, such as some code/log from the process and what you are using outside of SAS to capture the status.  You should set the SYSCC variable to 0 as the very last step in your code for it to have the appropriate effect.  You should also probably only set it to overwrite if a warning condition is actively set (SYSCC=4).

SAS(R) 9.2 Macro Language: Reference

EDIT: I see that you said you are using the control-m scheduler to submit the jobs, I assume this is the tool reporting the SAS termination status to you.

Respected Advisor
Posts: 3,777

Re: change the status code in unix

Did you set it as the very last act?  I tested it and believe it works.  You should look at the documentation too.

Valued Guide
Posts: 3,208

Re: change the status code in unix

Why not use ctrl-m options. Set the acceptance level for the jobs that are allowed to have warnings that way. Quite common with schedulers. In my old time c=0 allok c=4 is a warning c=8 an error and c=12 abend. All be adjusted like that in the flow of the scheduler.

---->-- ja karman --<-----
Contributor LRN
Contributor
Posts: 57

Re: change the status code in unix

Thank you for the information. I didn't know we could do that. I spoke with control-m team. but couldn't solve this issue. I will try this option.

Trusted Advisor
Posts: 1,300

Re: change the status code in unix

There are many ways to skin a cat...

Ask a Question
Discussion stats
  • 12 replies
  • 352 views
  • 4 likes
  • 5 in conversation