JeffMuller608908

CODERETURN vs RETCODE

Discussion created by JeffMuller608908 on Sep 26, 2017
I have two inlcude scripts in the post process tab of my jobs.  The first one that runs searches the for "Status=17" in the report.  If it finds it, it uses "Modify_State to set the RETCODE to "1" and this can be seen in the Statistics of jobs under the "Return Code" tab.  My next include statement looks at the Statistics and pulls the return code if it not equal to 0 or 1, it activates an email.  In the job below a status 17 is found, the return code is 102, in statistics it is changed to one.  But in my second include statement, it prints 102 so my email job is activated.  I don't know why it reads 102, it seems like to me it should be a "1"?

First include statement that is run:
! Checking the report for process status resulting in success with warnings.
! Searching for lines containing the text "status=17".  The REP report tab
! contains output from PeopleSoft
: SET &HND_REPORT# = PREP_PROCESS_REPORT(,,REP, '*status=17*')

! Each retrieved line is written in the post-processing report.
: PROCESS &HND_REPORT#
:   SET &LINE# = GET_PROCESS_LINE(&HND_REPORT#)
:   PRINT '&LINE#'

! Modify the return code of the Job
:   MODIFY_STATE RETCODE = 1
!:   MODIFY_STATE STATUS_TEXT = 'Success with warning'
:   PRINT 'PeopleSoft process completed successfully but with warnings. Changed UC4 job status to ENDED_OK, return code = 1.'
: ENDPROCESS

Second Include statement:
!This include statement will be added to the post process of all nightly batch jobs
!and will look for the return code of each job and act upon it.

:SET &CODERETURN# = GET_STATISTIC_DETAIL(,RETURN_CODE)
:PRINT &CODERETURN#

:IF &CODERETURN# <> "0" or "1"
:    SET &ACTOBJ = ACTIVATE_UC_OBJECT(JOBS,SMART_EMAIL_JOBNAME.CRITICAL_JOBS)
:ENDIF

Post Processing Report:
2017-09-26 09:30:09 - U0020408     Abnormal end, status=17, retcode=0, sessionid=30550
2017-09-26 09:30:09 - U0020512 'Retcode' modified from '0000000102' to '0000000001'.
2017-09-26 09:30:09 - U0020408 PeopleSoft process completed successfully but with warnings. Changed UC4 job status to ENDED_OK, return code = 1.
2017-09-26 09:30:09 - U0020408 0000000000000102
2017-09-26 09:30:10 - U0007000 'SMART_EMAIL_JOBNAME.CRITICAL_JOBS' activated with RunID '0003102739'.



Outcomes