Page 2 of 2

Re: Call a JCL by program.

PostPosted: Sat Nov 10, 2012 11:35 am
by Mehdi shri
Dear dick scherrer
In our operational environment PROGA must run once every night via a JCL. But now in our test invironment I want to run it multiple of times to simulate for example 10 night passed. Its may be not true to use thw word "test the functionality " of PROGA. I want just run PROGA multiple of times via MYPROG and MYPROG must change the PARM1 for PROGA also.

Re: Call a JCL by program.

PostPosted: Sun Nov 11, 2012 5:25 am
by dick scherrer
Hello,

Suggest you simply change MYPROG to create 10 sets of jcl for PROGA and either submit this thru the internal reader or write it to a dataset or member and submit this.

You will have the 10 executions of PROGA that you want. COnvenitntly, they will all be in one set of sysouts.

Re: Call a JCL by program.

PostPosted: Sun Nov 11, 2012 10:37 am
by Mehdi shri
Thank you dick scherrer.
What is the statement for using internal reader in COBOL.

Re: Call a JCL by program.

PostPosted: Sun Nov 11, 2012 10:54 am
by steve-myers
Mehdi shri wrote:... What is the statement for using internal reader in COBOL.
You define an internal reader to your program using JCL, as discussed in MVS JCL Reference and MVS JCL User's Guide for your z/OS release. This has not changed in almost 40 years. All your program does is use standard Cobol methods to open the data set, write to the data set, and close the data set as though it is a sequential data set. There are no special Cobol statements to use an internal reader.

Re: Call a JCL by program.

PostPosted: Sun Nov 11, 2012 1:49 pm
by BillyBoyo
In addition to actually using the INTRDR (Internal Reader) you can, for your initial testing, just create a "normal" sequential file, even SYSOUT=* (or whatever), so that you know you've got things right before tossing the job through the INTRDR.

If writing to an actual dataset, you can edit the dataset and use SUBmit if it looks OK. It doesn't have to go through the INTRDR, that doesn't make the job work or not, it is just a way of then automating the process.

Re: Call a JCL by program.

PostPosted: Mon Nov 12, 2012 12:02 am
by steve-myers
BillyBoyo's idea of specifying SYSOUT=* or specifying a real data set to review to job before actually submitting it is excellent; I've done this many times over my career.

Re: Call a JCL by program.

PostPosted: Mon Nov 12, 2012 1:39 am
by dick scherrer
Hello,

I've also been known to generate the early testing with a JCL Error in the submitted job so that while i'm making sure i built the job correctly it can be submitted with no fear of running and having the system validate the jcl as much as possible . . .

Re: Call a JCL by program.

PostPosted: Mon Nov 12, 2012 6:06 am
by steve-myers
Another excellent idea; one I've done many times over the course of my career.
//A        JOB ...
// THIS IS A JCL ERROR!
//MOREJCL EXEC ...