<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: dcl substitution in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775149#M34101</link>
    <description>ocasio,&lt;BR /&gt;&lt;BR /&gt;the postings using single, double, and/or doubkle-single quotes in the forum display are VERY confusing.&lt;BR /&gt;They become MUCH clearer if you cut-and-paste them into some fixed-font editor, such as (being VMS :-) ) TPU or EDT. But *UX vi or even M$ notepad are also well suited.&lt;BR /&gt;&lt;BR /&gt;On building complex, multi-quoted lines, I usually get results easiest by either using a symbol where I want that character to appear, or by having one write with multiple concatenated strings.&lt;BR /&gt;Example of the latter"&lt;BR /&gt;$ WRITE LINE """" + "XYZ''some_symbol'" + """blablabla" + ....(etc)&lt;BR /&gt;&lt;BR /&gt;hth&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me (maybe in May in Nashua?)&lt;BR /&gt;&lt;BR /&gt;jpe&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;</description>
    <pubDate>Sat, 22 Apr 2006 03:49:53 GMT</pubDate>
    <dc:creator>Jan van den Ende</dc:creator>
    <dc:date>2006-04-22T03:49:53Z</dc:date>
    <item>
      <title>dcl substitution</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775141#M34093</link>
      <description>I have attempted using the quote counting method using the following:$ WRITE WRITELINE "(TO_DATE("'"''BEG_CUR_MON'"'", 'YYYYMMDD')) AND  "&lt;BR /&gt;$ WRITE WRITELINE "(TO_DATE("'"''END_CUR_MON'"'", 'YYYYMMDD'));"&lt;BR /&gt;&lt;BR /&gt;and it produces:&lt;BR /&gt;(TO_DATE(", 'YYYYMMDD')) AND  &lt;BR /&gt;(TO_DATE(", 'YYYYMMDD'));&lt;BR /&gt;&lt;BR /&gt;what I need it to write is out put like the following:&lt;BR /&gt;(TO_DATE('03/01/2006', 'MM/DD/YYYY')) AND &lt;BR /&gt;(TO_DATE('03/31/2006', 'MM/DD/YYYY'));&lt;BR /&gt;&lt;BR /&gt;I am uncertain as how to set up a sysmbol with ascii value - any advice would be greatly appreciated&lt;BR /&gt;&lt;BR /&gt;thanks in advance</description>
      <pubDate>Thu, 20 Apr 2006 15:02:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775141#M34093</guid>
      <dc:creator>ocasio</dc:creator>
      <dc:date>2006-04-20T15:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: dcl substitution</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775142#M34094</link>
      <description>F$FAO is your friend here ;-)&lt;BR /&gt;&lt;BR /&gt;$ dd=f$cvtime(,,"DAY")    ! day as a string&lt;BR /&gt;$ mm=f$cvtime(,,"MONTH")  ! month as a string&lt;BR /&gt;$ yyyy=f$cvtime(,,"YEAR") ! year as a string&lt;BR /&gt;$ WD=F$FAO("TO_DATE(''''!AS-!AS-!AS'''', MM/DD/YYYY)",mm,dd,yyyy)&lt;BR /&gt;$! The result&lt;BR /&gt;$ sho symb wd&lt;BR /&gt;  WD = "TO_DATE('04-20-2006', MM/DD/YYYY)"&lt;BR /&gt;&lt;BR /&gt;which can be used to create the string to write.</description>
      <pubDate>Thu, 20 Apr 2006 15:39:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775142#M34094</guid>
      <dc:creator>Willem Grooters</dc:creator>
      <dc:date>2006-04-20T15:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: dcl substitution</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775143#M34095</link>
      <description>Thanks so much - I'll look into trying that lexical; however, I'm not certain I will be able to use this because what I need to do is read a parameter file which contains the beginning &amp;amp; ending dates of the month along with federal fiscal year - each is stored as a symbol</description>
      <pubDate>Thu, 20 Apr 2006 16:00:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775143#M34095</guid>
      <dc:creator>ocasio</dc:creator>
      <dc:date>2006-04-20T16:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: dcl substitution</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775144#M34096</link>
      <description>on second thought I might be able to use F$EXTRACT and some how do it that way - I think I'll give it a whirl - thanks again - got to check out the f$fao first</description>
      <pubDate>Thu, 20 Apr 2006 16:03:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775144#M34096</guid>
      <dc:creator>ocasio</dc:creator>
      <dc:date>2006-04-20T16:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: dcl substitution</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775145#M34097</link>
      <description>Ocasio,&lt;BR /&gt;&lt;BR /&gt;to insert a ' character you may have to split the WRITE into several parts, see the attached example (I've attached an example in order to better distinguish between " and ''.&lt;BR /&gt;&lt;BR /&gt;regards alle</description>
      <pubDate>Fri, 21 Apr 2006 00:07:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775145#M34097</guid>
      <dc:creator>Karl Rohwedder</dc:creator>
      <dc:date>2006-04-21T00:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: dcl substitution</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775146#M34098</link>
      <description>How about this:&lt;BR /&gt;&lt;BR /&gt;$ WRITE WRITELINE "(TO_DATE(""''BEG_CUR_MON'"",""YYYYMMDD"")) AND "&lt;BR /&gt;$ WRITE WRITELINE "(TO_DATE(""''END_CUR_MON'"",""YYYYMMDD""));"&lt;BR /&gt;&lt;BR /&gt;There's a space between the "AND" and the double quote.  (Gotta love this stupid short textbox...)&lt;BR /&gt;&lt;BR /&gt;The double single quotes before and single single quote after cause symbol substitution within the WRITE command, and the double double quotes cause a single double quote to be written in the output.  (Got that? ;-)</description>
      <pubDate>Fri, 21 Apr 2006 08:16:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775146#M34098</guid>
      <dc:creator>Alan Bruns</dc:creator>
      <dc:date>2006-04-21T08:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: dcl substitution</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775147#M34099</link>
      <description>Great.  What displays in this font doesn't look like what I typed.  So we'll do it in text...&lt;BR /&gt;&lt;BR /&gt;This: "(TO_DATE(&lt;BR /&gt;is followed by two double quotes and two single quotes.&lt;BR /&gt;&lt;BR /&gt;BEG_CUR_MON&lt;BR /&gt;is followed by one single quote and two double quotes, a comma, and two double quotes.&lt;BR /&gt;&lt;BR /&gt;YYYYMMDD &lt;BR /&gt;is followed by two double quotes, two close parens, a space, the word AND, and a double quote.&lt;BR /&gt;&lt;BR /&gt;Follow the same pattern in the 2nd statement.</description>
      <pubDate>Fri, 21 Apr 2006 08:21:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775147#M34099</guid>
      <dc:creator>Alan Bruns</dc:creator>
      <dc:date>2006-04-21T08:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: dcl substitution</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775148#M34100</link>
      <description>Thanks for your attempt to assist - I don't know if our system differences would cause this but the output which I get is:&lt;BR /&gt; 23  TO_DATE(TO_CHAR(P.POST_DATE, 'YYYYMMDD'), 'YYYYMMDD') BETWEEN &lt;BR /&gt; 24  (TO_DATE("20060401","YYYYMMDD")) AND &lt;BR /&gt; 25  (TO_DATE("20060430","YYYYMMDD"));&lt;BR /&gt;(TO_DATE("20060430","YYYYMMDD"))&lt;BR /&gt;&lt;BR /&gt;I need single quotes and I've tried numerous combinations - yours was very close -and I very much appreciate your attempt to assist</description>
      <pubDate>Fri, 21 Apr 2006 14:36:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775148#M34100</guid>
      <dc:creator>ocasio</dc:creator>
      <dc:date>2006-04-21T14:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: dcl substitution</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775149#M34101</link>
      <description>ocasio,&lt;BR /&gt;&lt;BR /&gt;the postings using single, double, and/or doubkle-single quotes in the forum display are VERY confusing.&lt;BR /&gt;They become MUCH clearer if you cut-and-paste them into some fixed-font editor, such as (being VMS :-) ) TPU or EDT. But *UX vi or even M$ notepad are also well suited.&lt;BR /&gt;&lt;BR /&gt;On building complex, multi-quoted lines, I usually get results easiest by either using a symbol where I want that character to appear, or by having one write with multiple concatenated strings.&lt;BR /&gt;Example of the latter"&lt;BR /&gt;$ WRITE LINE """" + "XYZ''some_symbol'" + """blablabla" + ....(etc)&lt;BR /&gt;&lt;BR /&gt;hth&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me (maybe in May in Nashua?)&lt;BR /&gt;&lt;BR /&gt;jpe&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Sat, 22 Apr 2006 03:49:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775149#M34101</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2006-04-22T03:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: dcl substitution</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775150#M34102</link>
      <description>ocasio,&lt;BR /&gt;&lt;BR /&gt;Normally you can output a single quote by just writing a single quote. &lt;BR /&gt;Two adjacent single quotes are the intro for a string substitution request: ''var'&lt;BR /&gt;A third single quote finishes this sequence, whether the variable name was found or not or even absent.&lt;BR /&gt;&lt;BR /&gt;Your dcl gets specifically tricky because that simple simple single quote meant to be output, gets 'eaten' by the two single quotes leading in the variable name to be substituted. &lt;BR /&gt;I actually think there may be a bug in this space in DCL, but would recommend simply not going there for maintainability and readability reason. The solution then is to just concatenate the pieces of string with variables using either a + sign in an assignment statement. &lt;BR /&gt;In a write statement you can actually choose between + and , &lt;BR /&gt;They have the same effect, but work differently.&lt;BR /&gt;&lt;BR /&gt;As Karl suggests: &lt;BR /&gt;&lt;BR /&gt;$ WRITE WRITELINE "(TO_DATE('","''BEG_CUR_MON'","','DD/MM/YYYY'))"&lt;BR /&gt;&lt;BR /&gt;And that works, but is a still a little hard to read.&lt;BR /&gt;&lt;BR /&gt;May I suggest a construction like:&lt;BR /&gt;&lt;BR /&gt;write x "string", variable, "other string"&lt;BR /&gt;&lt;BR /&gt;In your example: &lt;BR /&gt;&lt;BR /&gt;$write WRITELINE " (TO_DATE('", BEG_CUR_MON, "', 'MM/DD/YYYY')) AND"&lt;BR /&gt;$write WRITELINE " (TO_DATE('", END_CUR_MON, "', 'MM/DD/YYYY'));"&lt;BR /&gt;&lt;BR /&gt;because you have commas in your strings I would suggest using the +&lt;BR /&gt;&lt;BR /&gt;$write WRITELINE " (TO_DATE('" + BEG_CUR_MON + "', 'MM/DD/YYYY')) AND"&lt;BR /&gt;$write WRITELINE " (TO_DATE('" + END_CUR_MON + "', 'MM/DD/YYYY'));"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Sat, 22 Apr 2006 17:03:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775150#M34102</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-04-22T17:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: dcl substitution</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775151#M34103</link>
      <description>$ WRITE WRITELINE "(TO_DATE('"+"''BEGIN_CUR_MON'','YYYYMMDD')) AND" &lt;BR /&gt;&lt;BR /&gt;will get you the first piece.&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;-john</description>
      <pubDate>Thu, 04 May 2006 10:49:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775151#M34103</guid>
      <dc:creator>John Yu_1</dc:creator>
      <dc:date>2006-05-04T10:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: dcl substitution</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775152#M34104</link>
      <description>Sorry, the code gets butchered by the site</description>
      <pubDate>Thu, 04 May 2006 10:52:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775152#M34104</guid>
      <dc:creator>John Yu_1</dc:creator>
      <dc:date>2006-05-04T10:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: dcl substitution</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775153#M34105</link>
      <description>I see this this is an old thread, but if the OP is still looking for a solution, here's one that I use: &lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;&lt;BR /&gt;$!&lt;BR /&gt;$!  This is a sample command procedure which&lt;BR /&gt;$!  demonstrates how to include single and double&lt;BR /&gt;$!  quotes into a string&lt;BR /&gt;$!&lt;BR /&gt;$ single_quote :== "'&lt;BR /&gt;$ double_quote :== """&lt;BR /&gt;$ write sys$output single_quote&lt;BR /&gt;$ write sys$output double_quote&lt;BR /&gt;$ write sys$output "this string has a single quote (",single_quote,") and double quote (", double_quote,") in it"&lt;BR /&gt;$ new_sym = "this new string has a single quote (" + single_quote + ") "&lt;BR /&gt;$ new_sym = new_sym + "and double quote (" + double_quote + ") in it also."&lt;BR /&gt;$ write sys$output new_sym&lt;BR /&gt;&lt;BR /&gt;The sample procedure is also attached.&lt;BR /&gt;&lt;BR /&gt;Ken</description>
      <pubDate>Fri, 05 May 2006 08:36:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775153#M34105</guid>
      <dc:creator>Ken Robinson</dc:creator>
      <dc:date>2006-05-05T08:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: dcl substitution</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775154#M34106</link>
      <description>Ayup, that's what I use also when it gets too confusing. &lt;BR /&gt;'xcept that I use the symbols "q" and "qq" :-).&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Fri, 05 May 2006 18:05:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-substitution/m-p/3775154#M34106</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-05-05T18:05:13Z</dc:date>
    </item>
  </channel>
</rss>

