(sorry... I hit send to quick on the last one):

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.

========================================

Here is the PDSE doc in 3.8.11 (note that "update" can't be used, which
is what the rexx program does with the first EXECIO DISKRU):



3.8.11 Reading a PDSE Directory
 
You can read a PDSE directory sequentially just by opening the data set
(without using positioning macros) and reading it. The PDSE directory 
cannot be updated. The following rules and guidelines apply to reading a
PDSE directory:
 
   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.
 
   If you also want to read the keys (the name of the last member in that
block), use BSAM and specify KEYLEN=8.
 
   After reading the last PDSE directory entry, you read the next
directory, or control passes to your EODAD routine. The last directory entry is 
    indicated with a dummy name of eight bytes of X'FF'.
 
   Alias entries with names longer than eight bytes are omitted. To read
them, use DESERV.
 
 
 
You can use sequentially read the directories of a concatenation of PDSs and
PDSEs. However, you cannot sequentially read a UNIX directory. 
This is considered to be a like sequential concatenation. To proceed to each
successive data set, you can rely on the system's EOV function or 
you can issue the FEOV macro.


Regards,

Mark
--
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

Reply via email to