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?
Pick latest file with specific naming and copy to file
-
- Posts: 2
- Joined: Thu Jun 13, 2013 8:34 pm
- Skillset: cobol, jcl, rexx, sas, db2
- Referer: google
- Akatsukami
- Global moderator
- Posts: 1058
- Joined: Sat Oct 16, 2010 2:31 am
- Skillset: Rexx, JCL, DB2/SQL, TSO/ISPF, PL/I
- Referer: ibmmainframes
- Location: Bloomington, IL
- Contact:
Re: Pick latest file with specific naming and copy to file
Yes.
OK, enough Schadenfreude on my part.
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.
OK, enough Schadenfreude on my part.

"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
-
- Posts: 2
- Joined: Thu Jun 13, 2013 8:34 pm
- Skillset: cobol, jcl, rexx, sas, db2
- Referer: google
Re: Pick latest file with specific naming and copy to file
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?
- Akatsukami
- Global moderator
- Posts: 1058
- Joined: Sat Oct 16, 2010 2:31 am
- Skillset: Rexx, JCL, DB2/SQL, TSO/ISPF, PL/I
- Referer: ibmmainframes
- Location: Bloomington, IL
- Contact:
Re: Pick latest file with specific naming and copy to file
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
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: Pick latest file with specific naming and copy to file
Hello and welcome to the forum,
You are aware that the dataset list from 3.4 can be sorted in creation date sequence?
You are aware that the dataset list from 3.4 can be sorted in creation date sequence?
Hope this helps,
d.sch.
d.sch.
-
- Global moderator
- Posts: 2105
- Joined: Thu Jun 03, 2010 6:21 pm
- Skillset: Assembler, JCL, utilities
- Referer: zos.efglobe.com
Re: Pick latest file with specific naming and copy to file
- 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.
- 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.
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: Pick latest file with specific naming and copy to file
Which is available via the "IBM Manuals" link at the top and bottom of the page.This feature is discussed in detail in MVS JCL User's Guide for your z/OS release.
Hope this helps,
d.sch.
d.sch.
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Process file/records until a specific total is reached.
by chillmo » Thu Mar 24, 2022 6:18 am » in Syncsort/Synctool - 12
- 3894
-
by sergeyken
View the latest post
Wed Mar 30, 2022 10:12 pm
-
-
-
EZIOE004 Logical I/O error on file occurred reading VB file
by savitha_y » Mon Feb 15, 2021 7:54 pm » in CA-Easytrieve - 3
- 4965
-
by savitha_y
View the latest post
Wed Feb 17, 2021 5:02 am
-
-
-
File Handling 3 input files and 1 output file by using EZT
by pavan426 » Thu Sep 09, 2021 12:17 am » in CA-Easytrieve - 0
- 4428
-
by pavan426
View the latest post
Thu Sep 09, 2021 12:17 am
-
-
-
Need to check whether file is ESDS file or not by using REXX
by Devrana » Sat Oct 05, 2024 2:28 pm » in CLIST & REXX - 6
- 3224
-
by sergeyken
View the latest post
Tue Oct 08, 2024 5:25 pm
-
-
-
How To display the count based on a specific string?
by Chintu333 » Fri Aug 19, 2022 12:59 am » in DFSORT/ICETOOL/ICEGENER - 3
- 2123
-
by sergeyken
View the latest post
Fri Aug 19, 2022 8:52 pm
-