PROC and pass all the variables from Job



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

PROC and pass all the variables from Job

Postby dn2012 » Wed Apr 04, 2012 3:42 am

Hello,

By using SYMBOLIC Variables in the PROC and pass all the variables from Job. I need to write External Proc which should create a Dataset PDS and copy from one dataset to other.
Dataset should be a TAPE dataset.

Currently I used following JCL for creating a PDS and copy from one dataset to other.

//***************THE DD STATEMENT FOR A NEW DATA SET********************
//*THE IMPORTANT ITEMS ON THE FOLLOWING IS THE DISP AND DCB INFORMATION.
//**********************************************************************
//*
// EXEC PGM=IEFBR14
//SQADB512 DD DSN=WORLD.IMF714.ITD.TEST,DISP=(NEW,CATLG,DELETE),
// STORCLAS=MFI,
// SPACE=(TRK,5),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PO)
//*


//*COPY A MEMBER FROM OTHER PDS TO THIS PDS THRU IEBCOPY
//******************************************************************
// EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=WORLD.SL9.JOB3 <== INPUT PDS
//SYSUT2 DD DISP=SHR,DSN=WORLD.JCL.CNTL <== OUTPUT PDS
//SYSIN DD *
COPY OUTDD=SYSUT2,INDD=((SYSUT1,R))
S M=RESTF161

I am new to JCL, this will be my first procedure. Thanks for help.

Thank You
dn2012
 
Posts: 114
Joined: Thu Feb 16, 2012 6:10 am
Has thanked: 0 time
Been thanked: 0 time

Re: PROC and pass all the variables from Job

 

Re: PROC and pass all the variables from Job

Postby Robert Sample » Wed Apr 04, 2012 4:12 am

Dataset should be a TAPE dataset
You did not specify if your INPUT or your OUTPUT data set is to be on tape. And since a PDS cannot exist on a tape (except in unloaded sequential format), then either (1) your requirement cannot be met, or (2) you are copying from a disk PDS to a tape output data set.

Using too many symbolic parameters defeats the purpose -- having EVERY value a symbolic means it takes as long, or longer, to code up the procedure execution than it would to just code up the JCL directly. You can use this as a starting point for coding up your procedure:
//COPYPDS  PROC INHLQ=WORLD,OUTHLQ=WORLD
and continue from there.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: PROC and pass all the variables from Job

Postby dn2012 » Wed Apr 04, 2012 4:49 am

what about this?

//PDSCRTP4 PROC                                               
//PDSCRTS1 EXEC PGM=IEFBR14                                   
//TEMPLIB1 DD  DISP=(NEW,CATLG),DSN=&DSNAME,                 
//             STORCLAS=MFI,                                 
//             SPACE=(TRK,(45,15,50)),                       
//             RECFM=FB,LRECL=80,BLKSIZE=800
//         PEND                                               
//*


Create a PDS using EXEC and DSNAME substitution

//STEPJ42  EXEC PDSCRTP4,DSNAME=WORLD.DEMO.TEMP
dn2012
 
Posts: 114
Joined: Thu Feb 16, 2012 6:10 am
Has thanked: 0 time
Been thanked: 0 time

Re: PROC and pass all the variables from Job

Postby dn2012 » Wed Apr 04, 2012 5:31 am

sorry above is instream,

I need to create External Proc that should have the below steps.

a) STEP1 Create a Dataset PDS or PS
b) STEP2 Copy from one dataset to other. Dataset should be a TAPE dataset.
c) STEP3 Create GDG Base.
d) STEP4 Create New version GDG file and copy tape data to Disk
e) STEP5 Create VSAM File (KSDS, Key length 30)

I need to use SYMBOLIC Variables in the PROC and pass all the variables from Job. Use COND Code in all the steps.

I need assits in a & b, rest I think I will take care.

thanks
dn2012
 
Posts: 114
Joined: Thu Feb 16, 2012 6:10 am
Has thanked: 0 time
Been thanked: 0 time

Re: PROC and pass all the variables from Job

Postby steve-myers » Wed Apr 04, 2012 5:36 am

dn2012 wrote:Hello,

By using SYMBOLIC Variables in the PROC and pass all the variables from Job. I need to write External Proc which should create a Dataset PDS and copy from one dataset to other.
Dataset should be a TAPE dataset.

Currently I used following JCL for creating a PDS and copy from one dataset to other.

//***************THE DD STATEMENT FOR A NEW DATA SET********************
//*THE IMPORTANT ITEMS ON THE FOLLOWING IS THE DISP AND DCB INFORMATION.
//**********************************************************************
//*
// EXEC PGM=IEFBR14
//SQADB512 DD DSN=WORLD.IMF714.ITD.TEST,DISP=(NEW,CATLG,DELETE),
// STORCLAS=MFI,
// SPACE=(TRK,5),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PO)
//*
... I am new to JCL, this will be my first procedure. Thanks for help.

Thank You

I hope you realize that WORLD.IMF714.ITD.TEST cannot be a PDS: your SPACE parameter did not specify any directory blocks.

When the SPACE parameter specifies directory blocks, you do not need to specify DSORG=PO; the system is smart enough to realize you are allocating a PDS.
steve-myers
Global moderator
 
Posts: 1885
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Re: PROC and pass all the variables from Job

Postby dn2012 » Wed Apr 04, 2012 8:50 pm

Thanks

I removed DSORG=PO

But how to specify any directory blocks in SPACE parameter.

DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
dn2012
 
Posts: 114
Joined: Thu Feb 16, 2012 6:10 am
Has thanked: 0 time
Been thanked: 0 time

Re: PROC and pass all the variables from Job

Postby Robert Sample » Wed Apr 04, 2012 8:58 pm

SPACE=(TRK,(5,1,50))
specifies 5 primary tracks, 1 secondary track for the data set with 50 directory blocks. Based upon your questions, you really need to spend a LONG time reading the JCL Reference manual to learn the details of the different parameters.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: PROC and pass all the variables from Job

Postby dick scherrer » Wed Apr 04, 2012 10:47 pm

Hello,

Suggest you explain (in paragraph form, not the "steps" for the proc/jcl) what your process is to accomplish.

Once we all understand your goal, we may be able to offer better suggestions.
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: PROC and pass all the variables from Job

Postby NicC » Wed Apr 04, 2012 10:47 pm

There is no such item as an 'external' proc - you mean catalogued procedure. Just remove the PEND line from your above code and put he procedure into a library - preferably one called PROC or PROCLIB.

Do not use IEFBR14 to pre-allocate a dataset. In this simple exercise - and it is an exercise as you would find things simpler for a straight copy job to just have a straight JCL deck - just code the symbolics directly and use SET to resolve them.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: PROC and pass all the variables from Job

Postby steve-myers » Wed Apr 04, 2012 11:22 pm

dn2012 wrote:...
I need to create External Proc that should have the below steps.

a) STEP1 Create a Dataset PDS or PS
b) STEP2 Copy from one dataset to other. Dataset should be a TAPE dataset.
c) STEP3 Create GDG Base.
d) STEP4 Create New version GDG file and copy tape data to Disk
e) STEP5 Create VSAM File (KSDS, Key length 30)
...
  • What do mean by "external proc"?
  • 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.
  • 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.
  • 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.
  • Step 4 - Is the GDG using the index specified in step 3? Is the input dataset the dataset created in step 2?
  • Step 5 - A KSDS needs many more parameters. What are they?
In general, these specifications seem to be pretty half baked, and this exercise seems to be homework.

We do not do homework.
steve-myers
Global moderator
 
Posts: 1885
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post