Appending all the members of a GDG in a single dataset



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Appending all the members of a GDG in a single dataset

Postby yogeshvalhe » Thu May 26, 2011 6:25 pm

Hello,

I have a requirement to append some members of a GDG together.

Let us a say, a GDG is defined with 60 members. However, I want to append the most recent 30 members into a single dataset.
Can anyone suggest how this can be done?

Also, I will be passing a value to determine how many GDG members to be clubbed together in a single file.
So, in a job run it is possible to use only recent 10 members and next run would require to append 30 members and some run would require to append 60 members together depending on a value. Is there a to dynamically do this?

Thank you,
Yogesh
yogeshvalhe
 
Posts: 22
Joined: Wed Aug 18, 2010 3:32 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Appending all the members of a GDG in a single dataset

Postby BillyBoyo » Thu May 26, 2011 6:59 pm

If you search the JCL forum you'll find lots about contatenating GDGs. For your requirement, you'd actually be concatenating individual generations of your GDG.

As to how to do the second part, you might be best of generating the JCL, in some programming language, with a parameter and then submitting the generated JCL. I see from your profile you know Cobol. So I'd write a little Cobol program if I were you.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Appending all the members of a GDG in a single dataset

Postby Robert Sample » Thu May 26, 2011 6:59 pm

Let us a say, a GDG is defined with 60 members.
First, a PDS has members. A GDG has generations. Terminology is critical in IT where similar terms may mean very different things. Since no GDG has ever been defined with 60 members, the fast answer to your question is that it cannot be done since GDGs don't have members.

Assuming you actually meant generations: you will need to design a process to determine how many generations are required, create the appropriate JCL, and submit it into the internal reader. What you want to do cannot be done without some form of JCL modification and submission into the internal reader.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Appending all the members of a GDG in a single dataset

Postby yogeshvalhe » Thu May 26, 2011 9:46 pm

Thank you all for your reply.
By searching the post I have got:
1) solution about concatenating all the generations (can be done by specifying the GDG base name)
2) For the 2nd part, concatenating only certain number of generations, the solutions given are either coding a COBOL pgm / Internal reader.

Can you please elaborate more on the 2nd part, I tried searching in previous post, but no luck there. Thank you.
yogeshvalhe
 
Posts: 22
Joined: Wed Aug 18, 2010 3:32 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Appending all the members of a GDG in a single dataset

Postby Robert Sample » Thu May 26, 2011 9:54 pm

If you use the GDG base name, be aware that the data will not be in sequential order. The generations are concatenated in reverse (most recently built first) generation sequence. If you have dates in your data that need to be sequenced, you'll need to sort the input.

What do you need elaboration on as far as the partial generation selection? The internal reader is usually SYOUT=(A,INTRDR) but the individual site may change this so you must contact someone at the site -- support group, team leader, or coworker -- to know for sure what to use.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Appending all the members of a GDG in a single dataset

Postby BillyBoyo » Fri May 27, 2011 11:51 am

You write a program which takes as its input, say, the number of generations you want to use. You also give the programe some "skeleton" JCL, with something in which the program can recognise for anything (like DD names) where data needs to be added. Process the skeleton and the number of generations and write your completed JCL/data to an output file.

In the JCL that runs your Cobol program, define your output file for unit testing as a dataset or PDS member, for moving through the cycle code it as writing to the internal reader (INTRDR).
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post