Pick latest file with specific naming and copy to file



Ask queries about other IBM Tools like Tivoli, COBTEST, Fault Analyzer, z/OS File Manager, Workload Simulator, APA, SCLM, Merge & Migration Tools etc...

Pick latest file with specific naming and copy to file

Postby jayeshbalan » Thu Jun 13, 2013 8:48 pm

Hi,

I am a new mf user. I need to get a way to find the file with latest created date file in the naming F6412DI.INSURE.*.DATA.TODAY where * is an arbitrary value. We need to first identify the latest created date file from the list dislpayed in 3.4 with names as F6412DI.INSURE.*.DATA.TODAY and copy it to another file. We need to entire thing in batch. Is there any way to do it?
jayeshbalan
 
Posts: 2
Joined: Thu Jun 13, 2013 8:34 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Pick latest file with specific naming and copy to file

Postby Akatsukami » Thu Jun 13, 2013 9:02 pm

Yes.






OK, enough Schadenfreude on my part. :twisted: The list of data sets can be gotten in various ways; I'd use LISTCAT. The creation date can be retrieved with the LISTDSI function. The copy can be done in various ways; again, my choice would be the SMCOPY command. The whole kit and kaboodle can be done as a Rexx script in background TSO.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Pick latest file with specific naming and copy to file

Postby jayeshbalan » Thu Jun 13, 2013 11:04 pm

Are there any readily available rexx codes in SYS1.SAMPLIB say like 'SYS1.SAMPLIB(IGGCSIRX)' which would list dsn with volumes, instead we would require dsn with creation date. Would you have any sample code in rexx to do the operation?
jayeshbalan
 
Posts: 2
Joined: Thu Jun 13, 2013 8:34 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Pick latest file with specific naming and copy to file

Postby Akatsukami » Thu Jun 13, 2013 11:19 pm

jayeshbalan wrote:Are there any readily available rexx codes in SYS1.SAMPLIB say like 'SYS1.SAMPLIB(IGGCSIRX)' which would list dsn with volumes, instead we would require dsn with creation date.

I don't know of any, although one of the other senpai on this board may.
Would you have any sample code in rexx to do the operation?

I am sure that it is accidental that you seem to be asking me to provide you with free code. In any case, I am certain that someone with a skill set such as yours can take the hints in my previous post and produce a working script in a few days at most.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Pick latest file with specific naming and copy to file

Postby dick scherrer » Fri Jun 14, 2013 12:19 am

Hello and welcome to the forum,

You are aware that the dataset list from 3.4 can be sorted in creation date sequence?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Pick latest file with specific naming and copy to file

Postby steve-myers » Fri Jun 14, 2013 3:15 am

  1. I hope the topic starter is aware that data sets in z/OS do not have the time of day they are created as a data set attribute. How is your program going to distinguish between two data sets with a common creation date? At least in theory data set creation time can be retrieved from SMF data, but this is very complex and extremely time consuming.
  2. Data sets in a Generation Data Group provide a roughly equivalent capability, though the data set name standard is different than the topic starter proposes. When data sets are specified in a Generation Data Group, the most recently created data set can be selected in JCL; there is no need for a complex program to retrieve data set attributes. This feature is discussed in detail in MVS JCL User's Guide for your z/OS release.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Pick latest file with specific naming and copy to file

Postby dick scherrer » Fri Jun 14, 2013 3:30 am

This feature is discussed in detail in MVS JCL User's Guide for your z/OS release.
Which is available via the "IBM Manuals" link at the top and bottom of the page.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to Other IBM Tools

 


  • Related topics
    Replies
    Views
    Last post