I am trying to find info about several files using wildcards.
first if there is any files under the name, and then if found get info about creation /last reference date, etc.
But the list I got to inquire upon is diverse, contains VSAM, SEQUENTIAL, GDG's etc.
and sometimes only exists the GDG base but no generations.
So, I am trying to run ISPEXEC within REXX but I am having issues.
In the code below, the first iteration is for a VSAM file and seems to be found. except for the dataset info.
for the second iteration the files are sequential, but got a RC=10 on LMDLIST. and I know there are files with that name.
The third iteration is a GDG that contains only the base, so I am assumming a rc=10 is when couldn't find any generations.
In all three examples below the search contains some wildcards. I only care about the info in the first file found.
I understand reading the manuals in advance would help me a lot, but need some guidance to resolve it... quicker...
so regarding the first iteration, how can I find the file info?
for the second iteratiion, why I am getting a rc=10. I know there are files with the name?
for the third iteration, is it correct to receive rc=10 for gdg base only?
Thank you in advance
Miguel
------------------ first iteration for a VSAM file ---------------------------
61 *-* ADDRESS ISPEXEC
62 *-* "LMDINIT LISTID("LISTID") LEVEL("DSNSET")"
>>> "LMDINIT LISTID(LISTID) LEVEL(URLX.*.%VSAM.LLU)"
63 *-* IF RC = 0
>>> "1"
64 *-* "LMDLIST LISTID("LISTID") DATASET(DSVAR) OPTION(LIST) STATS(YES)"
>>> "LMDLIST LISTID(ISR00001) DATASET(DSVAR) OPTION(LIST) STATS(YES)"
65 *-* IF RC = 0
>>> "1"
*-* DO
66 *-* SAY 'FOUND FILE ' DSVAR ZDLCDATE
>>> "FOUND FILE URLX.A01.MVSAM.VRA "
FOUND FILE URLX.A01.MVSAM.VRA
67 *-* RESULT = 'FOUND'
>>> "FOUND"
68 *-* CDATE = ZDLCDATE
>>> " "
69 *-* END
78 *-* DECISION = RESULT
>>> "FOUND"
79 *-* SAY 'RESULT ' RESULT
>>> "RESULT FOUND"
RESULT FOUND
80 *-* TRACE O
------------------ second iteration for a sequential file ---------------------------
AUD REC 1008 PERFORM #QAN00000 TTUL URLX.*.RACFILE
61 *-* ADDRESS ISPEXEC
62 *-* "LMDINIT LISTID("LISTID") LEVEL("DSNSET")"
>>> "LMDINIT LISTID(ISR00001) LEVEL(URLX.*.RACFILE)"
63 *-* IF RC = 0
>>> "1"
64 *-* "LMDLIST LISTID("LISTID") DATASET(DSVAR) OPTION(LIST) STATS(YES)"
>>> "LMDLIST LISTID(ISR00001) DATASET(DSVAR) OPTION(LIST) STATS(YES)"
+++ RC(10) +++
65 *-* IF RC = 0
>>> "0"
71 *-* IF RC = 10
>>> "1"
*-* RESULT = 'BASEGDG'
>>> "BASEGDG"
78 *-* DECISION = RESULT
>>> "BASEGDG"
79 *-* SAY 'RESULT ' RESULT
>>> "RESULT BASEGDG"
RESULT BASEGDG
80 *-* TRACE O
------------------ third iteration for a Base GDG without generations ---------------
AUD REC 1213 PERFORM AACCPROF TTUL URLX.*.SMF20.**
61 *-* ADDRESS ISPEXEC
62 *-* "LMDINIT LISTID("LISTID") LEVEL("DSNSET")"
>>> "LMDINIT LISTID(ISR00001) LEVEL(URLX.*.SMF20.**)"
63 *-* IF RC = 0
>>> "1"
64 *-* "LMDLIST LISTID("LISTID") DATASET(DSVAR) OPTION(LIST) STATS(YES)"
>>> "LMDLIST LISTID(ISR00001) DATASET(DSVAR) OPTION(LIST) STATS(YES)"
+++ RC(10) +++
65 *-* IF RC = 0
>>> "0"
71 *-* IF RC = 10
>>> "1"
*-* RESULT = 'BASEGDG'
>>> "BASEGDG"
78 *-* DECISION = RESULT
>>> "BASEGDG"
79 *-* SAY 'RESULT ' RESULT
>>> "RESULT BASEGDG"
RESULT BASEGDG
80 *-* TRACE O
61 *-* ADDRESS ISPEXEC
62 *-* "LMDINIT LISTID("LISTID") LEVEL("DSNSET")"
>>> "LMDINIT LISTID(LISTID) LEVEL(URLX.*.%VSAM.LLU)"
63 *-* IF RC = 0
>>> "1"
64 *-* "LMDLIST LISTID("LISTID") DATASET(DSVAR) OPTION(LIST) STATS(YES)"
>>> "LMDLIST LISTID(ISR00001) DATASET(DSVAR) OPTION(LIST) STATS(YES)"
65 *-* IF RC = 0
>>> "1"
*-* DO
66 *-* SAY 'FOUND FILE ' DSVAR ZDLCDATE
>>> "FOUND FILE URLX.A01.MVSAM.VRA "
FOUND FILE URLX.A01.MVSAM.VRA
67 *-* RESULT = 'FOUND'
>>> "FOUND"
68 *-* CDATE = ZDLCDATE
>>> " "
69 *-* END
78 *-* DECISION = RESULT
>>> "FOUND"
79 *-* SAY 'RESULT ' RESULT
>>> "RESULT FOUND"
RESULT FOUND
80 *-* TRACE O
------------------ second iteration for a sequential file ---------------------------
AUD REC 1008 PERFORM #QAN00000 TTUL URLX.*.RACFILE
61 *-* ADDRESS ISPEXEC
62 *-* "LMDINIT LISTID("LISTID") LEVEL("DSNSET")"
>>> "LMDINIT LISTID(ISR00001) LEVEL(URLX.*.RACFILE)"
63 *-* IF RC = 0
>>> "1"
64 *-* "LMDLIST LISTID("LISTID") DATASET(DSVAR) OPTION(LIST) STATS(YES)"
>>> "LMDLIST LISTID(ISR00001) DATASET(DSVAR) OPTION(LIST) STATS(YES)"
+++ RC(10) +++
65 *-* IF RC = 0
>>> "0"
71 *-* IF RC = 10
>>> "1"
*-* RESULT = 'BASEGDG'
>>> "BASEGDG"
78 *-* DECISION = RESULT
>>> "BASEGDG"
79 *-* SAY 'RESULT ' RESULT
>>> "RESULT BASEGDG"
RESULT BASEGDG
80 *-* TRACE O
------------------ third iteration for a Base GDG without generations ---------------
AUD REC 1213 PERFORM AACCPROF TTUL URLX.*.SMF20.**
61 *-* ADDRESS ISPEXEC
62 *-* "LMDINIT LISTID("LISTID") LEVEL("DSNSET")"
>>> "LMDINIT LISTID(ISR00001) LEVEL(URLX.*.SMF20.**)"
63 *-* IF RC = 0
>>> "1"
64 *-* "LMDLIST LISTID("LISTID") DATASET(DSVAR) OPTION(LIST) STATS(YES)"
>>> "LMDLIST LISTID(ISR00001) DATASET(DSVAR) OPTION(LIST) STATS(YES)"
+++ RC(10) +++
65 *-* IF RC = 0
>>> "0"
71 *-* IF RC = 10
>>> "1"
*-* RESULT = 'BASEGDG'
>>> "BASEGDG"
78 *-* DECISION = RESULT
>>> "BASEGDG"
79 *-* SAY 'RESULT ' RESULT
>>> "RESULT BASEGDG"
RESULT BASEGDG
80 *-* TRACE O