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
 

 

Can we pass value from COBOL to JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
jamshirqureshi

New User


Joined: 13 Aug 2006
Posts: 20
Location: mumbai

PostPosted: Wed Dec 27, 2006 3:19 pm    Post subject: Can we pass value from COBOL to JCL
Reply with quote

Hi Friends

Can We pass value from Cobol to JCL. If yes can anybody tell me How?

Jamz
Back to top
View user's profile Send private message

UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 755
Location: Germany

PostPosted: Wed Dec 27, 2006 3:29 pm    Post subject:
Reply with quote

Hi !

Do you mean the ReturnCode ???

Move 8 to return-code. Then programm ends with rc=8.

Regards, UmeySan
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Wed Dec 27, 2006 5:19 pm    Post subject:
Reply with quote

Hi There,

Please refer the below link

http://ibmmainframes.com/viewtopic.php?t=16020&start=15
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 755
Location: Germany

PostPosted: Wed Dec 27, 2006 6:09 pm    Post subject:
Reply with quote

Hi !

I before mentioned the return-code field in cobol to passing Rc-Value to JCL to control the job-flow.

You also can pass a complete separate job back to the system (JES).
Perhaps, depending on a situation, your programm has to activate two different processes.

1.) you could achieve it by setting return-code an leaving programm.
back in JCL you could evaluate the rc by using JCL-IF-Statement for the next following two steps.

STEP010 EXEC PGM=HUGO,DYNAMNBR=20

// IF (RC EQ 0) THEN
//STEP020 EXEC PGM=INGE
//SYSPRINT DD SYSOUT=*
// ENDIF

// IF (RC EQ 4) THEN
//STEP020 EXEC PGM=PETRA
//SYSPRINT DD SYSOUT=*
// ENDIF

// IF (RC EQ 8) THEN
//STEP030 EXEC PGM=JUTTA
//SYSPRINT DD SYSOUT=*
// ENDIF



2.) You could sent a complete Job to JES and run it via internal Reader.
I do not prefer this. But for the sake of completeness i just tell you.

In comon, you write the job-control-cards to a seq-file and this is specified
in the JCL as input for the internal reader.
//FILE DD SYSOUT=(*,INTRDR)

Little example:

ID DIVISION.
PROGRAM-ID. HUGO.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT FILE ASSIGN TO FILE
DATA DIVISION.
FILE SECTION.
FD FILE.
01 FILEREC PIC X(80).
WORKING-STORAGE SECTION.
...

PROCEDURE DIVISION.
OPEN OUTPUT FILE

MOVE '//IER1337 JOB NOTIFYIER1337' TO FILEREC
WRITE FILEREC

MOVE '//STEP1 EXEC PGM=IEFBR14' TO FILEREC.
WRITE FILEREC

...

CLOSE
GOBACK

But as I said, I do not prefer this for normal applikation programms.
I did it sometimes, but there had been requirements in system-programms for that.

Regards, UmeySan
Back to top
View user's profile Send private message
jamshirqureshi

New User


Joined: 13 Aug 2006
Posts: 20
Location: mumbai

PostPosted: Thu Dec 28, 2006 9:55 am    Post subject:
Reply with quote

Thanks
Jamz
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts COBOL Programming Sandpit? jodrisco COBOL Programming 6 Wed Apr 12, 2017 3:47 am


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