Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Add data to seq. file from SYSIN

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
manoopatil

New User


Joined: 07 Dec 2003
Posts: 56
Location: Montreal

PostPosted: Thu Jun 26, 2008 12:34 pm    Post subject: Add data to seq. file from SYSIN
Reply with quote

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
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Thu Jun 26, 2008 12:38 pm    Post subject: Reply to: Add data to seq. file from SYSIN
Reply with quote

Code:
//g      exec pgm=iebgener
//sysut1   dd *
.......
.......
//sysut2   dd disp=(mod,.....),dsn=......
//sysin    dd dummy
//sysprint dd sysout=*
Back to top
View user's profile Send private message
manoopatil

New User


Joined: 07 Dec 2003
Posts: 56
Location: Montreal

PostPosted: Thu Jun 26, 2008 2:28 pm    Post subject:
Reply with quote

Thanks!
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Jun 26, 2008 2:32 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us