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

How to pass quote (‘) in set parameter in JCL


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

New User


Joined: 02 May 2008
Posts: 42
Location: chennai

PostPosted: Mon Feb 23, 2009 6:26 pm
Reply with quote

How to pass quote (‘) in set parameter in JCL


// SET CD='/servername/dir_p/OUT'/SamPLE'
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Feb 23, 2009 6:30 pm
Reply with quote

The syntax for SET is described here:

Quote:

Code each apostrophe that is part of a value as two consecutive apostrophes. For example:

//SP3 SET PARM4='O''DAY'
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Feb 23, 2009 6:31 pm
Reply with quote

What have you tried so far ?
Back to top
View user's profile Send private message
sathish1760

New User


Joined: 02 May 2008
Posts: 42
Location: chennai

PostPosted: Mon Feb 23, 2009 7:13 pm
Reply with quote

// SET AGS='x'
// SET QUOTE=''''
// SET ENV=T
// SET CV=03
// SET CD=&QUOTE./servername/dir_p/OUT''/SamPLE.&QUOTE
//FTP1 EXEC PROC=FTP,APPL='AGS',BOXNM='AGSA',FROMTO='GET',
// FILIN=&QUOTE.FIL.AGSU1100.OKE.&AGS.&QUOTE.,CD=&QUOTE.&CD.&QUOTE.
// FILOUT=AGS&ENV..CV&CV..FIL.AGSOK

Look at the cd variable, it containa the lower case, upper case and APOSTROPHE('). i want to pass that cd value in the ftp step.
but the above jcls is giving the below mentioned error.

INCORRECT USE OF APOSTROPHE ON THE EXEC STATEMENT.

thanks in advance..
Back to top
View user's profile Send private message
mtaylor

Active User


Joined: 20 Feb 2009
Posts: 108
Location: Kansas City

PostPosted: Tue Feb 24, 2009 4:48 am
Reply with quote

Superk has the right idea. Apostrophes inside string literals are compressed two to one by the system. So

Code:

// SET CD=&QUOTE./servername/dir_p/OUT''/SamPLE.&QUOTE


Should be:

Code:

// SET CD='./servername/dir_p/out''''/Sample.'


I believe four apostrophes are required in this case because the 2->1 compression will happen twice, once when the SET is evaluated and once again when the parameter is passed to the EXEC (see page 5-19 in the 'MVS JCL Reference' manual on the IBM site).

Hope that helps...
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: Tue Feb 24, 2009 7:10 am
Reply with quote

Hello and welcome to the forum,

Thanks for the input.

Hopefully, there will be things you find useful as well icon_smile.gif

d
Back to top
View user's profile Send private message
sathish1760

New User


Joined: 02 May 2008
Posts: 42
Location: chennai

PostPosted: Tue Feb 24, 2009 11:20 am
Reply with quote

thanks mtaylor.
i tried (// SET CD='./servername/dir_p/out''''/Sample.' ) . In my jcl next step is rexx execution step. its substituting the correct value

original:
RUNREXX1 EXEC PGM=IKJEFT01,
PARM='%REXXFTP1 &BOXNM &DIR'
jes subs:
PARM='%REXXFTP1 AGSA /servername/dir_p/OUT'/SamPLE'

getting error:
INCORRECT USE OF APOSTROPHE ON THE EXEC STATEMENT
Back to top
View user's profile Send private message
mtaylor

Active User


Joined: 20 Feb 2009
Posts: 108
Location: Kansas City

PostPosted: Tue Feb 24, 2009 6:52 pm
Reply with quote

d. scherrer: Thanks!

Satish; Try 6 apostrophes. Looking at the MVS JCL Reference page I referenced earlier, their example should give the same error you have:

Code:

//EXAMPLE PROC SYM1=’What’’’’s up, Doc?’,SYM2=(DEF),SYM3=&&&&TEMP1,
//       SYM4=’&&TEMP2’,SYM5=&&TEMP3,TEMP3=TEMPNAME,
//       SYM6=&TEMP3
//S1        EXEC PGM=WTO,PARM=’&SYM1’,ACCT=&SYM2
//DD1       DD DSN=&SYM3,UNIT=SYSDA,SPACE=(TRK,(1,1))
//DD2       DD DSN=&SYM4,UNIT=SYSDA,SPACE=(TRK,(1,1))
//DD3       DD DSN=&SYM5,UNIT=SYSDA,SPACE=(TRK,(1,1))
//DD4       DD DSN=&SYM6,UNIT=SYSDA,SPACE=(TRK,(1,1))
//          PEND


Becomes:

Code:

//S1  EXEC PGM=WTO,PARM=’What’s up, Doc?’,ACCT=(DEF)
//DD1 DD   DSN=&&TEMP1,UNIT=SYSDA,SPACE=(TRK,(1,1))
//DD2 DD   DSN=&&TEMP2,UNIT=SYSDA,SPACE=(TRK,(1,1))
//DD3 DD   DSN=&TEMP3,UNIT=SYSDA,SPACE=(TRK,(1,1))
//DD4 DD   DSN=&TEMP3,UNIT=SYSDA,SPACE=(TRK,(1,1))


Let us know if that works.
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 How to pass the PARM value to my targ... COBOL Programming 8
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Using the Jobname parameter in a Qual... ABENDS & Debugging 1
No new posts Demand with DEADLINE TIME parameter CA Products 4
No new posts Option DYNALLOC second parameter. DFSORT/ICETOOL 11
Search our Forums:

Back to Top