GDG interview question

jcl interview questions

Moderator: Moderator Group

Post Reply
sonakasi
Member
Posts: 20
Joined: Wed Nov 09, 2011 9:09 am
Location: India

GDG interview question

Post by sonakasi » Tue Jan 03, 2012 8:12 pm

Hi All,
I have 2 questions on GDG
QUES1 :
A Job has 3 steps
1) Step01 creating New GDG file(+),
2) Step02 Input from step01
3) Step03 Input from Step02
When we run this job, it gets an abend in step02, so when we restart the job what will be the version of file. ???

QUES2: A Job has 3 steps
1) Step01 creating New GDG file(+),
2) Step02 Delete file(+),
3) Step03 create new GDG file with same file name
What is the version for that file?
SONA KASI

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Wed Jan 04, 2012 12:39 am

Basically, you need to rethink the question.

When you create a (+1) you are creating a new generation NOT a new version. There is such a thing as a version, but you should probably never try to use it - it is almost never used in business application processing.

q1
If step one successfully creates a new generation, it will susvive the abend in step2.

q2
Well managed systems will not permit this kind of job to exist. . . There is neither a technical nor a business reason to handle a gdg this way.
Have a good one

sonakasi
Member
Posts: 20
Joined: Wed Nov 09, 2011 9:09 am
Location: India

Post by sonakasi » Wed Jan 04, 2012 4:24 pm

Thanks for your reply !!
SONA KASI

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Wed Jan 04, 2012 6:26 pm

For the sake of an answer, for question 2, if the Job is like this:

Code: Select all

//STEP01   EXEC PGM=IEFBR14                  
//SYSUT1   DD  DSN=HLQ.FIRST.GDG(+1),        
//             DISP=(NEW,CATLG,DELETE),      
//             UNIT=SYSDA,RECFM=FB,LRECL=80, 
//             SPACE=(CYL,(1,1),RLSE)        
//*                                          
//STEP02   EXEC PGM=IEFBR14                  
//SYSUT2   DD  DSN=HLQ.FIRST.GDG(+1),        
//             DISP=(MOD,DELETE,DELETE)      
//*                                          
//STEP03   EXEC PGM=IEFBR14                  
//SYSUT3   DD  DSN=HLQ.FIRST.GDG(+1),        
//             DISP=(NEW,CATLG,DELETE),      
//             UNIT=SYSDA,RECFM=FB,LRECL=80, 
//             SPACE=(CYL,(1,1),RLSE)
You'll have HLQ.FIRST.GDG..G0001V00.
Regards,
Anuj

sonakasi
Member
Posts: 20
Joined: Wed Nov 09, 2011 9:09 am
Location: India

Post by sonakasi » Wed Jan 04, 2012 8:03 pm

Hi Anuj,
After completion of the job, the current version will always point to the one successfully created and it will be version '0' and thats why in the above job you have mentioned as ''You'll have HLQ.FIRST.GDG..G0001V00"..... am I right in telling that ???
SONA KASI

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Wed Jan 04, 2012 10:46 pm

No, that is not right.

Version 0 has NOTHING to do with anything in this topic. You really should forget the such a thing as a "version" even exists until such time that ever does become an issue. 99.999% of application developers NEVER use "version" - always generation.

The last generation created can be used by coding dsn(0) in subsequent jobs. This is relative generation (as opposed to actual/specific generation. It is NOT version.
Last edited by DikDude on Thu Jan 05, 2012 11:32 pm, edited 1 time in total.
Have a good one

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Thu Jan 05, 2012 6:51 pm

Looks like you've confused yourself with my answer. Sometimes, Interviewers are of thick skin and they need answer for everything they vomit in front of you - I thought my answer will help you to understand it better for next interview.

I did not get in "version" and "generation" discussion becasue DikDude has explained it very cleary, however, for my $.02, I'll talk about it:

"Version" and "generation" does have their meaning when talking about GDGs. However, when you code HLQ.FIRST.GDG(+1) -- next GENERATION gets created. No version (V00 to V01 or whatever you can think of) increments/changes happen, whatsoever. Version is still "00". Said that, You can still create the next version BUT neither it's advised nor it will be 'attached' to the GDG-base.

If generation HLQ.FIRST.GDG.G0001V00 is cataloged and you now create and catalog HLQ.FIRST.GDG.G0001V01, this is just another DSN but as the "base" is same, the new entry is cataloged in the location previously occupied by HLQ.FIRST.GDG.G0001V00. The old entry is removed from the catalog, to make room for the newer version, and may or may not be scratched depending on what limit processing options are specified for the GDG base.

Said all that - with the rank question you've asked, suggest you just remember - at given isntant only one version of a GDG is existing. Just DON'T PLAY WITH VERSION.

For your response to my reply - I'd say -- please try executing the job with proper job-card, having only first step, then first two steps and then all the three steps.
Regards,
Anuj

nareshv_99
Member
Posts: 25
Joined: Sun Feb 05, 2012 10:59 pm
Location: Bangalore

Post by nareshv_99 » Mon Feb 06, 2012 9:11 pm

A Job has 3 steps
1) Step01 creating New GDG file(+),
2) Step02 Input from step01
3) Step03 Input from Step02
When we run this job, it gets an abend in step02, so when we restart the job what will be the version of file. ???
when it gets abend step01 has already run so step01 creates a new +1 version. so when you rerun it again it'll create the new version.

QUES2: A Job has 3 steps
1) Step01 creating New GDG file(+),
2) Step02 Delete file(+),
3) Step03 create new GDG file with same file name
What is the version for that file?

it creates a new version.

correct me if i'm wrong..

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Tue Feb 07, 2012 1:05 am

nareshv_99 - you obviously did not read and UNDERSTAND the various posts above. Nowhere is a new VERSION created - a new GENERATION is created. The version is the bit after the V in the generation number. This will always be 00 unless specifically coded.
Regards
Nic

nareshv_99
Member
Posts: 25
Joined: Sun Feb 05, 2012 10:59 pm
Location: Bangalore

Post by nareshv_99 » Tue Feb 07, 2012 8:51 am

here i mean generation..
when you give (+1) it always creates generation.. i dont understand why you people were talkin about version??

e.g:
//outdd dsn dd=test.gdgbase(+1),
// disp=(,catlg,)
// ..


it always creates test.gdgbase.g0002v00 provided test.gdgbase0001v00 was the previous gdg..

so my ques. is when you give (+1) why the new version will create ?

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Tue Feb 07, 2012 11:28 am

so my ques. is when you give (+1) why the new version will create ?
It will not create a new version but it will create a new generation.

We are talking (not talkin) about versions because the TS (topic starter) mentioned versions instead of generation. Of course, it could have been a trick question on behalf of the interviewer - if they said 'version' then they could be expecting the answer 'V00' thus showing that the interviewee knows the difference between 'generation' and 'version'.
Regards
Nic

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others