update input gdg generation name automatically

Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

update input gdg generation name automatically

Postby Tintu26 » Sat Oct 17, 2015 10:38 am

i have ran a job with with one gdg file ABC.XYZ.D(-n) after job completed,
Again i want to run the same job with ABC.XYZ.D(-(n-1)) and then (n-2) and so on..

(eg- i got 4 new file..first i ran the job with -3 and then -2,-1,0. Sometimes i got 50 to 100 new files no i want to automate this.)

Can we update that gdg generation no. during run time??
please provide me complete solution with program

Thanks in advance.
Posts: 1
Joined: Wed Oct 14, 2015 8:14 am
Has thanked: 0 time
Been thanked: 0 time

Re: update input gdg generation name automatically


Re: update input gdg generation name automatically

Postby steve-myers » Sat Oct 17, 2015 12:03 pm

You do not do this in your program. Period. End of story.

You do this in your JCL -
//...     EXEC PGM=...
//...     EXEC PGM=...
In the first step, the DD statement with DD name INPUT allocates the most recent generation of the data set. The DD statement with DD name OUTPUT allocates a new generation. During execution of the job, the relative generations are fixed relative to the data set status when the job started. After the job completes, the new data set specified by the DD statement with DD name OUTPUT in the first step becomes the most recent generation and is referred to by relative generation 0 in subsequent jobs.

The concept of generation data groups is completely foreign to people used to and trained in operating systems like *nix or Windoze.

The original concept of OS/360, the Great Grandfather of z/OS, was that all data set resources are specified in JCL, These designers did not want programs to be involved with this resource. Gradually, grudgingly, really, the ability for a program to specify data set resources directly was added to the system. While it is possible for individual programs to access Generation Data Group data sets by their relative generation, it is not recommended. There are many restrictions and limitations, much more so than with non Generation Data Group data sets.

Even if you think you know what you're doing, you're probably going to do it wrong. I've been using MVS and dynamic allocation for nearly 40 years. I think I know how to do GDGs. For all that, I'm not going to build anything for production. There's too much that can break.
Global moderator
Posts: 1773
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 168 times

Re: update input gdg generation name automatically

Postby NicC » Sat Oct 17, 2015 5:35 pm

please provide me complete solution with program

OK - if you are prepared to pay. We give our time for free and in our own time and if we want to. We will give solutions but or hints but you have to code them.
As it is, I find your description totally incomprehensible so please provide sample code for what you are trying and provide that within the code tags that you can insert using the Full Editor. Failure to do so will make it more difficult for people to understand what you are trying to describe.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Global moderator
Posts: 2514
Joined: Sun Jul 04, 2010 12:13 am
Location: Down on the pig farm
Has thanked: 4 times
Been thanked: 86 times

Return to IBM Cobol


  • Related topics
    Last post