1753643 Members
5325 Online
108798 Solutions
New Discussion юеВ

Re: dcl substitution

 
John Yu_1
Valued Contributor

Re: dcl substitution

$ WRITE WRITELINE "(TO_DATE('"+"''BEGIN_CUR_MON'','YYYYMMDD')) AND"

will get you the first piece.

Hope this helps
-john
Artificial intelligence is rarely a match for natural stupidity.
John Yu_1
Valued Contributor

Re: dcl substitution

Sorry, the code gets butchered by the site
Artificial intelligence is rarely a match for natural stupidity.
Ken Robinson
Valued Contributor

Re: dcl substitution

I see this this is an old thread, but if the OP is still looking for a solution, here's one that I use:

Define two symbols, one for a single quote and one for a double quote, then use those when needed, instead of trying to figure out the right number of single or double quotes needed to produce on one the output.

Example:

$!
$! This is a sample command procedure which
$! demonstrates how to include single and double
$! quotes into a string
$!
$ single_quote :== "'
$ double_quote :== """
$ write sys$output single_quote
$ write sys$output double_quote
$ write sys$output "this string has a single quote (",single_quote,") and double quote (", double_quote,") in it"
$ new_sym = "this new string has a single quote (" + single_quote + ") "
$ new_sym = new_sym + "and double quote (" + double_quote + ") in it also."
$ write sys$output new_sym

The sample procedure is also attached.

Ken
Hein van den Heuvel
Honored Contributor

Re: dcl substitution

Ayup, that's what I use also when it gets too confusing.
'xcept that I use the symbols "q" and "qq" :-).

Hein.