PDS creation



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

PDS creation

Postby sirgalahad » Sun Apr 05, 2009 10:11 pm

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.
sirgalahad
 
Posts: 2
Joined: Sun Apr 05, 2009 10:04 pm
Has thanked: 0 time
Been thanked: 0 time

Re: PDS creation

 

Re: PDS creation

Postby dick scherrer » Mon Apr 06, 2009 3:45 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: PDS creation

Postby sirgalahad » Mon Apr 06, 2009 5:15 am

Thanks a million, that worked!

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


Thanks again :mrgreen:
sirgalahad
 
Posts: 2
Joined: Sun Apr 05, 2009 10:04 pm
Has thanked: 0 time
Been thanked: 0 time

Re: PDS creation

Postby dick scherrer » Tue Apr 07, 2009 12:09 am

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 :)
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post