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

Rexx pattern matching on PS qualifer and then search


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
elixir1986

New User


Joined: 10 Nov 2015
Posts: 45
Location: USA

PostPosted: Fri Feb 17, 2023 7:13 pm
Reply with quote

Hi Team -

I'm trying to,

1) Find if a PS/file file close to the range of my time exists.
Example requirement is to find a file created around 2:30 PM on 01/19.

files available
HLQ.SLQ.TLQ.x230119.T063000.ABC
HLQ.SLQ.TLQ.x230119.T104000.ABC
HLQ.SLQ.TLQ.x230119.T142200.ABC --> This file must be selected as the 5th qualifier indicates the file was created at 14:22 which is close to 2:30 PM. Range would be check 10 minutes before and after the 2:30 PM mark.
HLQ.SLQ.TLQ.x230119.T195430.ABC

2) Using the file HLQ.SLQ.TLQ.x230119.T142200.ABC search for an unique ID and write if the unique ID value exists.
Notify on screen OR via email the file name and whether unique ID exists OR not.

3) If the Unique ID exists in HLQ.SLQ.TLQ.x230119.T142200.ABC, search a GDG that stores reports containing 5 columns of additional detail.
The report will contain the system run time close to 2:30 PM.
Email out the Unique ID with data for 5 columns for it.

Any constructive design/approach(not suitable for REXX and can be done using COBOL/SORT say) suggestions OR follow-up questions are much appreciated.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2593
Location: Silicon Valley

PostPosted: Sat Feb 18, 2023 4:53 am
Reply with quote

1) You have two pieces of information: date and time.

a. You need to convert the date with the DATE() function. Something like
Code:
mydate = DATE('S', '23/01/19','E')


b. Convert the search time to the same format as data set name. And also set a BEGINTIME and ENDTIME variables based on your 10 minute interval.

c. Use OUTTRAP to capture the results of a LISTCAT command. Use the * to get any names that match the same date:
Code:
"LISTCAT ENT('HLQ.SLQ.TLQ.x" || mydate ||".*'")"


d. Search the output from LISTCAT to see if any data set names match the interval. Parse out the time portion of the data set name.

c. A simple compare should work:
Code:
 If (BEGINTIME < DSNTIME) & (DSNTIME < ENDTIME) Then 



Note: you will need special processing to handle time intervals around midnight.
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Does anyone know rexx for VSE CLIST & REXX 3
No new posts TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
No new posts JCL sort to compare dates in two file... DFSORT/ICETOOL 2
No new posts REXX/CMS How to place command console... CLIST & REXX 4
No new posts Help needed in automation cics transa... CLIST & REXX 1
Search our Forums:

Back to Top