Page 1 of 1

Can we assign a file dynamically using JCL?

Posted: Thu Nov 12, 2015 11:03 am
by Mayank Gosavi
Hi,

Can we make dynamic file assignment using JCL? Was the question which made me silent for long in the interview. The interviewer continued saying, Can we do this instead of static assignment which we usually do in JCL using DDName for a COBOL program? If we can, how do we do it, explain.

Re: Can we assign a file dynamically using JCL?

Posted: Thu Nov 12, 2015 4:31 pm
by enrico-sorichetti
the IQ of the interviewers has always been on the low side

but looks that it is going down the TB even more

You should have asked what he/she meant by
Can we make dynamic file assignment using JCL?
anyway if the dataset is going to be allocated dynamically by the running program
the JCL will not contain a DD for the dataset

Re: Can we assign a file dynamically using JCL?

Posted: Thu Nov 12, 2015 6:53 pm
by Robert Sample
There are a couple of ways (one is using BPXWDYN) to dynamically allocate a data set without having a DD statement for the JCL. However, as the question is worded the answer is no because JCL allocates resources to execute programs and that's all it does -- it cannot dynamically allocate a data set because that requires a program and JCL will execute programs but is not a program.