Joined: 12 May 2010 Posts: 44 Topics: 12 Location: India
Posted: Thu Jul 01, 2010 9:18 am Post subject: how to select the latest PS file
Hi;
i have a requirement on how to get latest generated PS file in the PDS.
My PS file looks like
'aaaa.bbbb.cccc.v0001'
.
..
'aaaa.bbbb.cccc.v0007'
.
'aaaa.bbbb.cccc.v0009'
So the JCL has to select the latest generated PS file( ie..compare the last qualifier of the PS file,which is higher that would be a latest(for this case v0009)).
Please write a JCL for the above requirement.
Please help on this...
Joined: 12 May 2010 Posts: 44 Topics: 12 Location: India
Posted: Fri Jul 02, 2010 2:49 am Post subject:
Hi;
I agree the GDG concept,but i need the solution of the above requirement,because we have to send the PS file to different server thru Mailbox.They has the system to receive the PS file in the FTP format only, not a GDG file.
So i need a JCL to find the latest generated Flat file.
It should be doable - for a hint, look at the smart DFSORT trick "Copy GDGs created today" which reads in the LISTCAT info and generates dynamic JCL to be submitted via INTRDR
Help me understand. For ur question I think you have a GDG base "'aaaa.bbbb.cccc" and there are diff versions created. You want to send the latest version through FTP ... correct.
Why dont u send "'aaaa.bbbb.cccc(0)". All individual versions of a GDG are PS files. _________________ Arvind
"You can make a difference with your smile. Have that with you always"
Joined: 02 May 2007 Posts: 202 Topics: 0 Location: Viginia, USA
Posted: Fri Jul 02, 2010 7:26 am Post subject:
arvibala wrote:
Shyam,
Help me understand. For ur question I think you have a GDG base "'aaaa.bbbb.cccc" and there are diff versions created. You want to send the latest version through FTP ... correct.
Why dont u send "'aaaa.bbbb.cccc(0)". All individual versions of a GDG are PS files.
Versions and Generations are both terms that apply to GDG's but they have very different meanings!
Joined: 12 May 2010 Posts: 44 Topics: 12 Location: India
Posted: Fri Jul 02, 2010 9:57 am Post subject:
Hi;
Our mailbox is sending the PS files by daily basis,The last qualifier only will increment.So my JCL has to select the highest value of last qualifier dataset.
For eg:
xxx.test.n0001
xxx.test.n0002
xxx.test.n0003
so JCL need to select the xxx.test.n0003 only .
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Fri Jul 02, 2010 10:17 am Post subject:
shyamsaravan,
What do you need to do after you SELECT the latest file? Do you need to copy or process thru another program? It is very to easy to get the latest file. You can simply sort on the 44 bytes ( the max for DS name) and pick only the first record.
Joined: 12 May 2010 Posts: 44 Topics: 12 Location: India
Posted: Tue Jul 06, 2010 9:06 am Post subject:
Thanks,our internal JCL generates the Flat file daily with the incremental of the last qualifier,so i need to get the latest file and has to copy to the another flat file.
So, i cant give the Flat files in the SORTIN card manualy.My JCL needs to pick the latest file(LRECL=88,FB) and copy to the another Flat file as the same record format when run the new JCL.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Tue Jul 06, 2010 10:22 am Post subject:
shyamsaravan wrote:
Thanks,our internal JCL generates the Flat file daily with the incremental of the last qualifier,so i need to get the latest file and has to copy to the another flat file.
So, i cant give the Flat files in the SORTIN card manualy.My JCL needs to pick the latest file(LRECL=88,FB) and copy to the another Flat file as the same record format when run the new JCL.
Thanks for all
shyamsaravan,
I just showed you an example of instream data , you can change it to your file name.
Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
Posted: Wed Jul 07, 2010 2:04 am Post subject:
shyamsaravan wrote:
i have a requirement on how to get latest generated PS file in the PDS.
Can you please explain what a PS in PDS is. Would you perhaps mean MEMBER
Unfortunately, methinks that the OP is treating the symptoms rather than the cause of the problem.
In a well planned and implemented application this scenario should not occur.
Job A creates dataset A1.
Dataset A1 is used as an event trigger to submit FTP / whatever job - using scheduler date variables if required to make the target dataset unique.
Dataset A1 remains until the next run where it is deleted and recreated, and hey presto triggers the FTP / whatever job again.
Absolutely no need for additional processing (aka resource waste) to do what a thought out application should have done in the first place. _________________ If it's true that we are here to help others,
then what exactly are the others here for ?
but my requirement is my jcl need to copy the records of the latest generated Flat file(ie xxx.test.n0004) to another Flat file,because for every generated Flat file has different datas,,i need latest datas to be copied to the another file
From the above list JCL has to copy the all records which are resided at the file
OAZAE34.AS.BOX.N0004(which is latest in the list now).
This file is generated N number of times with the incremental of last qualifier
my JOB HAS ABENED
Code:
STMT NO. MESSAGE
-
4 IEF642I EXCESSIVE PARAMETER LENGTH IN THE DSNAME FIELD
because SORTIN card takes a Last record in the file OAZAE34.AS.BOX.N0001 and treated as a DSN in the next SORTIN.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum