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

Using quotes in Symbolic Parameter


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

New User


Joined: 22 Feb 2010
Posts: 56
Location: Cochin

PostPosted: Thu Mar 13, 2014 8:19 am
Reply with quote

In a Procedure I have given a symbolic variable for a high level qualifier as below

Code:

HLQ1='R1Y9PB'
...
...


And I have used it in a later step
Code:

SYSOUT DD DSN=&HLQ1..ABC.FILE1


My question is even if I declare the HLQ1 without the single quotes, the DSN gets expanded in the same manner as DSN with single quotes. So the single quotes do not have any impact while resolving the symbolic in a DD statement ?
Code:

HLQ1=R1Y9PB
...
...
Back to top
View user's profile Send private message
TheMFKid

New User


Joined: 20 Nov 2013
Posts: 91
Location: India

PostPosted: Thu Mar 13, 2014 9:47 am
Reply with quote

seahawk789 wrote:
So the single quotes do not have any impact while resolving the symbolic in a DD statement ?


Yes, single quotes can be used with SET statement to assign value to variable. But remember double quotes " will not work.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Mar 13, 2014 12:58 pm
Reply with quote

Try setting a symbolic value with a leading space, or an embedded space, or a signification trailing space. Any space. For instance. Same for any character which would otherwise cause misbehavement. And it is not just single-quotes. Have a dig into the manual, experiment (costs nothing) and just be a bit more creative, don't be blinkered by thinking "the value of the symbol has to be valid for JCL" - it can be a for a PARM, so all bets are off.

If you are adventuresome, you'll also try with characters which JCL does know about.
Back to top
View user's profile Send private message
Pete Wilson

Active Member


Joined: 31 Dec 2009
Posts: 581
Location: London

PostPosted: Thu Mar 27, 2014 2:38 pm
Reply with quote

You only need to specify quotes around the symbolic value when it contains special characters such as a period, or things like the GDG appendage (+1), or if inserting a value into a PARM which has quotes around it already.

e.g. 1
// SET HLQ1='ABC.DEF'
// SET GDG='(+1)'


//ALLOC DD DSN=&HLQ1..REST.OF.DSN&GDG

e.g. 2
For PARM.

In execution JCL specify..
// SET RANGE='XYZ'

In the PROC on the PROC statement specify..
//ABC PROC RANGE=''

on the DD statement specify...

//STEP080 EXEC PGM=DLMSCR,PARM='TYPE=TMS,PREFIX=&RANGE'

This will insert the XYZ into the PARM..
//STEP080 EXEC PGM=DLMSCR,PARM='TYPE=TMS,PREFIX=XYZ'
Back to top
View user's profile Send private message
seahawk789

New User


Joined: 22 Feb 2010
Posts: 56
Location: Cochin

PostPosted: Thu Mar 27, 2014 8:25 pm
Reply with quote

Pete Wilson wrote:
You only need to specify quotes around the symbolic value when it contains special characters such as a period, or things like the GDG appendage (+1), or if inserting a value into a PARM which has quotes around it already.

e.g. 1
// SET HLQ1='ABC.DEF'
// SET GDG='(+1)'


//ALLOC DD DSN=&HLQ1..REST.OF.DSN&GDG

e.g. 2
For PARM.

In execution JCL specify..
// SET RANGE='XYZ'

In the PROC on the PROC statement specify..
//ABC PROC RANGE=''

on the DD statement specify...

//STEP080 EXEC PGM=DLMSCR,PARM='TYPE=TMS,PREFIX=&RANGE'

This will insert the XYZ into the PARM..
//STEP080 EXEC PGM=DLMSCR,PARM='TYPE=TMS,PREFIX=XYZ'


Thanks. So for a text that does not have any special characters setting the symbolic using quotes or without quotes will yield same result while expanding the DSN name I hope.
Back to top
View user's profile Send private message
Pete Wilson

Active Member


Joined: 31 Dec 2009
Posts: 581
Location: London

PostPosted: Thu Mar 27, 2014 8:44 pm
Reply with quote

Try it and go beyond hope into reality.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Thu Mar 27, 2014 8:49 pm
Reply with quote

Quote:
Thanks. So for a text that does not have any special characters setting the symbolic using quotes or without quotes will yield same result while expanding the DSN name I hope.


Do you still hope ? How much time it takes to try?
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 Using the Jobname parameter in a Qual... ABENDS & Debugging 1
No new posts Help in extracting data between doubl... DFSORT/ICETOOL 5
No new posts Demand with DEADLINE TIME parameter CA Products 4
No new posts Option DYNALLOC second parameter. DFSORT/ICETOOL 11
No new posts Writing the output file name from a p... JCL & VSAM 7
Search our Forums:

Back to Top