Page 1 of 3

execute proc to create PDS

PostPosted: Thu Apr 12, 2012 8:03 pm
by dn2012
Hello All

I have created following procedure.

//EXTPROC PROC
//************************************************************
//***************THE DD STATEMENT FOR A NEW DATA SET**********
//*CREATE A PDS
//************************************************************
//*
//STEP1 EXEC PGM=IEFBR14
//SQADB512 DD DSN=&DSNAME,DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(5,3,1)),UNIT=SYSDA,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PO)
//*


Now I need to execute proc to create PDS.
Do I need to write JCL in the same proc? If yes how?
Assume I am creating PDS called "THANKS.FOR.HELP".

EXEC EXTPROC,DSNAME=THANKS.FOR.HELP

thx

Re: Proc

PostPosted: Thu Apr 12, 2012 8:38 pm
by Robert Sample
Look in the JCL Reference manual (if you don't have it bookmarked, look at http://www.ibm.com to find it) and read up on the JCLLIB statement.

And, by the way, using a title of "Proc" in a JCL forum is not very smart since it tells us nothing about what your problem is and the sheer genreality of the title will cause some people to skip reading it.

Re: Proc

PostPosted: Thu Apr 12, 2012 8:44 pm
by dn2012
//EXTPROC JOB XXXXXX,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=XXXX
//***************THE DD STATEMENT FOR A NEW DATA SET**********
//*CREATE A PDS
//************************************************************
//*
//EXTPROC PROC
//STEP1 EXEC PGM=IEFBR14
//SQADB512 DD DSN=&DSNAME,DISP=(NEW,CATLG),
// SPACE=(TRK,(5,3,1)),UNIT=SYSDA,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PO)
// PEND
//*
//STEP1 EXEC EXTPROC,DSNAME=SIMOTIME.DEMO.TEMP02


getting errors as

08.08.44 JOB12636 ACF99913 ACF2 VIOLATION-08,06,TSSDN,,SIMOTIME.DEMO.TEMP02,N/A
08.08.44 JOB12636 IEF452I CREPDSTP - JOB NOT RUN - JCL ERROR
08.08.44 JOB12636 $HASP396 CREPDSTP TERMINATED


STMT NO. MESSAGE
3 IEFC001I PROCEDURE EXTPROC WAS EXPANDED USING INSTREAM PROCEDURE DEFIN
ACF99913 ACF2 VIOLATION-08,06,TSSDN,,SIMOTIME.DEMO.TEMP02,N/A
6 IGD308I DATA SET ALLOCATION REQUEST FAILED -
RACF FUNCTION: RACDEF FOR
DATA SET: SIMOTIME.DEMO.TEMP02 WITH RETURN CODE 08 REASON CODE 00

Re: Proc

PostPosted: Thu Apr 12, 2012 8:48 pm
by Akatsukami
IOW, your attempt to create a PDS with the HLQ SIMOTIME was a security violation.

Re: Proc

PostPosted: Thu Apr 12, 2012 9:01 pm
by BillyBoyo
More stuff just copy/pasted from the internet.

Re: Proc

PostPosted: Thu Apr 12, 2012 9:06 pm
by dn2012
it did work.

Re: Proc

PostPosted: Thu Apr 12, 2012 9:19 pm
by dn2012
Now I execute two jobs but get errors as below;

//EXTPROC PROC
//STEP1 EXEC PGM=IEFBR14
//SQADB512 DD DSN=&DSNAME,DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(5,3,1)),UNIT=SYSDA,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PO)
//*
//STEP2 EXEC PGM=IDCAMS,REGION=512K
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE GDG( -
NAME(&DEFGDG)-
LIMIT(7) NOEMPTY SCRATCH)
// PEND
//*
//STEP1 EXEC EXTPROC,DSNAME=TSSDN.DEMO.TEMP02
//STEP2 EXEC EXTPROC,DEFGDG=TSSDN.GDBD.TEMP02
//*

JOB14189 IEFC452I EXTPROC - JOB NOT RUN - JCL ERROR 201
9 IEFC601I INVALID JCL STATEMENT
10 IEFC001I PROCEDURE EXTPROC WAS EXPANDED USING INSTREAM PROCEDURE DEFI
10 IEFC657I THE SYMBOL DEFGDG WAS NOT USED
16 IEFC601I INVALID JCL STATEMENT

Re: Proc

PostPosted: Thu Apr 12, 2012 9:30 pm
by Robert Sample
1. Unless you are running the latest version of z/OS, you cannot have SYSIN DD * in a PROC -- PERIOD.
2. Even if you ARE running z/OS 1.13, you cannot use JCL symbolics (like your &DEFGDG) in the SYSIN. You can define symbols to SORT, but that doesn't work for IDCAMS.
3. You completely and totally misunderstand the PROC -- each execution of EXTRPROC will invoke IEFBR14, then IDCAMS, as you have coded your PROC. So you are exeucting FOUR programs by executing EXTPROC twice.

You would be FAR better served by not posting anything in this forum again until you have read the JCL Reference and JCL User's Guide manuals cover to cover, even if it takes you weeks to do so.

Re: Proc

PostPosted: Thu Apr 12, 2012 9:37 pm
by dn2012
Can you send me the links for JCL Reference and JCL User's Guide ? thanks

Re: Proc

PostPosted: Thu Apr 12, 2012 10:21 pm
by NicC
Why not help yourself and search for the links - either in the forum or via Google (jcl manual is a good thing to begin with in google and then look for links beginning publiz.boulder)?