Hi,
I have a job flow set up. One of the jobs has a warning (but not an error and does not fail). In this scenario the next job in the flow after the one with the warning does not start and I think this is because of the previous job having a return code. One used to be able to control this in LSF but how does one do this in Viya Flows so that the next job would start and accept a job with warnings as a complete job? I have tried abort 0 in my code which works but this changes the job status to 'Cancelled' which is not ideal.
Thanks
Andre
What warning are you getting and what steps have been taken to prevent reoccurrence of the warning?
It is a column width warning on an append as one table is updated by two different sources and columns widths are different.
But there should surely be a way to not treat warnings in this manner and where a flow will continue.
The following is not the solution for your question but it should avoid the problem.
I don't have sufficient experience with scheduling under Viya and I guess available functionality also depends on what scheduler you are using (which is?).
Imho one should always try and create production jobs that don't end with a Warning condition. If the process can create a known and expected Warning condition that's o.k. then I'd document this in the code and would also implement some logic to reset the return code (&syscc). See below sample.
data master;
length var $20;
var='AAA';
run;
data trans;
length var $10;
var='BBB';
run;
%let sv_syscc=&syscc;
proc append base=master data=trans;
run;
/* reset &syscc to 0 if warning raised due to variable length mismatch between base and data tables */
%if &sv_syscc=0 and &syscc=4 and %sysfunc(find(&SYSWARNINGTEXT,different lengths,i))>0 %then
%do;
%let syscc=0;
%end;
Thank you for the suggestion. I have tested setting the syscc to 0. This behaves the same way as abort 0. Where the return code is correct but the job status shows as cancelled on monitoring.
In your flow you can select the job dependency and choose "Ends with any exit code".
Hi @gwootton,
I have a similar situation,
Is it okay to put 5710 as the exit code if a job of the job flow completes with warnings?
I got 5710 from this website:
https://developer.sas.com/rest-apis/compute/docs/error-codes
Thank you so much in advance!
Hello ,
See blog on Job flows (in SAS Viya 3.5) :
https://communities.sas.com/t5/SAS-Communities-Library/Go-with-the-Job-Flow-in-SAS-Viya-3-5/ta-p/612...
If you have a job (in the flow) that is successful ... the return code = 0.
If you have a job (in the flow) that contains a WARNING in the LOG ... the return code = 5710.
You can specify (in the job dependencies) that the flow should continue in case of an exit code 5710.
I wouldn't put "Ends with any exit code" (!) as event type on the connection ... because then the flow will also continue if the node fails with an ERROR. And in general ... you want the flow to go into abend (you want the flow to stop) if there’s an ERROR. A WARNING is not necessarily an obstacle, but an ERROR is.
The problem is when the node is sometimes returning 0 and sometimes 5710 , because you cannot specify 2 exit codes. (you have this f.e. when you are in the WARNING period with your license key).
You can solve that with an OR-gate I believe.
An OR-gate is if any of the inputs into it are successful, then the flow will continue, so if you can set the return codes as separate inputs into it, then that should work.
The other option is to force the job (node) to return code 0 in the event of a warning. That way, anything other than a successful completion or a warning, stops the job flow.
You can use this piece of code for it (to be used with caution ... use it well thought out!):
%PUT &=syscc;
/*
SYSCC Automatic Macro Variable
Contains the current condition code
that SAS returns to your operating environment (the operating environment condition code).
Behavior depends on ERRORCHECK=SAS system option.
*/
%IF &SYSCC.=4 %THEN %DO; %LET SYSCC=0; %END;
%PUT &=syscc;
The page you specify for the ERROR-codes is a good one : https://developer.sas.com/rest-apis/compute/docs/error-codes
BR, Koen
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.