Page 1 of 1

creating new pds and member

PostPosted: Fri Apr 03, 2009 6:17 am
by rowlf
Hi,

For an assignment we are supposed to write JCL that will create a new partitioned data set with a member in it that contains text specified in the JCL block, but what i came up with isn't working, and i wondered if someone could point me in the right direction.

Here is what i've tried,

//NEWJOB JOB 1,USERNAME,MSGCLASS=X
//STEP1 EXEC PGM=IEFBR14
//CREATE DD DSN=MYID.JCL.LIB, DISP=(NEW,CATLG),
        UNIT=SYSALLDA,SPACE=(TRK,1)
//PDSMBR EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD DISP=OLD, DSN=MYID.JCL.LIB(NEWMBR)
//SYSUT1 DD *
   TEXT HERE
/*


I have that code in a member of a partitioned data set. When i try to run it, i'm typing 'submit' at the command propmt inside the member containing the code, and a message pops up saying JOB NEWJOB SUBMITTED with the job number in brackets in white text. Then i press enter to finish, then F3 to back out to the ISPF primary options menu. Then i am going into the SDSF and the job does not even get put in the queues, and when i look at the log it says it didn't run because of JCL error.

Any help would be greatly appreciated, thanks

Re: creating new pds and member

PostPosted: Fri Apr 03, 2009 2:42 pm
by MrSpock
You have the right idea. In order to create a member in a PDS you have to write some sort of content. Remember, though, that a PDS contains directory blocks, and you must specify how many directory blocks you want in your allocation:
//PDSMBR EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD DSN=MYID.JCL.LIB(NEWMBR),
//         DISP=(,CATLG,DELETE),UNIT=SYSALLDA,
//         SPACE=(TRK,(1,1,10))
//SYSUT1 DD *
   TEXT HERE
/*


See 3.7 Chapter 26. Processing a Partitioned Data Set (PDS) in the z/OS V1R7.0 DFSMS Using Data Sets Guide.

Re: creating new pds and member

PostPosted: Mon Apr 06, 2009 6:44 pm
by Bill Dennis
If you pasted your JCL correctly, the ERROR was probably the blank space before DSN on the SYSUT2 statement. JCL ERRORs are usually accompanied by explanatory messages in the listing.

As Mr Spock shows, you can do it all in one step.