![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 's | manas6 | UNIX for Dummies Questions & Answers | 0 | 06-05-2008 03:44 AM |
| return code from script | mpang_ | Shell Programming and Scripting | 2 | 10-23-2007 02:50 PM |
| Passing exit code to calling script | debbiekuch | Shell Programming and Scripting | 2 | 09-18-2006 06:46 AM |
| Capture Oracle return code in shell script | Vikas Sood | Shell Programming and Scripting | 1 | 05-22-2006 02:32 PM |
| Store return code of shell script in oracle table | sveera | Shell Programming and Scripting | 3 | 05-04-2005 10:25 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have a KornShell script that has successfully been scheduled through Cron. We are in the process of changing over from Cron to using CA-Unicenter. To negative test the script I put a bad return code in. At the bottom of the script an e-mail is sent using mailx and then the return code is set using "exit 2". However, CA-Unicenter gets a zero return code back. If I comment out the mailx code, then CA-Unicenter will show up with a return code of 2. My assumption is that the mailx command ends with a zero return code and CA-Unicenter gets it and assumes its from the KornShell script. Here's the piece of code in question:
CENTMSGRC=2 print $CENTMSGRC >> /appl/cmddba/bin/job.log mailx -s "$subject" "$MAILTO" </appl/cmddba/bin/job.log print $CENTMSGRC >> /appl/cmddba/bin/job.log exit $CENTMSGRC Do you have any idea if my theory is correct? And if it is, do you know a solution to my problem besides creating another Script that will just send the e-mail message and have the script executed after the first one. Thanks, Connie |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
We have discovered that there is a setting within CA-Unicenter that will fix this problem. The following 2 configuation changes where made in CA-Unicenter:
enfcontrol JOB TRIGGER EXITMAIN instructs CAIENF to consider a job as completed when the main process of the job has completed. We have used this for jobs such as starting a database, the database pid remains active, yet the script that started them can end. enfcontrol JOB RC EXITMAIN The control option JOB RC indicates that the exit return code presented by CAIENF to the Unicenter-TNG Workload Management component is the exit code of the main process (shell script). So essentially CA-Unicenter has been configured to only accept the exit code from the main process script. Connie |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|