Posted: Wed Oct 07, 2009 11:23 am Post subject: Escaping single quote
Hi,
I am trying to build parms to be used in a ftp step. I have a requirement to append the run date to the destination file name. Below is my sample code.
Code:
SORT FIELDS=COPY
OUTFIL OUTREC=(C' ftp.abc.com',80:X,/,
C' FTP_userid',80:X,/,
C' ftp_pass',80:X,/,
C' PUT 'AAAAA.BBBBB.CCCCC' remotename_',DATE1,'.TXT',80:X,/,
C' LS -L',80:X,/,
C' QUIT',80:X)
The step is failing with a syntax error statement for the fourth record. Is there a way I can escape the single quote used in the mainframe file name?
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Oct 07, 2009 11:32 am Post subject:
Ram,
If you want enclose the dsn name in quotes you need an extra set of quotes. Use the following control cards
Code:
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL OUTREC=(C' FTP.ABC.COM',/,
C' FTP_USERID',/,
C' FTP_PASS',/,
C' PUT ''',C'AAAAA.BBBBB.CCCCC''',
C' REMOTENAME_',DATE1,C'.TXT',/,
C' LS -L',80:X,/,
C' QUIT',80:X)
//*
This will produce
Code:
FTP.ABC.COM
FTP_USERID
FTP_PASS
PUT 'AAAAA.BBBBB.CCCCC' REMOTENAME_20091007.TXT
LS -L
QUIT
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum