View previous topic :: View next topic
|
Author |
Message |
harisukumaran
New User
Joined: 14 Jun 2005 Posts: 75
|
|
|
|
This is a very simple question. But unfortunately I could not find the answer to it
Is it possible to concatenate JCL symbolic variables within a cataloged procedure, if their values are not defined in the Job exec statement ?
I want to be able to override the concatenate value as well. so i don't think i can use set within the proc.
I did search the manuals and the message board but could find the exact scenario.
//JOBNAM1 JOB ...
.
.
.
//JOBSTEP1 EXEC PROC1
Cataloged procedure
//PROC1 PROC SYMB1='AAA'
// SYMB2='BBB'
// SYMB3=&SYMB1..&SYMB2
.
.
.
//PROCSTP1 EXEC PGM=IEFBR14
//DD01 DD DISP=SHR,DSN=&SYMB3.
-------------------------------------- |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Is there a reason you can't directly you use
Code: |
//DD01 DD DISP=SHR,DSN=&SYMB1..&SYMB2 |
? |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
I read your post again and it took me 1 minute to test this JCL.
Code: |
//jobcard
// SET TEST1='NULL'
// SET TEST2='FILE'
// SET TEST3=&TEST1.&TEST2
//STEP1 EXEC PGM=IEFBR14
//FILE1 DD DSN=&TEST3 |
Job executed sucecessfully.
Code: |
//FILE1 DD DSN=&TEST3
IEFC653I SUBSTITUTION JCL - DSN=NULLFILE |
|
|
Back to top |
|
|
harisukumaran
New User
Joined: 14 Jun 2005 Posts: 75
|
|
|
|
But I want to use a common cataloged procedure and override parts of the file name in the calling job or override the full DSN as needed.
It looks like the PROC statement in the Procedure can be used to initialize symbolic variables, but it cannot populate symbols using other symbols that are defined in the same statement.
But if the symbols are set via calling Job's EXEC statement or SET statements it will work
But if I populate the values via SET statements inside the cataloged procedure, the overrides in the calling JCL will not work
It looks like I may have to populate the symbols from the calling JCL. I cannot use the 'initial' values in the PROC statement |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest you forget the SET and simply place the overrides on the EXEC statement.
Of course you can use the 'initial' values on the PROC. Just do not reference the ones you want to keep the default value (on the PROC).
Possibly there is something i misunderstand. |
|
Back to top |
|
|
harisukumaran
New User
Joined: 14 Jun 2005 Posts: 75
|
|
|
|
I can use the initial values. But only after the PROC statement. I cannot assign the 'initial' values to another symbolic within the PROC statement. Please look at the example that I gave at the beginning of this post. Maybe everybody already knows this. But it took me 20 years to figure this out. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
I have never had a case where I needed to code your example -- but then I've only been coding up JCL for over 38 years. If I need to do something like that, I'll code DSN=&SYMB1..&SYMB2 in the JCL, not the parameter. I suspect JES uses a a single-pass interpreter, in which case the construct you are attempting to use would not be possible. |
|
Back to top |
|
|
Pete Wilson
Active Member
Joined: 31 Dec 2009 Posts: 580 Location: London
|
|
|
|
You can specify your SET statements in a separate external library and reference that from within your PROC
e.g.
//JCL JCLLIB ORDER=(DFDSS.ML.FILT.V47,DDFSS.PARMS.FILE)
//*
// INCLUDE MEMBER=@RUNDATE
//*
//DSS EXEC PGM=ADRDSSU,COND=(0,NE)
//FILTERDS DD DISP=SHR,DSN=DFDSS.BASE.CNTL(FILTALL)
// INCLUDE MEMBER=EXCLUDE
// DD DISP=SHR,DSN=DFDSS.BASE.CNTL(FILTEND)
//TAPE DD DISP=SHR,DSN=DFDSS.NBASE.V47.OTH.DUMP001.D13150.T1148
//SYSPRINT DD DSN=DFDSS.ML.NREST.V47.OTH.SYSP001.D&RUNDATE..T&RUNTIME,
// BLKSIZE=27998,
// DISP=(,CATLG,DELETE),
// SPACE=(TRK,(50,15),RLSE)
//SYSIN DD DSN=DFDSS.CNTL(RESTCNTL),DISP=SHR
DFDSS.PARMS.FILE(@RUNDATE) -
===>
***************************** Top of
// SET RUNDATE=13207
// SET RUNTIME=0953
DFDSS.ML.FILT.V47(EXCLUDE) - 01.03 ===>
***************************** Top of Data ************
// DD DISP=SHR,DSN=DFSS.ML.EXCLUDE.V47(DSNEXCL) |
|
Back to top |
|
|
|