Page 1 of 1

Alternatives to INCLUDE=MEMBER statement

PostPosted: Sat Jan 23, 2016 1:09 am
by jcllearner5
Hi,

Do we have any Alternatives to 'INCLUDE=MEMBER' statement that can be used in JCL to pass dataset names dynamically? Here is my problem.

I trigger a job to read IMS log files whenever an IMS log dataset is created. This job could run anywhere from 60 to 100 times in a day depending on how many IMS log datasets are created on any given day.

In Step1, I run IDCAMS to extract specific cataloged datasets and isolate the latest dataset and store it in a PDS member named 'XXXX' to be used as an INCLUDE MEMBER.
In Step2, I use INCLUDE MEMBER=XXXX in the place of INPUT DD statement to read that IMS log dataset and create an output dataset by just changing the HLQ of the original IMS log file.

What happens is the IMS log dataset name from the current execution of job gets stored in XXXX member but is only passed to the Job in the next run. This is causing problems some times when my job gets triggered but do not run immediately. Due to this some jobs try to read the same log file and create the same output dataset and fail.

Are there any Alternatives to INCLUDE=MEMBER statement? How can we pass the same log dataset name to another step as INPUT in the same execution of job without using INCLUDE statement?

Any help is greatly appreciated.

Re: Alternatives to INCLUDE=MEMBER statement

PostPosted: Sat Jan 23, 2016 4:09 am
by Akatsukami
Two methods come to mind (I do not say that there are not others):

  1. Place the DSN in a non-JCLLIB data set in step 1; in step 2, read it and dynamically allocate the data set
  2. In step 1, write the JCL with the DSN incorporated in it to the INTRDR as a separate job .

Re: Alternatives to INCLUDE=MEMBER statement

PostPosted: Sat Jan 23, 2016 4:49 am
by NicC
The reason you get what you get is because the JCL is interpreted in its entirety at submission time so the member is included at that time. You could do either of wht Akatsukami suggests or you could split your job after the first step so that step 2 gets submitted after that first step completes.

Re: Alternatives to INCLUDE=MEMBER statement

PostPosted: Sat Jan 23, 2016 8:20 pm
by jcllearner5
Thanks Akatsukami and Nic for your responses. I would like to go with option 1 suggested by Akatsukami i.e Place the DSN in a non-JCLLIB data set in step 1; in step 2, read it and dynamically allocate the data set.

Any idea how I can do so? I tried to use temp datasets to store the desired dynamic dataset name and allocate it in the following steps but it did not work. I would like to it in the same run of the job.
Any suggestions would be helpful and appreciated.

Thank You.

Re: Alternatives to INCLUDE=MEMBER statement

PostPosted: Sun Jan 24, 2016 1:48 am
by Robert Sample
I tried to use temp datasets to store the desired dynamic dataset name and allocate it in the following steps but it did not work. I would like to it in the same run of the job.
As pointed out earlier, JCL goes through the converter / interpreter process when the job is read into the system. Hence it is not possible for you to modify the JCL of an executing job, under any circumstances, ever. So if you expect to have JCL to allocate a dynamic data set DD statement in the same job, that's not going to happen. You could write a program using the language of your choice to use BPXWDYN to dynamically allocate a data set (which does not require a DD statement in the JCL) and access it that way. However, if you insist on having a DD statement, you have no choice but to submit a job through the internal reader that contains the DD statement.

Re: Alternatives to INCLUDE=MEMBER statement

PostPosted: Mon Jan 25, 2016 2:37 am
by jcllearner5
Thanks Robert. Yes, I indeed need a DD statement in the JCL. So, from all of the responses from the experts I understand that I can not even use BPXWDYN for my process. Looks like my only option is to use the internal reader.

Re: Alternatives to INCLUDE=MEMBER statement

PostPosted: Mon Jan 25, 2016 5:17 am
by Robert Sample
BPXWDYN works great. However, it does not use a DD statement in JCL but allocates dynamically. So for your requirement you will have to submit another job to the internal reader.