about the "CALL" cobol instruction



about the "CALL" cobol instruction

Postby jose » Fri Jan 09, 2009 9:01 pm

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
jose
 
Posts: 4
Joined: Fri Jan 09, 2009 8:43 pm
Has thanked: 0 time
Been thanked: 0 time

Re: about the "CALL" cobol instruction

 

Re: about the "CALL" cobol instruction

Postby CICS Guy » Fri Jan 09, 2009 9:23 pm

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?
CICS Guy
 
Posts: 255
Joined: Wed Jun 20, 2007 4:08 am
Has thanked: 0 time
Been thanked: 0 time

Re: about the "CALL" cobol instruction

Postby jose » Fri Jan 09, 2009 9:34 pm

"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
jose
 
Posts: 4
Joined: Fri Jan 09, 2009 8:43 pm
Has thanked: 0 time
Been thanked: 0 time

Re: about the "CALL" cobol instruction

Postby CICS Guy » Fri Jan 09, 2009 10:11 pm

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.....
CICS Guy
 
Posts: 255
Joined: Wed Jun 20, 2007 4:08 am
Has thanked: 0 time
Been thanked: 0 time

Re: about the "CALL" cobol instruction

Postby dick scherrer » Sat Jan 10, 2009 1:40 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: about the "CALL" cobol instruction

Postby jose » Wed Jan 14, 2009 5:04 pm

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
jose
 
Posts: 4
Joined: Fri Jan 09, 2009 8:43 pm
Has thanked: 0 time
Been thanked: 0 time

Re: about the "CALL" cobol instruction

Postby dick scherrer » Thu Jan 15, 2009 3:11 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: about the "CALL" cobol instruction

Postby billy10388 » Thu Jul 29, 2010 8:01 am

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
billy10388
 
Posts: 2
Joined: Thu Jul 29, 2010 7:52 am
Has thanked: 0 time
Been thanked: 0 time


Return to Off-Topics