Page 1 of 1

PDS creation

PostPosted: Sun Apr 05, 2009 10:11 pm
by sirgalahad
Hi,

I;m brand new at JCL programming and am supposed to come up with code that is to create a partitioned data set copied from a previously existing one. I've searched all over the 'net for an answer but no luck. Hopefully some nice people here can steer me in the right direction. Anyway, when i submit the following:

000001 //NEWDATA JOB 1,NAME,MSGCLASS=X
 000002 //NEW EXEC PGM=IEFBR14
 000003 //CREATE DD DSN=USERID.JCL.LIB,DISP=(NEW,CATLG),
 000004 //  UNIT=SYSALLDA,SPACE=(TRK,1)
 000005 //COPYOLD EXEC PGM=IEBCOPY
 000006 //SYSPRINT DD SYSOUT=*
 000007 //SYSUT1 DD DSN=USERID.JCL,DISP=SHR
 000008 //SYSUT2 DD DSN=USERID.JCL.LIB,DISP=OLD,
 000009 //     SPACE=(CYL,(1,1,45)),
 000010 //     DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),
 000011 //     UNIT=SYSALLDA,
 000012 //     VOL=SER=MARF1B
 000013 //SYSIN DD *
 000014     COPY INDD=SYSUT1,OUTDD=SYSUT2
 000015 /*



it wil run and i get an RC of 0, and the new data set is created but when i try to browse it or otherwise go in and view it i get a message that says 'Invalid record format'. Then when i remove the RECFM=FB which i believe means fixed block it still will create it but i then get 'Invalid record length'. I don't see what the problem is because i assumed it was simply copying all of that information from the old data set which i can navigate just fine.

Can anyone spot the problem? Sorry if the question is beyond stupid. Thanks in advance.

Re: PDS creation

PostPosted: Mon Apr 06, 2009 3:45 am
by dick scherrer
Hello,

Delete the existing "new" dataset and try something like this:
       //JOBSTEP  EXEC  PGM=IEBCOPY
       //SYSPRINT DD  SYSOUT=A
       //SYSUT1   DD  DSNAME=USERID.JCL,DISP=SHR
       //SYSUT2   DD  DSN=USERID.JCL.LIB,DISP=(NEW,CATLG,DELETE),
       //             SPACE=(CYL,(1,1,45)),
       //             UNIT=SYSALLDA,
       //             VOL=SER=MARF1B
instead.

Re: PDS creation

PostPosted: Mon Apr 06, 2009 5:15 am
by sirgalahad
Thanks a million, that worked!

I had not realized you could do both in one step.


Thanks again :mrgreen:

Re: PDS creation

PostPosted: Tue Apr 07, 2009 12:09 am
by dick scherrer
You're welcome :)

I had not realized you could do both in one step.

Also, i should mention that with the posted 2-step jcl, the allocate step did not define a pds but just a qsam file.

In the jcl i posted, removing the dcb info shold cause the "new" pds to have the same dcb as the input to the copy (often quite desirable).

Good luck :)