Page 1 of 1

about the "CALL" cobol instruction

PostPosted: Fri Jan 09, 2009 9:01 pm
by jose
hi!, i know i can use the cobol instruction "call" to call other cobol programs, but i don't know for sure whether i can use it for calling a JCL or not. And if there is a way to know in the cobol program about the correct termination of the JCL

Re: about the "CALL" cobol instruction

PostPosted: Fri Jan 09, 2009 9:23 pm
by CICS Guy
jose wrote:hi!, i know i can use the cobol instruction "call" to call other cobol programs, but i don't know for sure whether i can use it for calling a JCL or not.
Huh? What does "calling a JCL" mean?
And if there is a way to know in the cobol program about the correct termination of the JCL
Huh? Correct termination?

Re: about the "CALL" cobol instruction

PostPosted: Fri Jan 09, 2009 9:34 pm
by jose
"calling a JCL" -> the possibility of a COBOL program to request the execution of a JCL program

"correct termination" -> having a JCL which has been executed from a Cobol program (the Call instruction), how do i know about the correct termination of the JCL execution in the Cobol program
THANKS

Re: about the "CALL" cobol instruction

PostPosted: Fri Jan 09, 2009 10:11 pm
by CICS Guy
jose wrote:"calling a JCL" -> the possibility of a COBOL program to request the execution of a JCL program
A COBOL program can cause the execution of a JCL program, but by submiting the JCL via the INTRDR, not via a call......

"correct termination" -> having a JCL which has been executed from a Cobol program (the Call instruction), how do i know about the correct termination of the JCL execution in the Cobol program
No return code via the INTRDR, but looking at the jes queues could get that information.....

Re: about the "CALL" cobol instruction

PostPosted: Sat Jan 10, 2009 1:40 am
by dick scherrer
Hello,

There is no interaction between "code" and jcl. Code can "call" other code (even across languages). Code can cause jcl to be submitted via the internal reader, but not called. A "call" implies a "return". A "call" also executes a "module". JCL is completely different.

If you explain what you want to do, someone will be able to offer suggestions on how to accomplish it.

Re: about the "CALL" cobol instruction

PostPosted: Wed Jan 14, 2009 5:04 pm
by jose
Thank you very much for for hints to solve my problem, i'll try to explain you what i intend to do:
In a COBOL program i get from a file: the action to take, the name of the source file and the name of the target file. I evaluate the action to take, and I call the necessary JCL to execute the action. For instance a “copy”:

In the JCL “called” from the COBOL program I have an issue of LISTCAT to know whether both files exists or not. If Return Code greater than 8, the file doesn’t exit (accordingly with “the copy action”, the target file must exist, but must not exist for the target file)

If verything is OK:

SOURCEFILE  parameter for the source file name, which has been gotten in the cobol program

TARGETFILE  parameter for the target file name, which has been gotten in the cobol program

//STEPA EXEC=IEBGENER, PARM=’SOURCEFILE,TARGETFILE’
…
…
//SYSUT1 DD DSN=&SOURCEFILE,DISP=SHR
//SYSUT2 DD DSN=&TARGETFILE,DISP=...

Depending on the Return Code I’ll invoke a COBOL program to make an annotation of correct ending, or the failure.

//STEPB EXEC=UPDATE
…
…
// IF (STEPA.RC LE 8)
//STEPC EXEC PGM=ALLOK
// ELSE
//STEPD EXEC PGM=ERROR
// ENDIF

thank you in again for your help

Re: about the "CALL" cobol instruction

PostPosted: Thu Jan 15, 2009 3:11 am
by dick scherrer
Hello,

and I call the necessary JCL to execute the action
You persist saying you "call" JCL from cobol. I do not understand why/how you believe this. JCL is not "callable".

If you post the cobol that calls this jcl, it may help us understand :?

It will probably help if you post the complete jcl, not bits and pieces. When posting jcl (or code or data), it is best to use the "Code" tag. This makes your post more readable and preserves alignment. So you can see how this works, there is a "Preview" function that lets you see how your post will appear to the forum (rather than how it looks in the Reply editor). When you are satisfied with the way your post appears, Submit.

Re: about the "CALL" cobol instruction

PostPosted: Thu Jul 29, 2010 8:01 am
by billy10388
jose wrote:Thank you very much for for hints to solve my problem, i'll try to explain you what i intend to do:
In a COBOL program i get from a file: the action to take, the name of the source file and the name of the target file. I evaluate the action to take, and I call the necessary JCL to execute the action. For instance a “copy”:

In the JCL “called” from the COBOL program I have an issue of LISTCAT to know whether both files exists or not. If Return Code greater than 8, the file doesn’t exit (accordingly with “the copy action”, the target file must exist, but must not exist for the target file)

If verything is OK:

SOURCEFILE  parameter for the source file name, which has been gotten in the cobol program

TARGETFILE  parameter for the target file name, which has been gotten in the cobol program

//STEPA EXEC=IEBGENER, PARM=’SOURCEFILE,TARGETFILE’
…
…
//SYSUT1 DD DSN=&SOURCEFILE,DISP=SHR
//SYSUT2 DD DSN=&TARGETFILE,DISP=...

Depending on the Return Code I’ll invoke a COBOL program to make an annotation of correct ending, or the failure.

//STEPB EXEC=UPDATE
…
…
// IF (STEPA.RC LE 8)
//STEPC EXEC PGM=ALLOK
// ELSE
//STEPD EXEC PGM=ERROR
// ENDIF

thank you in again for your help


Thanks you for the post.

__________________
Watch Charlie St. Cloud