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.
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
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:
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.