Hello Derez,
The preferred method would be to use the ADDCNTL(Y) keyword on generating the sequential file. The library can be recreated running the IEBUPDTE utility. Note when you use the COPY command in the FM batch utility to copy PDS members to a sequential file ADDCNTL(Y) is automatically set for you.
If for any reason the sequential file was created with no separator here's a way to recreate your library using the FM batch program. It requires some additional work from you though. In the below example:
- Step1 concatenates PDS members into a sequential file with ADDCNTL(N) in order to skip the insert of the separator.
- Step2 creates a deck of copy commands form a list of members with their line count. In real life you would probably use a Rexx to scan the original PDS and create the list. Note the line counts that are later used in the OUTLIM parameter must be padded with 0s. Note also the INFILE parameter is gnerated with NOCLOSE so that to keep the position in the input prior to start copying to the next member.
- Step 3 prints the generated commands for clarity
- Step 4 let the FM batch program process the deck of commands.
Below is the job
Best regards,
Patrice
//userC JOB .....
//* ----------------------------------------------------------------
//* THE BELOW CAN HELP WHEN A SEQUENTIAL FILE WAS CREATED BY
//* CONCATENATING PDS MEMBERS INTO IT WITH NO SEPARATOR IN-BETWEEN.
//* 1. PREPARE A LIST OF MEMBERS WITH THE NUMBER OF LINES
//* 2. CREATE A DECK OF FM COPY COMMANDS
//* 2. EXECUTE THE DECK OF COMMANDS
//* ----------------------------------------------------------------
//S1 EXEC PGM=CAWABATC
//SYSPRINT DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//SYSUT2 DD DSN=user.TEMP.PS,DISP=(NEW,PASS,DELETE),
// LIKE=user.PDS1,DCB=DSORG=PS,
// SPACE=(CYL,(1,1)),UNIT=SYSDA
//SYSUT1 DD DSN=user.PDS1,DISP=SHR
//SYSIN DD *
COPY INFILE(SYSUT1),OUTFILE(SYSUT2),MEMBER(*),ADDCNTL(N)
/*
//S2 EXEC PGM=CAWABATC
//SYSPRINT DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//SYSUT1 DD *
*---+----1----+----2----+----3----+----4----+----5
INALL1 00005
INALL2 00010
INFIRST1 00004
INFIRST2 00007
/*
//SYSUT2 DD DSN=&&CMD,UNIT=VIO,SPACE=(TRK,(1,1)),
// LRECL=80,DISP=(NEW,PASS)
//SYSIN DD *
READ,
INFILE(SYSUT1),
PADCHAR(X"40"),
IF(1,1,NE,C"*"),
MOVE(CLEAR),
MOVE(1,C" COPY INFILE(SYSUT1,NOCLOSE),"),
WRITE(SYSUT2),
MOVE(CLEAR),
MOVE(1,C" OUTFILE(user.TEMP.PDS("),
MOVE(+0,8,1),
MOVE(39,C")),"),
WRITE(SYSUT2),
MOVE(CLEAR),
MOVE(1,C" OUTLIM("),
MOVE(+0,5,10),
MOVE(18,C")"),
WRITE(SYSUT2)
/*
//S3 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=*
//SYSUT1 DD DSN=&&CMD,DISP=(OLD,PASS)
//SYSIN DD DUMMY
//*
//S4 EXEC PGM=CAWABATC
//SYSPRINT DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//SYSUT2 DD DSN=user.TEMP.PDS,DISP=(NEW,CATLG,DELETE),
// LIKE=user.TEMP.PS,SPACE=(CYL,(1,1,45)),UNIT=SYSDA
//SYSUT1 DD DSN=user.TEMP.PS,DISP=(OLD,DELETE,DELETE)
//SYSIN DD DSN=&&CMD,DISP=(OLD,PASS)