On Wed, 20 Jan 2010 12:48:11 -0600, Rick Fochtman <[email protected]> wrote:
>---------------------------------<snip>-------------------------
>
>>
>>I don't know about that program, but this REXX program doesn't work
>>with PDSE (013-EC abend):
>>
>>ARG dsn
>>"ALLOC F(PDSDIR) DA("dsn") SHR REUSE RECFM(F)", /* pds directory */
>> "DSORG(PS) LRECL(256) BLKSIZE(256)"
>>"EXECIO 1 DISKRU PDSDIR (STEM DIR." /* read pds directory */
>> /* for update */
>>DIR.1 = '000EFFFFFFFFFFFFFFFF'x /* End of Directory */
>>"EXECIO 1 DISKW PDSDIR (STEM DIR. FINIS" /* Rewrite Directory */
>>"FREE F(PDSDIR)"
>>Exit
>>
>-------------------------------<unsnip>--------------------------------
>Mark, did you forget about the keys on the directory blocks ??
>
>Rick
>
It isn't needed (for a PDS... the problem is with PDSE):
>From "DFSMS Using Data Sets":
3.7.9 Reading a PDS Directory Sequentially
You can read a PDS directory sequentially just by opening the data set to
its beginning (without using positioning macros) and reading it.
The DD statement must identify the DSNAME without a member name.
You can use either BSAM or QSAM with MACRF=R or G.
Specify BLKSIZE=256 and RECFM=F or RECFM=U.
QSAM always requires LRECL=256
You should test for the last directory entry (8 bytes of X'FF'). Records
and blocks after that point are unpredictable. After reading the last
allocated directory block, control passes to your EODAD routine or
reading continues with a concatenated data set. You can issue an FEOV
macro to cease reading the current data set and continue with the next
one. If you issue FEOV while reading the last or only data set, control
passes to your EODAD routine.
If you also want to read the keys (the name of the last member in that
block), use BSAM and specify KEYLEN=8.
This technique works when PDSs and PDSEs are concatenated. However, you
cannot use this technique to sequentially read a UNIX directory.
The system considers this to be a like sequential concatenation. See
"Reading a PDSE Directory" in topic 3.8.11.
--
Mark Zelden
Sr. Software and Systems Architect - z/OS Team Lead
Zurich North America / Farmers Insurance Group - ZFUS G-ITO
mailto:[email protected]
z/OS Systems Programming expert at http://expertanswercenter.techtarget.com/
Mark's MVS Utilities: http://home.flash.net/~mzelden/mvsutil.html
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html