Can we assign a file dynamically using JCL?

All sort of Mainframes Interview Questions.
Post Reply
Mayank Gosavi
New Member
Posts: 1
Joined: Thu Dec 11, 2014 11:44 pm

Can we assign a file dynamically using JCL?

Post 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.
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 826
Joined: Wed Sep 11, 2013 3:57 pm

Re: Can we assign a file dynamically using JCL?

Post 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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1891
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Can we assign a file dynamically using JCL?

Post 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.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Interview Questions.”