override a specific SYSIN in PROC from a JCL



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

override a specific SYSIN in PROC from a JCL

Postby dn2012 » Wed Apr 18, 2012 2:57 am

How do you override a specific SYSIN in PROC from a JCL?
dn2012
 
Posts: 114
Joined: Thu Feb 16, 2012 6:10 am
Has thanked: 0 time
Been thanked: 0 time

Re: How do yoOverride a specific SYSIN in PROC from a JCL?

Postby steve-myers » Wed Apr 18, 2012 3:31 am

Though you didn't state it, I presume your procedure is structured something like this --
//A       PROC
//S1      EXEC PGM=...
//dd1      DD  ...
//dd2      DD  ...
//SYSIN    DD  ...
//S2      EXEC PGM=...
//dd3      DD  ...
//dd4      DD  ...
//SYSIN    DD  ...
Notice that each step has a unique stepname. JCL to call the procedure and override some of the DD statements would look like this --
//TEST    EXEC A
//S1.SYSIN DD  ...
//S2.SYSIN DD  ...
The overriding DD statements clearly identify the step and specify the DD name to override, but the steps in the override must be in the same order as the steps in the original procedure. In other words --
//TEST    EXEC A
//S2.SYSIN DD  ...
//S1.SYSIN DD  ...
will not work.

The rules about how the parameters on the original DD statement are merged with parameters in the overriding DD statement are somewhat arcane in detail, but generally make sense in practice, so you should analyze the documentation if you have questions or something does not seem to work right.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: How do yoOverride a specific SYSIN in PROC from a JCL?

Postby dn2012 » Wed Apr 18, 2012 3:41 am

For step 2 of the proc is as

//STEP2 EXEC PGM=IDCAMS,REGION=512K
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE GDG( -
NAME(&DEFGDG)-
LIMIT(7) NOEMPTY SCRATCH)


So I can write as:

//STEP2 EXEC PGM=IDCAMS,REGION=512K
//SYSPRINT DD SYSOUT=*
//STEP2 DD DSN=............, DISP=SHR

is it correct?
If yes, do I need to create dsn.new member which can have JCL to define GDG. So it wil go to last line of above JCL.
dn2012
 
Posts: 114
Joined: Thu Feb 16, 2012 6:10 am
Has thanked: 0 time
Been thanked: 0 time

Re: How do yoOverride a specific SYSIN in PROC from a JCL?

Postby BillyBoyo » Wed Apr 18, 2012 4:06 am

Can you please first read Steve's post. If anything is unclear to you, let us know.

If you do understand Steve's post after reading it, you'll know that what you have posted does not make sense.

If you have finished the PROC, can you post it? Perhaps better, do you know how to use TYPRUN=SCAN? Add it to a JOB card, along with any normal stuff you have there.

Then add the line
//ASTEPNM EXEC yourprocname

Then submit the job and paste the output from it here. In the Code tags if you can, please. Use the Full Editor button. Highlight the "expanded" JCL (all the line-numbered stuff, plus any messages) and click on the Code button. Click on Preview to see what it will look like. Click on Post to post it.

and tell us in plain words how you want to be able to use the PROC.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: How do yoOverride a specific SYSIN in PROC from a JCL?

Postby dn2012 » Wed Apr 18, 2012 4:16 am

//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)             
//         PEND                                             
//STEP2 DD DSN= TSSDN.ASS.TWO(GDGDEF),DISP=SHR
//*                                                                     
//FINAL EXEC EXTPROC,DSNAME=TSSDN.DEMO.TEMP02,DEFGDG=TSSDN.GDBD.TEMP02 
//*                                                                     


JESYSMSG

STMT NO. MESSAGE
3 IEFC019I MISPLACED DD STATEMENT
4 IEFC001I PROCEDURE EXTPROC WAS EXPANDED USING INSTREAM PROCEDURE DEFIN
4 IEFC657I THE SYMBOL DEFGDG WAS NOT USED


Here is code under TSSDN.ASS.TWO(GDGDEF)

//IDCAMS   EXEC PGM=IDCAMS,REGION=512
//SYSPRINT DD SYSOUT=*               
//SYSIN    DD *                     
  DEFINE GDG( -                     
    NAME(TSSDN.TAP.TODISK)-         
    LIMIT(7) NOEMPTY SCRATCH)       
/*                                   
//                                   
dn2012
 
Posts: 114
Joined: Thu Feb 16, 2012 6:10 am
Has thanked: 0 time
Been thanked: 0 time

Re: How do yoOverride a specific SYSIN in PROC from a JCL?

Postby BillyBoyo » Wed Apr 18, 2012 4:52 am

Well, you got the Code button working. Please always use it in future for anything from your mainframe screen.

You got the numbered messages. You didn't get the proc as expanded, with the line numbers the messages refer to.

If you are "smart" you will change that dsn. If you are a "smart..." you'll leave it and have an infantile giggle with your "friends".

Now, all JCL has to be in the input stream. "Data", which is not JCL, it is data, all the commands to programs, can be in datasets. JCL no. Data yes.

All the JCL that you want to be in the PROC has to be in the PROC. The control cards you provide can members in a PDS. If you want to "parameterise" the control cards, you have to do something about that. JCL can use symbols. Data cannot - subject to not being on z/OS 1.13.

Once you have your PROC (and you are not quite there yet), then you have a piece of entirely seperate JCL which, when you submit the job and it is selected, will invoke the PROC, with any valid substitutions your have provided.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: How do yoOverride a specific SYSIN in PROC from a JCL?

Postby dn2012 » Wed Apr 18, 2012 4:57 am

thanks

I changed the code as:

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

But still not work out
dn2012
 
Posts: 114
Joined: Thu Feb 16, 2012 6:10 am
Has thanked: 0 time
Been thanked: 0 time

Re: How do yoOverride a specific SYSIN in PROC from a JCL?

Postby BillyBoyo » Wed Apr 18, 2012 5:07 am

If you want STEP2 to be in the PROC, it has to be inside the PROC. You can't STEP2.SYSIN if STEP2 is not in the PROC.

You are in too much of a hurry.

Did you read Steve's post? Do so, rather than making another quick change. This is not like any PC programming language you might know, you don't keep just fiddling til it works.

You want a PROC with two steps. So, put together two steps. Put them inside a PROC. Practice executing the PROC overriding various things, just so you know how to do it. Don't worry for now about trying to get the PROC to do anything particular, just have something so you can demonstrate to yourself how to do it, following Steve's post.

Next, do you know how to tell the difference between a JCL statement and anything else? It is a very important distinction, and you will continue to make mistakes until you understand the distinction. So, what is the answer?

Now, I'm off for the night. Take some time to understand things before making changes. Read what people take the time to write for you. Try to understand what they write, and if you don't understand, explain what it is that you don't understand.

Don't just say something is "wrong" or "doesn't work". We can't read minds or see your screen. Explain, and show.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: How do yoOverride a specific SYSIN in PROC from a JCL?

Postby dick scherrer » Wed Apr 18, 2012 8:38 am

Hello,

Don't just say something is "wrong" or "doesn't work". We can't read minds or see your screen. Explain, and show.
Just for emphasis. . . Posting "it didn't work" is the biggest waste of time on the forum. Until we are provided with the "problem" and any diagnostic info or message ids generated by the problem run, we can do little to help.

You are in too much of a hurry.

Did you read Steve's post? Do so, rather than making another quick change. This is not like any PC programming language you might know, you don't keep just fiddling til it works.

Yup, and yup. Learning by doing is a great way to learn some things, but each iteration need not be posted to the forum. Hopefully, there is a co-worker or other student you can talk to. Someone nearby surely has build PROCedures that are working. You need to spend more time researching in manuals and existing code/jcl rather than submitting one job after another. Yes, this can be tedious, but it is more important that you actually learn than just getting "something to run".
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: How do yoOverride a specific SYSIN in PROC from a JCL?

Postby NicC » Wed Apr 18, 2012 12:29 pm

For goodness sak! You have hardly applied anything that people have told you and I doubt if you have even looked for the manuals that you were advised to look at let alone started to read them.

Find a procedure in your organisation and study its construction - PROC statement, symbolic override defaults, steps, ddnmaes etc. The ONLY difference between a catalogued procedure and an in-stream procedure is that an in-stream procedure MUST be terminated by a PEND statement.

Now, go and read up about these things before making another post.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post