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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject:
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

Moderator Team Head


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

PostPosted: Mon Feb 23, 2009 6:30 pm    Post subject: Reply to: How to pass quote (‘) in set parameter in JCL
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: 8593
Location: Back in jolly old England

PostPosted: Mon Feb 23, 2009 6:31 pm    Post subject:
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue Feb 24, 2009 7:10 am    Post subject: Reply to: How to pass quote (‘) in set parameter in JCL
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    Post subject:
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    Post subject:
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    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 Can DFSPARM override SORTKEYS paramet... ashek15 DB2 2 Tue Jan 31, 2017 11:36 pm
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm
No new posts DDNAME parameter mistah kurtz JCL & VSAM 6 Mon Dec 19, 2016 4:41 pm
No new posts Execessive parameter issue Sumeendar JCL & VSAM 5 Mon Dec 19, 2016 4:35 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am


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