What do mean by "external proc"?
Do not worry , I understand it.
Step 1 - JCL can create a sequential dataset and a PDS dataset. Your spec seems to imply the procedure can select the type based on some symbolic parameter. This is possible if the symbolic parameter includes the entire SPACE parameter, but this is not a good way to use symbolics.
Here is my proc and performing Step1:
//***************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)
//*
******************************** Bottom of Data ************
Step 2 - You seem to imply the output dataset is the dataset created in step 1. Since you want the output dataset to be on tape, it is not a good idea to "create" the dataset in step 1 and the use it in step 2.
I will not use same DS which I created a step1.
I need to write JCL to copy DS from tape to tape.
If it is possible to use substitute variables its great.
Step 3 - JCL, by itself, cannot create a generation data index. It must be created by a utility such as IDCAMS and by using IDCAMS control statements. Starting with z/OS Release 13 the IDCAMS control statements can be in the procedure, but not all sites are running this release.
I may use followoing JCl in teh procdure, it does work along,
//***************************************************
//* JCL FOR CREATING GDG INDEX
//***************************************************
//STEP3 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE GENERATIONDATAGROUP -
(NAME(TESTA.IMF714.USA.SOURCE.DATA.GDG) -
LIMIT(10) SCRATCH)
//*
But how to add substitute variable in this?
(NAME(&GDG) - <== wil it work?
Step 4 - Is the GDG using the index specified in step 3? Is the input dataset the dataset created in step 2?
Need some assist
Step 5 - A KSDS needs many more parameters. What are they?
I need to create VSAM File (KSDS, Key length 30)