Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Picking up the latest PS file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
pema_yozer

New User


Joined: 16 Feb 2009
Posts: 49
Location: pune

PostPosted: Thu Oct 11, 2018 12:26 pm    Post subject: Picking up the latest PS file
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: 1035
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Oct 11, 2018 2:10 pm    Post subject:
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: 682
Location: The Universe

PostPosted: Thu Oct 11, 2018 7:36 pm    Post subject: Re: Picking up the latest PS file
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

Moderator


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

PostPosted: Fri Oct 12, 2018 1:36 am    Post subject:
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: 282
Location: Cincinnati OH USA

PostPosted: Fri Oct 12, 2018 1:59 am    Post subject:
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: 682
Location: The Universe

PostPosted: Fri Oct 12, 2018 5:05 am    Post subject:
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: 682
Location: The Universe

PostPosted: Fri Oct 12, 2018 6:15 am    Post subject:
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: 49
Location: pune

PostPosted: Tue Oct 16, 2018 1:29 pm    Post subject: Re: Picking up the latest PS file
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 User


Joined: 01 Sep 2015
Posts: 251
Location: Denmark

PostPosted: Tue Oct 16, 2018 1:59 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Transferring file to Mainframes Shinoj Vijayakumar IBM Tools 3 Thu Dec 06, 2018 2:35 pm
No new posts Convert VBA file to FB! Vignesh Sid SYNCSORT 5 Mon Dec 03, 2018 1:27 pm
No new posts Another 39 File Status on VB file socker_dad COBOL Programming 5 Tue Nov 27, 2018 6:11 am
No new posts How to handle different file length b... javen777 DFSORT/ICETOOL 15 Mon Nov 26, 2018 12:13 pm
No new posts COBOL file declaration jithinraghavan COBOL Programming 2 Fri Nov 16, 2018 10:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us