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

New User


Joined: 10 Nov 2015
Posts: 44
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: 2547
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 Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
Search our Forums:

Back to Top