• Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

Unix scripts

jdcmwilson

Well Known Member
JDE List,

I am attempting to use AutoSys (a Unix scheduling package from CA) in
conjunction with OneWorld and am having quite good success. I just have one
issue that I am hoping someone can help me with.

AutoSys only has the capability to handle errors in the following way:

There is a parameter that is called "Maximum Exit Code for Success" within
AutoSys and this works great when an Exit Code of 0 mean "success" and maybe
Exit Code of 1 means "failure". Because you have to set a Maximum, OneWorld
doesn' report to AutoSys successfully because in OneWorld a 0 is "success"
and a 1 is "failure". I would like to set my $? variable in a script so
that if OneWorld is successful I change it to a 1 and if it fails I change
it to a 0 so that AutoSys can handle the jobs successfully.

I know this is probably confusing, but the bottom line is I need to know how
to write a unix script (ksh) that changes my Exit Code of a 1 (success) to a
0 and changes 0s to 1 (or something higher).

Please advise if anyone has any ideas.

James Wilson
CNC Consultant

OW Xe B73.3.3 SP16 AIX
IBM RS/6000 AIX 4.3.3 Enterprise Server (Central Objects)
Oracle DB 8.1.6.3
NT 4.0 Deployment Server
"fat" Win95/Win98 and TSE/Citrix "thin" clients
ZenWorks - using to deploy initial OneWorld clients





All views are expressly my own and in no way reflect those of my employer.
 

Larry_Jones

Legendary Poster
Hi James,

try this code - it should work for ksh also.
----------------------------------------
#! /bin/sh

#run your OneWorld Process here

#Test Return Code and change it
if [ $? = 0 ]; then
rval=1 # Job successful
else
rval=0 # Job Failed
fi

exit $rval
---------------------------------------

Regards,

Larry Jones
ljones@wagstaff.com
OneWorld XE, SP 15.1
HPUX 11, Oracle SE 8.1.6
Mfg, Distribution, Financials
 

Amits

Active Member
I am also trying to do the same stuff. Only issue that I am facing is that UNIX scripts completes before the batch job status changes to 'Done' on the F986110 table. How did you handle that.. plz help.
 

Larry_Jones

Legendary Poster
Perhaps if you explain why you care when the Batch Job Status changes to 'Done'?

While you're at it please include your configuration info on your post.
 

Amits

Active Member
Hi Larry,

The unix script which invokes the batch jobs, ends immediately after invoking the batch job. If you check the batch job status in Submitted jobs, it will still be at Processing stage. So if we check for the status of the Batch jobs in F986110 server map then we can make the Unix script end after the Batch job gets processed.
 

Larry_Jones

Legendary Poster
Sorry Amit,

You're absolutely right. On UNIX RunUBE signals the OW runtime to create a new background job (inserts into the queue) and ends immediately. I don't think there is any easy way to monitor completion from the runube script itself . . . You could modify the submitted UBE(s) to write status information into log files that are monitored by your script though. One idea - not a very good one.

Regards,
 

Larry_Jones

Legendary Poster
I'm sure you've read AltQuark's post - which described how you can do what you want. Please ignore my mis-information.
 
Top