I have a requirement where i need to find the date of creation of a GDG inside the JCL itself. Actually i need to find last file of the previous month.
For example:
If todays date is 5th august 2009, i need to find the GDG which was last created in month july.
I need to compare current generation file with previous months last file. To find which GDG it corresponds to i need to fine the date of creation of each file then do a logic to get the last date, then identify the GDG version and proceed with comparison.
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
It seems to me that had a little more planning have been given to the application in the first place, then these types of checks and controils would not be required.
If you care to elaborate what you check, and why you check, then maybe a suitable answer may be available.
Also PLEASE use the correct terminology regarding a GDS. Version and generation are both valid in terms of a GDS. I guess you just used the wrong term
Joined: 17 Aug 2007 Posts: 562 Location: Iowa, USA
Also, be aware that LISTCAT shows the date the catalog entry was added. This may not be the actual creation date due to uncatalog/recatalog activity by some user.
I tried the code and then only posted here for help. I didn't ask for some one to do my job. Please understand and never hurt others like this. I used the word "guess" because that was told by one of the member in the other link(please refer to the link).
If my question is in 2 place thought i could get answer soon.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Quote:
I tried the code and then only posted here for help. I didn't ask for some one to do my job
Hello,
Trying the code available somewhere is not a big deal. expat was trying to ask you to make the code changes for your version and if you face any difficulty in that, sombody will be around to help you out.
But finding the GDG creation date alone is not going to solve your problem. You need to find the previous month and then find the last file created during previous month and compare with the latest generation. How you are planning to do all these? And I wonder why do you need to do all these checking stuff?
WHEN=GROUP,BEGIN=(),RECORDS=2,PUSH=() are not working for my version of syncsort.
Hence can someone suggest a technique to get above expected output.
Can u also give me a link or send document that explain INREC/OUTREC IFTHEN. I searched but couldn't get a good document that explain these concept well.
Arun,
Once i get the expected ouput i would sort the file on date in decending order and pick the dataset which holds the first occurance of last month.
this is in reference of the above post by Arun Raj.
my requirement is i want to find the gdg version for a given date.
i can provide that date in the overlay fields i suppose
i tried but not sure why its giving syntax error.
OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(125:X'01',55,6,UFF,PD,LENGTH=3)),
IFTHEN=(WHEN=(53,2,ZD,LT,20),OVERLAY=(125:X'00'))
OUTFIL INCLUDE=(37,8,CH,EQ,C'CREATION'),
BUILD=(81,44,C' IS CREATED ON : ',125,4,DT1,EDIT=(TTTT-TT-TT))
//*
but when i change the sysout from * to a dataset,it giving the below error.
SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 80
INREC RECORD LENGTH = 124
POTENTIALLY INEFFICIENT USE OF INREC
OUTREC RECORD LENGTH = 128
SORTOUT : RECFM=FB ; LRECL= 128; BLKSIZE= 27904
SORTOUT HAS INCOMPATIBLE LRECL
SYNCSMF CALLED BY SYNCSORT; RC=0000
SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Thanks for helping me.I tried your suggestion,still getting the same error.
32K BYTES OF EMERGENCY SPACE ALLOCATED
SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 80
INREC RECORD LENGTH = 124
POTENTIALLY INEFFICIENT USE OF INREC
OUTREC RECORD LENGTH = 128
SORTOUT : RECFM=FB ; LRECL= 128; BLKSIZE= 27904
SORTOUT HAS INCOMPATIBLE LRECL
SYNCSMF CALLED BY SYNCSORT; RC=0000
SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE