View previous topic :: View next topic
|
Author |
Message |
elixir1986
New User
Joined: 10 Nov 2015 Posts: 45 Location: USA
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
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 |
|
|
|