View previous topic :: View next topic
|
Author |
Message |
manoopatil
New User
Joined: 07 Dec 2003 Posts: 56 Location: Montreal
|
|
|
|
I am working to write a JCL which executes 4 cobol programs. After the execution of each program I need to check the return code using the IF-THEN-ELSE condition and write "success <pgm>" or "fail <pgm>" to a same sequential file for each program. So the flow is as follows. Can you please suggest which JCL utility can be used for this and how to make sure that the sequential file is getting the message "ADDED" to it for each program result.
//STEP1 EXEC PGM=COBPGM1
// IF (RC EQ 0) THEN
//MSG1 EXEC PGM= ?? <not sure which utility to use>
//DDMSG DD TSOM.MSGFILE
//SYSIN DD *
"COBPGM1 SUCCESS"
// ELSE
// MSG2 EXEC PGM=??
//DDMSG DD TSOM.MSGFILE
//SYSIN DD *
"COBPGM1 FAIL"
//
//STEP2 EXEC PGM=COBPGM2
// IF (RC EQ 0) THEN
//MSG3 EXEC PGM= ?? <not sure which utility to use>
//DDMSG DD TSOM.MSGFILE
//SYSIN DD *
"COBPGM2 SUCCESS"
// ELSE
// MSG4 EXEC PGM=??
//DDMSG DD TSOM.MSGFILE
//SYSIN DD *
"COBPGM2 FAIL"
//
At the end of the JCL, the sequential file TSOM.MSGFILE should look like this
COBPGM1 FAIL
COBPGM2 SUCCESS
COBPGM3 FAIL
COBPGM4 SUCCESS |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Code: |
//g exec pgm=iebgener
//sysut1 dd *
.......
.......
//sysut2 dd disp=(mod,.....),dsn=......
//sysin dd dummy
//sysprint dd sysout=*
|
|
|
Back to top |
|
|
manoopatil
New User
Joined: 07 Dec 2003 Posts: 56 Location: Montreal
|
|
|
|
Thanks! |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
I must admit to being just a little intrigued at why this needs to done.
Would someone help me and explain the need for this processing |
|
Back to top |
|
|
|