View previous topic :: View next topic
|
Author |
Message |
jamshirqureshi
New User
Joined: 13 Aug 2006 Posts: 20 Location: mumbai
|
|
|
|
Hi Friends
Can We pass value from Cobol to JCL. If yes can anybody tell me How?
Jamz |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Hi !
Do you mean the ReturnCode ???
Move 8 to return-code. Then programm ends with rc=8.
Regards, UmeySan |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
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 |
|
|
jamshirqureshi
New User
Joined: 13 Aug 2006 Posts: 20 Location: mumbai
|
|
|
|
Thanks
Jamz |
|
Back to top |
|
|
|