Page 1 of 1

getting files info using REXX & ISPF

PostPosted: Thu Mar 12, 2015 10:33 pm
by migusd
Hi guys,
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   

Re: getting files info using REXX & ISPF

PostPosted: Thu Mar 12, 2015 11:45 pm
by migusd
My questions are more about ISPF than REXX.
So, will break it up and post it in TSO & ISPF

Thanks

Re: getting files info using REXX & ISPF

PostPosted: Fri Mar 13, 2015 6:21 pm
by vern
Just dealing with the first point here .... LMDLIST doesn't return stats for the cluster. Maybe you need to call it again to get the data component (or change your dsn mask)

Re: getting files info using REXX & ISPF

PostPosted: Tue Mar 17, 2015 1:57 am
by migusd
Thanks Vern,
I did and made no difference
I couldn't make it work. so I moved away from ISPEXEC...

now trying with IGGCSI00. Got much better results with it. At least I am able to loop thru all the files.
Now looking to get additional details for some files.

Would be nice to have to have it as well with ISPEXEC, though.

Thanks.