Can we submit a JCL and get the return code in COBOL?

Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Can we submit a JCL and get the return code in COBOL?

Postby Kevin Q M Cai » Mon Mar 18, 2013 12:21 pm

Hello Guys,

Can we launch a JCL in COBOL?
if you have any ideas, please don't hesitate to let me know.

Many thanks all
Kevin Q M Cai
 
Posts: 17
Joined: Fri Mar 15, 2013 3:39 pm

Re: Can we submit a JCL and get the return code in COBOL?

Postby enrico-sorichetti » Mon Mar 18, 2013 12:26 pm

the issue has been debated quite a few times
did You search the forum ???

anyway
submit a JCL... YES
get the return code ... NO

and, last but not least
do not try to write Your own scheduling system
regards
Enrico

These users thanked the author enrico-sorichetti for the post:
Kevin Q M Cai
enrico-sorichetti
 
Posts: 2124
Joined: Fri Apr 18, 2008 11:25 pm

Re: Can we submit a JCL and get the return code in COBOL?

Postby Kevin Q M Cai » Mon Mar 18, 2013 12:42 pm

Dear Enrico,
about how to submit JCL in cobol, could you give something such as tutorial or example? thanks
and about "do not try to write Your own scheduling system", could you explain that in detail, I am sorry,
I am a newcomer for this, many things I need to learn.

Regards
Kevin
Kevin Q M Cai
 
Posts: 17
Joined: Fri Mar 15, 2013 3:39 pm

Re: Can we submit a JCL and get the return code in COBOL?

Postby enrico-sorichetti » Mon Mar 18, 2013 12:44 pm

for what reason would You want to know the <return code> of a jcl You submitted ???
regards
Enrico
enrico-sorichetti
 
Posts: 2124
Joined: Fri Apr 18, 2008 11:25 pm

Re: Can we submit a JCL and get the return code in COBOL?

Postby Kevin Q M Cai » Mon Mar 18, 2013 1:30 pm

If the submitted job returns right code, then some statements need to be executed, else they will be ignored,
and about how to submit a JCL in COBOL , could you advise me something.

Thanks a lot
Kevin
Kevin Q M Cai
 
Posts: 17
Joined: Fri Mar 15, 2013 3:39 pm

Re: Can we submit a JCL and get the return code in COBOL?

Postby Kevin Q M Cai » Mon Mar 18, 2013 1:30 pm

If the submitted job returns right code, then some statements need to be executed, else they will be ignored,
and about how to submit a JCL in COBOL , could you advise me something.

Thanks a lot
Kevin
Kevin Q M Cai
 
Posts: 17
Joined: Fri Mar 15, 2013 3:39 pm

Re: Can we submit a JCL and get the return code in COBOL?

Postby enrico-sorichetti » Mon Mar 18, 2013 1:37 pm

what is that it was not clear when I replied ...
get the return code ... NO


it would be more productive to sit down with the <person> who set the requirement
before wasting time asking on how to do something that cannot be done
regards
Enrico
enrico-sorichetti
 
Posts: 2124
Joined: Fri Apr 18, 2008 11:25 pm

Re: Can we submit a JCL and get the return code in COBOL?

Postby NicC » Mon Mar 18, 2013 1:49 pm

It seems a strange request to "Launch a JCL in COBOL". One assumes that you mean "submit". Why in COBOL? Why not using Rexx which is the more favoured approach should such a thing NEED to be done. IEBGENER will also work as will the TSO SUBMIT comman - either in foreground or in batch. Whichever way there are examples on the forum which you can find yourself - we are not a "read the forum for you" service.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

These users thanked the author NicC for the post:
Kevin Q M Cai
NicC
Global moderator
 
Posts: 2146
Joined: Sun Jul 04, 2010 12:13 am
Location: Down on the pig farm

Re: Can we submit a JCL and get the return code in COBOL?

Postby BillyBoyo » Mon Mar 18, 2013 1:54 pm

Perhaps you are used to some other Operating System? z/OS and its ancestors are not like those. If you send something to the "internal reader", it is just another method of getting something on the job input queue. Same with SUBMIT. There's no way your program "sits around waiting for 'it' to finish" by default, and it is a bad idea to code it out yourself (locks your session up until you get the return, which may be hours, and you don't even have a terminal to check on what is happening).

These users thanked the author BillyBoyo for the post:
Kevin Q M Cai
BillyBoyo
Global moderator
 
Posts: 3103
Joined: Tue Jan 25, 2011 12:02 am

Re: Can we submit a JCL and get the return code in COBOL?

Postby Robert Sample » Mon Mar 18, 2013 2:48 pm

Rethink your design. You have posted two topics that basically ask the same question, and you are being told -- REPEATEDLY -- that what you want to do is not a good idea or even possible.

If you submit a batch job from a COBOL program (which is easily done using the internal reader -- although you will have to research this in the IBM documentation and check your site standards), you cannot get any information back from that submitted job to your COBOL program. The submitted job runs completely and totally independently of your COBOL program. It is not possible, under any circumstances, for you to submit a batch job using the internal reader and then have your COBOL code do any kind of conditional logic based on the batch job and its results. Such things are the function of a job scheduler such as OPC or CA-7 or Zeke, and you are STRONGLY encouraged not to attempt to replicate them in your coding. Each of them took hundreds of thousands or millions of man-hours to develop and you, on your own, do not have the time to replicate them.

These users thanked the author Robert Sample for the post:
Kevin Q M Cai
Robert Sample
Global moderator
 
Posts: 2751
Joined: Sat Dec 19, 2009 8:32 pm
Location: Atlanta, GA

Next

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post