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
Warnings : 1

New User

Joined: 10 Nov 2015
Posts: 42
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.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.

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

Global Moderator

Joined: 01 Sep 2006
Posts: 2459
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
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:
"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:

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 Rexx log capturing CLIST & REXX 11
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts first column truncated in search result IBM Tools 13
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Rexx formatting CLIST & REXX 2
Search our Forums:

Back to Top