IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Related to using a file in comparison


IBM Mainframe Forums -> JCL & VSAM
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
Kumar Sandeep

New User


Joined: 24 Apr 2020
Posts: 10
Location: India

PostPosted: Fri Oct 16, 2020 5:30 pm
Reply with quote

I have a requirement to compare 2 files.
One file is year-end file (Dec file) and another file is respective month's file (Jan, Feb, Mar.....).
The job will compare each month's file with year-end (Dec) file and write records to output file.

It is a monthly job and each month's file created will be compared with Dec's file.
In JCL, I can mention current's month's file as A.B.C.D(0) and Dec's file as A.B.C.D.G0050V00 (say G0050V00 is Dec file's generation).
Say, Feb file will be compared with Dec file, Mar file with Dec file, likewise, Nov file with Dec file (of last year). Now, in Dec again a year-end file will be created and in that case it will not do a comparison with last year's Dec file. Again, from Jan, job will do a comparison with Dec's file which was produced last and likewise it will do for other months when the monthly job will run.
I need suggestions here. If I will mention Dec's file with generation num then at the start of every year I will have to change my JCL/Proc so that comparison will happen with the latest Dec's file only.

Is there any way so that I don't have to change my JCL/Proc every year? Any solution for this?
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Fri Oct 16, 2020 6:05 pm
Reply with quote

Have a once a year job that runs after the December file is created.

SORTIN DD DSN=A.B.C.D(0) (That is December at this point)
SORTOUT DD DSN=A.B.C.D.YEAREND(+1) (New GDG for Yearend)

You then always refer to Decembers file as A.B.C.D.YEAREND(0)
Back to top
View user's profile Send private message
Kumar Sandeep

New User


Joined: 24 Apr 2020
Posts: 10
Location: India

PostPosted: Mon Oct 19, 2020 2:16 pm
Reply with quote

Thank you.

Can we put it in the same job or do we need to create a separate job which will copy Dec file to an year-end file and then that year-end file can be used in existing job?

Please let me know if there could be any other solutions?
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Mon Oct 19, 2020 5:07 pm
Reply with quote

Can we put it in the same job or do we need to create a separate job which will copy Dec file to an year-end file and then that year-end file can be used in existing job?

I would make a separate Job that creates the Year-end dataset and have it scheduled once a year after the December run. You would use the Year-end dataset in place of the current December dataset in your current Job.

Please let me know if there could be any other solutions?

There could be several other solutions. You need to expand your mind.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Tue Oct 20, 2020 2:47 am
Reply with quote

Kumar Sandeep wrote:
Thank you.

Can we put it in the same job or do we need to create a separate job which will copy Dec file to an year-end file and then that year-end file can be used in existing job?

Please let me know if there could be any other solutions?

What has been suggested is a clean way.
1. You will need to do a one time load of 2019 dec data to this new YTD GDG+1
2. Refer YTD GDG(0) in your job now < Dec Data Set (2019).
3. Set a yearly job that run on last day of the year and create new YTD GDG(+1)
2. Make sure Step2 runs after step3 when that day comes.
You are good to go.
If you want to do in the same job then do something like ibmmainframes.com/about53750.html
Run only when its 31st dec and create a YTD GDG+1 and refer it.
Back to top
View user's profile Send private message
Pete Wilson

Active Member


Joined: 31 Dec 2009
Posts: 580
Location: London

PostPosted: Thu Oct 29, 2020 3:28 pm
Reply with quote

within the same job that creates the new YTD GDG(+1) you can have another step that refers to that new generation for input as GDG(+1). It's only in a separate job you'd need to refer to it as GDG(0).
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Fri Oct 30, 2020 1:30 pm
Reply with quote

True Indeed.
Back to top
View user's profile Send private message
Pete Wilson

Active Member


Joined: 31 Dec 2009
Posts: 580
Location: London

PostPosted: Fri Oct 30, 2020 9:14 pm
Reply with quote

There's a new jobcard keyword called GDGBIAS in Z/OS2.3 that affects this. Never tried to use it so not fully understanding how it works, but I think the default behaves as we've always understood it. Not quite sure I see the point of it.


This optional keyword parameter specifies how relative references to a
generation data set in a DD JCL statement are resolved.

Syntax

GDGBIAS={JOB|STEP}

Subparameter definition

JOB

Relative references to a generation data set are resolved on a job
basis. The system establishes the relationship between the relative
generation number and the absolute generation number when the
generation data set is first referenced in the job. This relationship
is consistent throughout the job.

STEP

Relative references to a generation data set are resolved on a job step
basis. The system establishes the relationship between the relative
generation number and the absolute generation number when the
generation data set is first referenced in each job step. Each job step
that references the generation data set establishes a new relationship.

Defaults

If no GDGBIAS parameter is specified, the system uses the default from
the job's job class that is specified at initialization. For job
classes that do not specify a default for the GDGBIAS parameter,
GDGBIAS=JOB is used.
Back to top
View user's profile Send private message
Kumar Sandeep

New User


Joined: 24 Apr 2020
Posts: 10
Location: India

PostPosted: Sat Dec 12, 2020 12:38 pm
Reply with quote

Thank you all for the replies.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
Search our Forums:

Back to Top