IBM provides a utility, IEBPTPCH, to merge members of PDS (Partitioned Dataset) into a PS (Physical Sequential) file.

However the sole purpose of this utility is to Print or Punch all or part of datasets (PS or PDS). So we will be needing at least one statement i.e. either PRINT or PUNCH in the sysin card.

Since we are merging PDS members we will be specifying TYPORG=PO along with PRINT or PUNCH statements. TYPORG=PO indicates that the input dataset is a PDS. Below is a sample JCL demonstrating how to use IEBPTPCH.

//PDSTOPS  JOB 'Merge PDS members to PS',CLASS=A,
//             MSGLEVEL=(1,1),MSGCLASS=X
//******************************************************************************
//* THIS STEP USES IEBPTPCH UTILITY TO MERGE PDS MEMBERS TO A PS FILE          *
//******************************************************************************
//STEP05   EXEC IEBPTPCH
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSUT1   DD DSN=INPUT.PDS.FILE,DISP=SHR
//SYSUT2   DD DSN=OUTPUT.PS.FILE,DISP=SHR
//SYSIN DD *
 PRINT TYPORG=PO
/*
//

In the final output merge file, it inserts an extra line as below before the actual content of every member:

MEMBER NAME TEST1
TEST1 Content..
MEMBER NAME TEST2
TEST2 Content..

And so on..