Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Concatenating symbolic variables

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 33

PostPosted: Tue Jul 30, 2013 10:33 pm    Post subject: Concatenating symbolic variables
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: 685
Location: Earth

PostPosted: Tue Jul 30, 2013 11:43 pm    Post subject:
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: 685
Location: Earth

PostPosted: Tue Jul 30, 2013 11:56 pm    Post subject:
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: 33

PostPosted: Wed Jul 31, 2013 12:48 am    Post subject:
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

Site Director


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

PostPosted: Wed Jul 31, 2013 1:47 am    Post subject:
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: 33

PostPosted: Wed Jul 31, 2013 6:20 am    Post subject: Reply to: Concatenating symbolic variables
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: 7912
Location: Bellevue, IA

PostPosted: Wed Jul 31, 2013 7:24 am    Post subject:
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 User


Joined: 31 Dec 2009
Posts: 437
Location: London

PostPosted: Wed Jul 31, 2013 1:31 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts Symbolic Parameters in SYSIN DD state... madishpa DFSORT/ICETOOL 3 Mon Jun 27, 2016 6:23 pm
No new posts Is it possible to pass variables of s... Csongor CLIST & REXX 2 Fri Jun 10, 2016 7:33 pm
No new posts TWS 'global' or 'local' variables Steve Coalbran IBM Tools 2 Thu Mar 17, 2016 7:40 pm
This topic is locked: you cannot edit posts or make replies. Put quotes in Symbolic parameter whil... Yashashri All Other Mainframe Topics 7 Mon Feb 15, 2016 12:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us