I have an input file whose LRECL is 44 and RECFM is 80.
This input file contains Thousads of dataset names, for all the datasets, I am required to get the SYSREFDATE using LISTDSI function. Since the I/P contains huge volume of records, I decided to write an user Exit routine in REXX.
The resultant Output dataset would contain the following information
Dataset name (44 Bytes) and SYSREFDATE (yyyy/ddd => 8 bytes) totally 52 bytes long fixed block file.
I have written the following SORT utility for this:-
ADDRESS "SYNCREXX" "GIVE"
IF LENGTH(SYRECORD) <> 0 THEN
SYACTION = "REPLACE"
FILE_NAME = SUBSTR(SYRECORD,1,44)
FILE_NAME = STRIP(FILE_NAME)
X = LISTDSI("'"FILE_NAME"'")
IF X = 0 THEN
REF_DATE = SYSREFDATE
SYRECORD = SYRECORD || REF_DATE
ELSE SYACTION = "CLOSE"
ADDRESS "SYNCREXX" "TAKE"
while executing this code I am getting the following error in SYSTSPRT.
10 +++ X = LISTDSI("'"FILE_NAME"'")
IRX0043I Error running MGMTCLAS, line 10: Routine not found
Joined: 14 Mar 2007 Posts: 8657 Location: Back in jolly old England
EOF = 0
"EXECIO 0 DISKR DCO (OPEN)"
DO FOREVER UNTIL(EOF)
"EXECIO 25000 DISKR DCO (STEM DCOI."
IF RC <> 0 THEN EOF = 1
DO A = 1 TO DCOI.0
*** PUT PROCESSING CODE HERE ***
"EXECIO 0 DISKR DCO (CLOSE)"
There should be absolutely no need to do this. Any dataset not used for a specified number of days should automatically be migrated. I think that your management should bring some storage people with half a brain into your site, and quite quickly too.