Not sure if Sean received my off-list REXX code. Here it is. No need for
IEBPTPCH, just run against the PDS and it builds a sequential file with ./
headers.

/*                                                          */
/*  A REXX routine to convert PDS to sequential datasets    */
/*                                                          */
/*  JCL                                                     */
/*  //........ JOB ...................                      */
/*  //STEP00     EXEC PGM=IEBUPDTE,PARM=NEW                 */
/*  //SYSPRINT   DD   SYSOUT=*                              */
/*  //SYSIN      DD   DISP=SHR,DSN=userid."SEQFILE".expds   */
/*  //SYSUT2     DD   DISP=SHR,DSN=your.output.pds          */
/*  REXX                                                    */
/* -------------------- REXX ** ------------------- */
/* Syntax for expds:                                */
/*    %pdstoseq hlq.pdsname off                     */
/* ------------------------------------------------ */
  ARG libparm ver
  IF ver = ON THEN
      TRACE ALL
  user = USERID()
  SAY 'Enter DSN qualifier '
  PULL seqfile
  temp_grc = "00"
  tot_mem  = 0
  CALL read_dir
  CALL all_utl
  DO I = 7  TO libmem.0
       MEMBER = STRIP(libmem.I)
       CALL copy_mem
  END

  CALL end_expds
/* ------------------------ */

all_utl:

  "LISTDS '"user"."SEQFILE".EXPDS'"
       IF RC = 0  THEN DO
                " DEL '"user"."SEQFILE".EXPDS'"
                      END

  " ALLOC FI(OUT) DA('"user"."SEQFILE".EXPDS') MOD CATALOG",
  " RECFM (F B) DSORG(PS) SP(10 10) CYL  ",
  " LRECL(80) BLKSIZE(8000) UNIT(3390) "
       IF RC > 0 THEN
         DO
           temp_rc   =  RC
           temp_ftc  =  "ALLOC  ERROR"
           CALL rou_rc
         END
RETURN

copy_mem:

  tot_mem = tot_mem + 1
  ROUT.0 = 1
  ROUT.1 = "./       ADD  LEVEL=00,SOURCE=0,NAME="MEMBER
  "EXECIO * DISKW OUT (FINIS STEM ROUT."
       IF RC > 0 THEN
         DO
           temp_rc   =  RC
           temp_ftc  =  "EXECIO ERROR"
           CALL rou_rc
         END

  " REPRO INDATASET('"libparm"("MEMBER")' )  OUTFILE(OUT) "
       IF RC > 0 THEN
         DO
           temp_rc   =  RC
           temp_ftc  =  "REPRO  ERROR"
           CALL rou_rc
         END
RETURN

read_dir:
  X = OUTTRAP("libmem.")
  "LISTDS '"libparm"' M"
       IF RC > 0 THEN
         DO
           temp_rc   =  RC
           temp_ftc  =  "LISTDS ERROR"
           CALL rou_rc
         END
  X = OUTTRAP("OFF")
       IF libmem.0 < 8 THEN
         DO
           temp_ftc = "PDS IS EMPTY"
           temp_rc  = 4
           CALL rou_rc
         END
RETURN

rou_rc:

       IF temp_rc > 0  THEN
          temp_grc = temp_rc
          SAY " > ERROR         < "
          SAY " > FUNCTION/REXX < " temp_ftc
          SAY " > RETURN CODE   < " temp_rc

  temp_rc  = 0
  temp_ftc = ""

  CALL end_expds
RETURN

end_expds:

  " FREE DATASET('"user"."SEQFILE".EXPDS')"

       IF temp_grc = 0 THEN DO
             SAY "MEMBERS SUCCESSFULLY PROCESSED: "tot_mem
                            END
EXIT  temp_grc

On Thu, Jun 28, 2018 at 9:59 PM, Sean Gleann <[email protected]> wrote:

> Apologies, but I have not been able to respond to this thread for a couple
> of days - my attention was diverted on to something that was deemed to be
> more important.
>
> I've finally arrived at a solution for the problem that suits my purposes -
> a sequence of (1) IEBPTPCH to serialise PDS members, (2) a REXX to modify
> that serial file and then (3) IEBUPDTE takes the REXX output to build a new
> PDS.
>
> Thanks to all that responded to my query - all is under control, now
>
> Sean
>
> On 26 June 2018 at 21:48, Seymour J Metz <[email protected]> wrote:
>
> > Poor integration with native MVS is only one of the problems. There are a
> > lot of facilities that most Eunix sites have that are not required for
> > certification, and IBM has not done well by them.
> >
> >
> > --
> > Shmuel (Seymour J.) Metz
> > http://mason.gmu.edu/~smetz3
> >
> > ________________________________________
> > From: IBM Mainframe Discussion List <[email protected]> on behalf
> > of Paul Gilmartin <[email protected]>
> > Sent: Tuesday, June 26, 2018 4:45 PM
> > To: [email protected]
> > Subject: Re: ICEGENER to the rescue again?
> >
> > On Tue, 26 Jun 2018 19:58:08 +0000, Seymour J Metz wrote:
> >
> > >Well, youngster, Eunix <g> certainly has egregious faults, but it also
> > has its good points. Alas, IBM took a minimalist approach to porting it
> to
> > MVS.
> > >
> > I understand CMS integrates OpenExtensions and CMS commands more closely
> on
> > the command line.  I haven't had an opportunity to try it.  I suspect il
> a
> > les défauts
> > de ses qualités.
> >
> > -- gil
> >
> > ----------------------------------------------------------------------
> > For IBM-MAIN subscribe / signoff / archive access instructions,
> > send email to [email protected] with the message: INFO IBM-MAIN
> >
> > ----------------------------------------------------------------------
> > For IBM-MAIN subscribe / signoff / archive access instructions,
> > send email to [email protected] with the message: INFO IBM-MAIN
> >
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>



-- 
Wayne V. Bickerdike

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to