View previous topic :: View next topic
|
Author |
Message |
Learncoholic
New User
Joined: 20 Sep 2007 Posts: 97 Location: India
|
|
|
|
Hi,
I am trying to fetch all datasets listed under a given Production HLQ. The objective is to classify them as VSAM, PDS, GDG.
To list all datasets, I have written the below REXX routine.
Code: |
/*REXX */
HLQ = <production HLQ>
QUAL=HLQ||'.*'
ADDRESS ISPEXEC
COUNT=0
"LMDINIT DATAID(MYLIST) LEVEL("QUAL")"
DO WHILE RC=0
"LMDLIST LISTID("MYLIST") OPTION(LIST) STATS(ON) DATASET(CURRDS)"
SAY CURRDS
COUNT = COUNT + 1
IF COUNT = 2000 THEN DO
TEMPDS = CURRDS
"LMDFREE LISTID(MYLIST)"
"LMDINIT DATAID(MYLIST) LEVEL("QUAL")"
CURRDS = TEMPDS
COUNT = 0
END
END
"LMDFREE LISTID(MYLIST)" |
I am getting a time Abend error once I execute this in batch.
If I am executing for a batch of 2000 only, then it's executing fine.
Requesting your assistance in resolution.
Thanks |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 743 Location: Denmark
|
|
|
|
Timer abend, then you need to set the TIME job statement, i.e.TIME=NOLIMIT. Though that may not be allowed at your site. If not then try TIME=(1439). |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10891 Location: italy
|
|
|
|
whatever You are doing the loop is just wrong
Code: |
"LMDINIT DATAID(MYLIST) LEVEL("QUAL")"
DO WHILE RC=0
"LMDLIST LISTID("MYLIST") OPTION(LIST) STATS(ON) DATASET(CURRDS)"
SAY CURRDS |
should look more like this
Code: |
"LMDINIT DATAID(MYLIST) LEVEL("QUAL")"
if ( RC <> 0 ) then do
... process the error
end
do forever
"LMDLIST LISTID("MYLIST") OPTION(LIST) STATS(ON) DATASET(CURRDS)"
if ( RC <> 0 ) then do
... assuming end of list
leave
... or PROCESS THE ERROR
end
...
...
...
end
|
|
|
Back to top |
|
|
Learncoholic
New User
Joined: 20 Sep 2007 Posts: 97 Location: India
|
|
|
|
Thanks for your response Wlly & Enrico.
I have changed the Loop as:
Code: |
DO FOREVER
"LMDLIST LISTID("MYLIST") OPTION(LOST) STATS(YES) DATASET(CURRDS)"
IF RC <> 0 THEN DO
SAY 'UNSUCCESSFUL LISTING. HENCE EXIT"
LEAVE
END
.
.
<rest of codes>
END |
This didn't alter the result. Also, I don't think adding time would make a difference because the Rexx is processing just about 2000 records & then calls the Fault Analyzer without any notification of error. Then it abends with S322.
Thanks |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1350 Location: Bamberg, Germany
|
|
|
|
Add
Code: |
//IDIOFF DD DUMMY Turn off Fault Anal. |
to your JCL to avoid the Fault Analyzer. Also add what Willy has suggested.
Next, provide Msgs so we can have a closer look at it. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 743 Location: Denmark
|
|
|
|
Your syntax for both LMDINIT and LMDLIST are wrong.
This one works:
Code: |
HLQ ='whatever'
QUAL=HLQ||'.**'
ADDRESS ISPEXEC
COUNT=0
currds='' /* maybe not need, but just in case */
"LMDINIT LISTID(MYLIST) LEVEL("QUAL")"
if rc<>0 then exit xmsg('LmdInit rc' rc zerrlm)
DO forever
"LMDLIST LISTID("MYLIST") OPTION(LIST) STATS(YES) DATASET(CURRDS)"
if rc >8 then do
say 'LmdList rc' rc zerrlm
leave
end
if rc<>0 then leave
SAY left(currds,44) left(zdlvol,6) zdldsorg
END
"LMDFREE LISTID(MYLIST)"
exit xmsg('Done..')
XMsg: if arg(1)<>'' then say arg(1);return word(arg(2) 0,1) |
Besides you are right regarding TIME, I should have looked at the underlying problem instead of just the symptom. |
|
Back to top |
|
|
hankoerlemans
New User
Joined: 25 Jan 2018 Posts: 64 Location: Australia
|
|
|
|
Are you sure parsing DCOLLECT output wouldn't be quicker/easier ? |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1350 Location: Bamberg, Germany
|
|
|
|
hankoerlemans wrote: |
Are you sure parsing DCOLLECT output wouldn't be quicker/easier ? |
You would greatly skip the possibility of using wildcards for the qualifier. |
|
Back to top |
|
|
hankoerlemans
New User
Joined: 25 Jan 2018 Posts: 64 Location: Australia
|
|
|
|
Didnt see the FA reference :-(
Shouldn't be called for S322.
Free of charge sample for your sysprogs :
Code: |
EXCLUDE(ABEND(S058,S0F3,S13E, /* Exclude standard */
S222,S322,S33E, /* SLIP ACTION=NODUMP abends */
S422,S47B,S622,
S71A,S91A,SC1A))
|
You can always override if need a dump for an unexpected loop. |
|
Back to top |
|
|
Learncoholic
New User
Joined: 20 Sep 2007 Posts: 97 Location: India
|
|
|
|
Thanks all for your response.
As suggested by Joerg, I have updated JCL to avoid Fault Analyzer & modified the Rexx as suggested by Willy.
The result still threw a Time Abend with no error message from Fault analyzer. The only error message thrown is below:
Code: |
IEA848I NO DUMP WAS PRODUCED FOR THIS ABEND, DUE TO SYSTEM OR INSTALLATION REQUEST
IEF450I E0015CHD JS0010 - ABEND=S322 U0000 REASON=00000000 973 |
Hence, LMDLIST is indeed taking a lot of time to list the Dataset names.
Thanks for all your help. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10891 Location: italy
|
|
|
|
the dfsort docs have samples on how to process dcollect data
abd CBTTAPE file 206 has some rexx samples
for people who want to look at the expanded content of cbttape
github.com/mainframed/CBTTAPE
2 months old but more than enough to have an idea |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1350 Location: Bamberg, Germany
|
|
|
|
If the request is for online Datasets only, consider using the VTOC command from the CBT collection. It's pretty easy to use:
Code: |
TSO VTOC <vol> PR(N (DSN DSO)) NOH |
|
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 743 Location: Denmark
|
|
|
|
If you do the same in ISPF 3.4, how many datasets do you see?
How many lines did the job produce?
How much time did your job consume? |
|
Back to top |
|
|
Learncoholic
New User
Joined: 20 Sep 2007 Posts: 97 Location: India
|
|
|
|
Hi Willy,
ISPF 3.4 listed 1966910 records.
When I executed the REXX with TIME=5, it listed 899 records
When I executed the REXX with TIME=15, it listed 3099 records
When I executed the REXX with TIME=10, it listed 2002 records
Thanks |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 743 Location: Denmark
|
|
|
|
At least the process is working, though it is more resource heavy than I would have expected.
I assume that the datasets listed are different, not the same (group) repeated?
Please try once with TIME=NOLIMIT, keeping an eye on the job as it runs. You might run into JES output limit if you write to sysprint (spool).
I was considering IGGCSIRX as an alternative, but it cannot differentiate between PDS and sequential datasets. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 743 Location: Denmark
|
|
|
|
If this is something you have to do on a regular basis and the disks have similar volser, then I would suggest trying the VTOC program from cbttape.org file 112. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 743 Location: Denmark
|
|
|
|
Actually, I will strongly recommend a VTOC-centric solution, like CBT file 112, DCOLLECT or even IEHLIST. Using ISPF library services causes an allocate of each and every dataset, which could explain why it uses time. |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 767 Location: Whitby, ON, Canada
|
|
|
|
The catalog search interface is another option. IBM provides a sample program written in Rexx. IGGCSIRX, if I recall correctly. I use it when performance is critical. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 743 Location: Denmark
|
|
|
|
I don't think you can determine PDS from the catalog. You can differentiate between GDS, GDG, VSAM and NONVSAM, so if they don't have any sequential datasets then I guess you could say nonvsam=pds.
If so then Catalog Search Interface is certainly fast. |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 767 Location: Whitby, ON, Canada
|
|
|
|
Willy Jensen wrote: |
I don't think you can determine PDS from the catalog. You can differentiate between GDS, GDG, VSAM and NONVSAM, so if they don't have any sequential datasets then I guess you could say nonvsam=pds.
If so then Catalog Search Interface is certainly fast. |
Good point about the DSORG not necessarily being in the catalog. Another caution is that a migrated VSAM file can show as NONVSAM in a catalog listing. In cases like that I have used the HLIST command to make that determination without having to recall the data set. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1350 Location: Bamberg, Germany
|
|
|
|
don.leahy wrote: |
In cases like that I have used the HLIST command to make that determination without having to recall the data set. |
All DFSMShsm user commands check every time against RACF AFAIK, I would suggest using the HSEND command instead. |
|
Back to top |
|
|
|