Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 757
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: 757
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. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us