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

Picking up the latest PS file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pema_yozer

New User


Joined: 16 Feb 2009
Posts: 54
Location: pune

PostPosted: Thu Oct 11, 2018 12:26 pm
Reply with quote

Hi Everyone,
I have a requirement where I need to pick the latest log file for one of our processing,
the log file start with the same name ending with a timestamp, is there are way for me to do a pattern search and pick only the latest file name .

below are the list of file
vpw.log.D1009.T0408
vpw.log.D1010.T0410
vpw.log.D1010.T0531
vpw.log.D1011.T0408


I would only want an output file which contains the name of the latest file
vpw.log.D1011.T0408

Cleaned up posts

Pandora-Box:Locked topic
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu Oct 11, 2018 2:10 pm
Reply with quote

You could pass the list of datasets through SORT (descending) and then pick the first.

Garry
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Thu Oct 11, 2018 7:36 pm
Reply with quote

pema_yozer wrote:
Hi Everyone,
I have a requirement where I need to pick the latest log file for one of our processing,
the log file start with the same name ending with a timestamp, is there are way for me to do a patter search and pick only the latest file name .

below are the list of file
vpw.log.D1009.T0408
vpw.log.D1010.T0410
vpw.log.D1010.T0531
vpw.log.D1011.T0408


I would only want an output file which contains the name of the latest file
vpw.log.D1011.T0408
Five observations.
  • What is a "patter search?"
  • Output file? I think the topic starter means input file.
  • It appears whoever designed this data set name standard only knows about Windoze or similar systems. Generation data groups, a standard feature in OS/360 and every system descended from OS/360 at least 20 years before Windoze appeared, would greatly simplify this problem and permit a JCL only solution without resorting to a "patter search."
  • For at least the millionth time, the only "files" in OS/360 and its descendants are data groupings on magnetic tape between the beginning of the tape and a "file mark," or between two "file marks."
  • Whoever designed these file names appears to be ignorant about Y2K issues, or simply doesn't care. If I was this person's boss I'd fire him forthwith. I grant its going to be 80 odd years before this is going to be a problem, and I'm certainly going to feeding worms long before then, but lazy fools like that is why we had the Y2K problem 20 years ago.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Fri Oct 12, 2018 1:36 am
Reply with quote

Why are we not taking help of GDG rather complicating it ?? icon_question.gif icon_question.gif icon_question.gif
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 418
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Fri Oct 12, 2018 1:59 am
Reply with quote

The Y2K point is valid relative to the naming convention if not changing to GDG.

If this is a one off task for the example, sort solutions are fine.

Otherwise, D0101.Thhmm is going to require a true, complete creation date or the 'sliding window' approach.

pema_yozer, please describe your task in greater detail based on above discussion. You will find the contributors here have many solutions when they get the overall picture.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Fri Oct 12, 2018 5:05 am
Reply with quote

dneufarth wrote:
The Y2K point is valid relative to the naming convention if not changing to GDG. ...

Otherwise, D0101.Thhmm is going to require a true, complete creation date or the 'sliding window' approach. ...
Actually since the data set name seems to lack a year in any form, perhaps we should say a sliding month approach so this fool scheme will work properly in January!
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Fri Oct 12, 2018 6:15 am
Reply with quote

Pandora-Box wrote:
Why are we not taking help of GDG rather complicating it ?? icon_question.gif icon_question.gif icon_question.gif
Pandora is correct.

Unfortunately, there is some evidence this data is reaching the real computer from a toy or baby computer. We have no knowledge about the qualifications of the topic starter, and only indirect knowledge of the qualifications of the fool that devised this scheme.

Unfortunately, since we are not in the business here of writing tutorials, the best we can do is direct them to the beginners forum at ibmmainframeforum dot com
Back to top
View user's profile Send private message
pema_yozer

New User


Joined: 16 Feb 2009
Posts: 54
Location: pune

PostPosted: Tue Oct 16, 2018 1:29 pm
Reply with quote

steve-myers wrote:
pema_yozer wrote:
Hi Everyone,
I have a requirement where I need to pick the latest log file for one of our processing,
the log file start with the same name ending with a timestamp, is there are way for me to do a patter search and pick only the latest file name .

below are the list of file
vpw.log.D1009.T0408
vpw.log.D1010.T0410
vpw.log.D1010.T0531
vpw.log.D1011.T0408


I would only want an output file which contains the name of the latest file
vpw.log.D1011.T0408
Five observations.
  • What is a "patter search?"
  • Output file? I think the topic starter means input file.
  • It appears whoever designed this data set name standard only knows about Windoze or similar systems. Generation data groups, a standard feature in OS/360 and every system descended from OS/360 at least 20 years before Windoze appeared, would greatly simplify this problem and permit a JCL only solution without resorting to a "patter search."
  • For at least the millionth time, the only "files" in OS/360 and its descendants are data groupings on magnetic tape between the beginning of the tape and a "file mark," or between two "file marks."
  • Whoever designed these file names appears to be ignorant about Y2K issues, or simply doesn't care. If I was this person's boss I'd fire him forthwith. I grant its going to be 80 odd years before this is going to be a problem, and I'm certainly going to feeding worms long before then, but lazy fools like that is why we had the Y2K problem 20 years ago.






- pattern search, hope that calms your murderous rant,
- nope output file
- no idea who designed this system but it has been there since long before
Y2K
- No GDG since its a very old legacy system and we just want to add
reconciliation into it.


These are basically job log files, we want to pick certain details from the log and use it for recon purposes, and we need to select the latest file.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Tue Oct 16, 2018 1:59 pm
Reply with quote

You need a program to pick the datasetname and copy the data, something like the following REXX. Note that the program assumes that 'VPW.LOG' is unique to those logfiles. If not then you must scan the lst. stem for the proper datasetname.
Code:
 /* REXX */                                 
 zz=outtrap('lst.')                         
 "listc lvl('vpw.log')"                 
 zz=outtrap('off')                         
 n=lst.0 -1                                 
 dsn=word(lst.n,3)                         
 say '->' dsn                               
 cc=bpxwdyn('alloc dd(in) da('dsn') shr')   
 "repro infile(in) outfile(out)"


Run it like so, substituting the REXX name, DCB etc with your own values:
Code:
//GO       EXEC PGM=IKJEFT1B,PARM='%VPWLOGCP'   
//SYSEXEC  DD DISP=SHR,DSN=your.exec.lib       
//SYSTSPRT DD SYSOUT=*                         
//SYSTSIN  DD DUMMY                             
//OUT      DD UNIT=SYSDA,DISP=(,PASS),DSN=&&D1,
//            RECFM=FB,LRECL=100,BLKSIZE=0,     
//            SPACE=(CYL,(1,25),RLSE) 
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic 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