1819769 Members
3334 Online
109606 Solutions
New Discussion юеВ

Re: substittution

 
SOLVED
Go to solution
ocasio
Occasional Contributor

substittution

I am attempting to write a DCL procedure which will create a sql script (we are on an pen vms system) I need to be able to produce a single quote next the variable which is being substituted. does anyone know how to due this? I need to have like:
$ WRITE WRITELINE "(TO_DATE("''END_CUR_MON''", 'YYYYMMDD'));"
3 REPLIES 3
Jan van den Ende
Honored Contributor
Solution

Re: substittution

ocasio,

First:

Welcome to the VMS forum!

Your question:

two ways of doing this:
1. VERY carefully count your single and double quotes. A lone single quote between double quotes DOES go on as itself.
2 (more controlled, better readable, and also allows for two consecutive single quotes:
Set up a symbol (eg QUOTE) with the ASCI value of a single quote (I do have not got it handy right now) and trigger symbol substitution each time need the single quote

hth

Proost.

Have one on me (maybe in May in Nashua?)

jpe
Don't rust yours pelled jacker to fine doll missed aches.
ocasio
Occasional Contributor

Re: substittution

Thanks so very much! I had been expiermenting and decided to go online because I was sure someone else had ran into this b4.

Yes, I'll have one and toast to you! (unfortunately won't be able to do it in Nassau
Robert Atkinson
Respected Contributor

Re: substittution

You can also embed quotes inside quotes by specifying 3 double quotes :-

$ WRITE SYS$OUTPUT "This """word""" has quotes around it"
This "WORD" has quotes around it

Rob.