Using SORT to change member separators into JCL nulls
Posted: Thu Mar 09, 2017 2:49 pm
Hi, I want to flatten a PDS, which I can do with IEBPTPCH.
The intermediate output file looks like this...so I then have to remove the first character (always a 'V').
If I find the 'VMEMBER NAME' header I want to replace the whole record with only '//'.
I am successfully doing this at the moment with this...However I want to ensure that the ONLY thing on the line when this is a 'header' is '//'.
Can I add a length parameter (72 or 80) to the OVERLAY?
I scoured the fora and Gooogled for 'SORT OUTREC OVERLAY SYNTAX' but could not find a good (understandable) ol'fashioned Syntax Diagram.
Also OVERLAY may not be the optimum way to achieve this?
The intermediate output file looks like this...
SDSF OUTPUT DISPLAY N472730R JOB99747 DSID 111
COMMAND INPUT ===>
----+----1----+----2----+----3----+----4----+----5
********************************* TOP OF DATA ****
VMEMBER NAME PGACPY10
V//PGACPY10 JOB (GA,P),'WST',CLASS=C,MSGCLASS=E
V/*JOBPARM L=999,R=OPC
V/*ROUTE PRINT LOCAL
...
COMMAND INPUT ===>
----+----1----+----2----+----3----+----4----+----5
********************************* TOP OF DATA ****
VMEMBER NAME PGACPY10
V//PGACPY10 JOB (GA,P),'WST',CLASS=C,MSGCLASS=E
V/*JOBPARM L=999,R=OPC
V/*ROUTE PRINT LOCAL
...
If I find the 'VMEMBER NAME' header I want to replace the whole record with only '//'.
I am successfully doing this at the moment with this...
//IEBPTPCH EXEC PGM=IEBPTPCH
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=&DLJ Input Library
//SYSUT2 DD DSN=&&SQ1,
// DISP=(,PASS,DELETE),
// SPACE=(CYL,(5,5),RLSE),
// RECFM=FB,LRECL=81
//SYSIN DD *
PUNCH TYPORG=PO
//*
//FCBNULLS EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//REPORT1 DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=&&SQ1
//SORTOUT DD DSN=&&SQ2,
// DISP=(,PASS,DELETE),SPACE=(CYL,(5,5)),
// RECFM=FB,LRECL=80
//SORTWK01 DD SPACE=(CYL,(20,5),RLSE)
//SORTWK02 DD SPACE=(CYL,(20,5),RLSE)
//SORTWK03 DD SPACE=(CYL,(20,5),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(1,14,CH,EQ,C'VMEMBER NAME '),
OVERLAY=(2:C'// '))
OUTREC FIELDS=(1:2,80)
//*
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=&DLJ Input Library
//SYSUT2 DD DSN=&&SQ1,
// DISP=(,PASS,DELETE),
// SPACE=(CYL,(5,5),RLSE),
// RECFM=FB,LRECL=81
//SYSIN DD *
PUNCH TYPORG=PO
//*
//FCBNULLS EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//REPORT1 DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=&&SQ1
//SORTOUT DD DSN=&&SQ2,
// DISP=(,PASS,DELETE),SPACE=(CYL,(5,5)),
// RECFM=FB,LRECL=80
//SORTWK01 DD SPACE=(CYL,(20,5),RLSE)
//SORTWK02 DD SPACE=(CYL,(20,5),RLSE)
//SORTWK03 DD SPACE=(CYL,(20,5),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(1,14,CH,EQ,C'VMEMBER NAME '),
OVERLAY=(2:C'// '))
OUTREC FIELDS=(1:2,80)
//*
Can I add a length parameter (72 or 80) to the OVERLAY?
I scoured the fora and Gooogled for 'SORT OUTREC OVERLAY SYNTAX' but could not find a good (understandable) ol'fashioned Syntax Diagram.
Also OVERLAY may not be the optimum way to achieve this?