IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Concatenating symbolic variables


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 75

PostPosted: Tue Jul 30, 2013 10:33 pm
Reply with quote

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
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Tue Jul 30, 2013 11:43 pm
Reply with quote

Is there a reason you can't directly you use
Code:
 //DD01 DD DISP=SHR,DSN=&SYMB1..&SYMB2
?
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Tue Jul 30, 2013 11:56 pm
Reply with quote

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
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 75

PostPosted: Wed Jul 31, 2013 12:48 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jul 31, 2013 1:47 am
Reply with quote

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
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 75

PostPosted: Wed Jul 31, 2013 6:20 am
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Jul 31, 2013 7:24 am
Reply with quote

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
View user's profile Send private message
Pete Wilson

Active Member


Joined: 31 Dec 2009
Posts: 580
Location: London

PostPosted: Wed Jul 31, 2013 1:31 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts JCL with variables JCL & VSAM 1
No new posts pass data as symbolic parameter from ... CLIST & REXX 2
No new posts JCL Variables JCL & VSAM 1
No new posts reset/clear ALL application profile v... TSO/ISPF 3
No new posts passing symbolic parameters through d... JCL & VSAM 3
Search our Forums:

Back to Top