Joined: 20 Jun 2003 Posts: 112 Topics: 48 Location: Bangalore
Posted: Fri Feb 06, 2004 6:36 am Post subject: IEBPTPCH convert seq file to PDS
Hi All,
I was just trying to reverse the effect of IEBPTPCH in which we can concatenate all the members of a PDS. I tried to copy a seq dataset to a PDS. The code is as below
Code:
//JS10 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=input seq file,
// DISP=SHR
//SYSUT2 DD DSN=output pds,
// DISP=(MOD,KEEP)
//SYSIN DD *
GENERATE MAXNAME=4,MAXGPS=3
MEMBER NAME=JOBCARD
RECORD IDENT=(11,'MEMBER NAME',1),
MEMBER NAME=JESCARDS
GRP2 RECORD IDENT=(11,'MEMBER NAME',1),
MEMBER NAME=JCLCARDS
GRP3 RECORD IDENT=(11,'MEMBER NAME',1),
MEMBER NAME=RPTDATA
GRP4 RECORD IDENT=(11,'MEMBER NAME',1)
/*
I want to split the seq file into different members in PDS whenever there is 'MEMBER NAME' occuring in 1st position of a record in the seq file.
The error i got while executing this is
Code:
JS10 - IBM-IEBGENER WAS USED DUE TO //SYSIN CONTROL CARDS IEBGENER-98B
1DATA SET UTILITY - GENERATE
- GENERATE MAXNAME=4,MAXGPS=3
MEMBER NAME=JOBCARD
RECORD IDENT=(11,'MEMBER NAME',1),
IEB338I INVALID PARAMETER IN COL. 23
MEMBER NAME=JESCARDS
GRP2 RECORD IDENT=(11,'MEMBER NAME',1),
IEB336I INVALID COMMAND IN COL. 04
MEMBER NAME=JCLCARDS
IEB348I PRECEDING MEMBER REQUIRES "IDENT"
GRP3 RECORD IDENT=(11,'MEMBER NAME',1),
IEB336I INVALID COMMAND IN COL. 04
MEMBER NAME=RPTDATA
IEB348I PRECEDING MEMBER REQUIRES "IDENT"
GRP4 RECORD IDENT=(11,'MEMBER NAME',1)
IEB336I INVALID COMMAND IN COL. 04
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Fri Feb 06, 2004 7:19 am Post subject:
Deepesh,
If your intention is to create a pds from a seq file created by IEBPTPCH uitlity then the following DFSORT/ICETOOL JCL will give you the desired results.if you have syncsort then change the pgm name to synctool. A brief explanation of the job.
When you flatten the PDS using IEBPTPCH, it puts a header for each member in the pds which looks as follows:
Code:
MEMBER NAME IEBGENER
Step0200: This steps takes in the flat file from step0100 and modifies the headers which will be recognized by IEBUPDTE for repopulating the PDS.
Code:
//STEP0100 EXEC PGM=IEBPTPCH
//*
//SYSUT1 DD DSN=YOUR PDS,
// DISP=SHR
//SYSUT2 DD DSN=&P,DISP=(,PASS),SPACE=(CYL,(20,60),RLSE)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
PUNCH TYPORG=PO
//*
//STEP0200 EXEC PGM=ICETOOL
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//IN DD DSN=&P,DISP=(OLD,PASS)
//T1 DD DSN=&T1,DISP=(,PASS),SPACE=(CYL,(10,10),RLSE),RECFM=FB
//T2 DD DSN=&T2,DISP=(,PASS),SPACE=(CYL,(20,60),RLSE),RECFM=FB
//CONCAT DD DSN=*.T1,DISP=(OLD,PASS),VOL=REF=*.T1
// DD DSN=*.T2,DISP=(OLD,PASS),VOL=REF=*.T2
//OUT DD DSN=FLAT FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(20,60),RLSE)
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
SORT FROM(CONCAT) USING(CTL2)
//CTL1CNTL DD *
INREC FIELDS=(2,80,SEQNUM,8,ZD)
OUTFIL FNAMES=T1,INCLUDE=(1,11,CH,EQ,C'MEMBER NAME'),
OUTREC=(C'./ ADD NAME=', $ CONTROL CARD FOR IEBUPDTE
14,8, $ MEMBER NAME
57X, $ PAD WITH SPACES
81,8) $ SEQNUM
OUTFIL FNAMES=T2,SAVE $ THE ACTUAL CONTENT OF THE MEMBER
//CTL2CNTL DD *
SORT FIELDS=(81,8,ZD,A) $ SORT ON SEQNUM
OUTFIL FNAMES=OUT,OUTREC=(1,80) $ STRIP THE SEQNUM
/*
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Fri Feb 06, 2004 9:13 am Post subject:
Deepesh,
what exactly is your requirement? so far I understood that you wanted to re-create a PDS from a flat file. Is that right? The actual process of creating a PDS from a seq file is done by the utility IEBUPDTE. You can create a PDS using IEBGENER but it involves more work on the programmer.
The ICETOOL step in the JCL posted above is just for reformatting the sequential file input to the format that IEBUPDTE expects. If your client does not want a solution with ICETOOL , the same step0200 results can be achieved by spilitting the step into 2 steps like as shown below.
Code:
//STEP0200 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&P,DISP=(OLD,PASS)
//T1 DD DSN=&T1,DISP=(,PASS),SPACE=(CYL,(10,10),RLSE),RECFM=FB
//T2 DD DSN=&T2,DISP=(,PASS),SPACE=(CYL,(20,60),RLSE),RECFM=FB
//SYSIN DD *
SORT FIELDS=COPY
INREC FIELDS=(2,80,SEQNUM,8,ZD)
OUTFIL FNAMES=T1,INCLUDE=(1,11,CH,EQ,C'MEMBER NAME'),
OUTREC=(C'./ ADD NAME=', $ CONTROL CARD FOR IEBUPDTE
14,8, $ MEMBER NAME
57X, $ PAD WITH SPACES
81,8) $ SEQNUM
OUTFIL FNAMES=T2,SAVE $ THE ACTUAL CONTENT OF THE MEMBER
//*
//STEP0300 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&T1,DISP=(OLD,PASS)
// DD DSN=&T2,DISP=(OLD,PASS)
//SORTOUT DD DSN=FLAT FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(20,60),RLSE)
//SYSIN DD *
SORT FIELDS=(81,8,ZD,A) $ SORT ON SEQNUM
OUTREC FIELDS=(1,80) $ STRIP THE SEQNUM
/*
Hope this helps...
Cheers
Kolusu
PS: If you are still interested to create the PDS with IEBGENER , check the following link for a detailed explanation of IEBGENER utility with examples.
Joined: 20 Jun 2003 Posts: 112 Topics: 48 Location: Bangalore
Posted: Fri Feb 06, 2004 9:35 am Post subject:
Hi Kolusu,
Thanks for the prompt reply. Yeah this will work. The exact requirement is that we have converted a PDS into a sequential file using IEBPTPCH, this sequential file is being ndmed to production env and and now we want to turn it back to the PDS in production.
We thought of using IEBGENER, but it was giving errors. Anyhow thanks for the solution through sort.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum