<?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: Batch Job in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412606#M4094</link>
    <description>&amp;gt;&amp;gt;&amp;gt; I don't think Antonio wanted to correct me - it was rather a hint if H P needs to create an SQL command with two consecutive "'"s. &lt;BR /&gt;&lt;BR /&gt;Ditto. And a good reminder/hint it is.&lt;BR /&gt;It is not easy to get dcl to write out two single quote with nothing in between. One is free. Two is hard.&lt;BR /&gt;You basically have to build the target string with concatenations or multiple arguments.&lt;BR /&gt;&lt;BR /&gt;$  write sys$output "insert into ... values ('A','"+"');"&lt;BR /&gt;---&amp;gt;&lt;BR /&gt;insert into ... values ('A','');&lt;BR /&gt;&lt;BR /&gt;Sometimes I use a 'QQ' symbol to help:&lt;BR /&gt;&lt;BR /&gt;$ qq= "'"+"'"&lt;BR /&gt;$  write sys$output "insert into ... values ('A',",qq,")"&lt;BR /&gt;---&amp;gt;&lt;BR /&gt;insert into ... values ('A','')&lt;BR /&gt;&lt;BR /&gt;two more hints:&lt;BR /&gt;- Sometimes you need a "&amp;amp;" when working with quotes in symbols in order to 'postpone' substitution.&lt;BR /&gt;&lt;BR /&gt;- Instead of generating SQl commands you may want to look in generating data, and using a dataloader tools instead of sql. By writing out the real data you'll drop one level of quoting quotes&lt;BR /&gt;&lt;BR /&gt;fwiw,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 03 Nov 2004 10:53:42 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2004-11-03T10:53:42Z</dc:date>
    <item>
      <title>Batch Job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412596#M4084</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;Can you help regarding this batch job to go tp sql and then check/add entries.&lt;BR /&gt;The output is as below&lt;BR /&gt;&lt;BR /&gt;$set on                      &lt;BR /&gt;$set verify                  &lt;BR /&gt;$sql                         &lt;BR /&gt;$attach 'filename vms_live; &lt;BR /&gt;%SYSTEM-W-NONEXPR, nonexistent process&lt;BR /&gt;$set trans read only;        &lt;BR /&gt;%DCL-W-IVKEYW, unrecognized keyword - check validity and spelling&lt;BR /&gt; \TRANS\&lt;BR /&gt;&lt;BR /&gt;Thanx &amp;amp; Regards</description>
      <pubDate>Tue, 02 Nov 2004 05:51:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412596#M4084</guid>
      <dc:creator>Himanshu_3</dc:creator>
      <dc:date>2004-11-02T05:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412597#M4085</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Not sure what command "sql" translates to, but on our RDB VMS machines at work, SQL is  invoked by the command, "MCR SQL$" (note the trailing dollar sign).&lt;BR /&gt;&lt;BR /&gt;If you are going to contain SQL statements in a batch job, (attach and set trans) thos lines of code should _not_ contain leading "$", as the DCL interpreter may get confused.&lt;BR /&gt;&lt;BR /&gt;--Brad</description>
      <pubDate>Tue, 02 Nov 2004 06:21:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412597#M4085</guid>
      <dc:creator>Bradford Hamilton_1</dc:creator>
      <dc:date>2004-11-02T06:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412598#M4086</link>
      <description>Hi HP,&lt;BR /&gt;&lt;BR /&gt;I dont understand quite well what is your problem. But looking to yours output seems you want to run SQL and then give it some commands.&lt;BR /&gt;The wrong thing seems to be the $ at the beginning of $attach 'filename vms_live; and $set trans read only;. The procedure must be something like this:&lt;BR /&gt;&lt;BR /&gt;$set on&lt;BR /&gt;$set verify&lt;BR /&gt;$sql&lt;BR /&gt;attach 'filename vms_live;&lt;BR /&gt;set trans read only;&lt;BR /&gt;&lt;BR /&gt;without starting $.&lt;BR /&gt;&lt;BR /&gt;Bojan</description>
      <pubDate>Tue, 02 Nov 2004 06:23:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412598#M4086</guid>
      <dc:creator>Bojan Nemec</dc:creator>
      <dc:date>2004-11-02T06:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412599#M4087</link>
      <description>you may also be missing a ending quote before the ;</description>
      <pubDate>Tue, 02 Nov 2004 06:51:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412599#M4087</guid>
      <dc:creator>Ian Miller.</dc:creator>
      <dc:date>2004-11-02T06:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412600#M4088</link>
      <description>Now the second part,&lt;BR /&gt;&lt;BR /&gt;How can I pass the parameters of VMS system into SQL ?&lt;BR /&gt;&lt;BR /&gt;Example:If I want to pass the value of F$time() into sql &lt;BR /&gt;&lt;BR /&gt;Script is......&lt;BR /&gt;&lt;BR /&gt;$set noon                      &lt;BR /&gt;$set noverify                  &lt;BR /&gt;$sql                         &lt;BR /&gt;attach 'filename vms_live'; &lt;BR /&gt;set trans read write;        &lt;BR /&gt;set out callinglog.txt;                                      &lt;BR /&gt;insert into ping_dtl values (                                 &lt;BR /&gt;1,'22-OCT-2004 00:00:00.00', 'U', 'CLC_DFN',                 &lt;BR /&gt;'1,CLC_IDN,dC9281','Y','D', 'D', 'D', 'D', 'D', 'Y', 1);   &lt;BR /&gt;&lt;BR /&gt;Here I want to pass the parameters of current system time of lexical f$time() in place of '22-OCT-2004 00:00:00' .&lt;BR /&gt;&lt;BR /&gt;How can that be done .&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;HP&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 02 Nov 2004 10:22:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412600#M4088</guid>
      <dc:creator>Himanshu_3</dc:creator>
      <dc:date>2004-11-02T10:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412601#M4089</link>
      <description>Unfortunately you can't do that directly - you have to write the input for SQL to an intermediate file (input.tmp in this example).&lt;BR /&gt;&lt;BR /&gt;$ open/write O input.tmp&lt;BR /&gt;$ write O "attach 'filename vms_live';"&lt;BR /&gt;...&lt;BR /&gt;$ write O "insert into ping_dtl values (1,'", F$TIME(), "', 'U',...&lt;BR /&gt;$ close O&lt;BR /&gt;&lt;BR /&gt;then, run the whole thing:&lt;BR /&gt;&lt;BR /&gt;$ set noon&lt;BR /&gt;$ set verify&lt;BR /&gt;$ define /user_mode SYS$INPUT input.tmp&lt;BR /&gt;$ sql&lt;BR /&gt;$</description>
      <pubDate>Tue, 02 Nov 2004 10:29:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412601#M4089</guid>
      <dc:creator>Uwe Zessin</dc:creator>
      <dc:date>2004-11-02T10:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412602#M4090</link>
      <description>HP, you may also be interested in this thread&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=726103" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=726103&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 02 Nov 2004 11:06:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412602#M4090</guid>
      <dc:creator>Ian Miller.</dc:creator>
      <dc:date>2004-11-02T11:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412603#M4091</link>
      <description>Adding more info to Uwe's post,&lt;BR /&gt;remember you cannot use twice single quote in your string because this means symbol translation.&lt;BR /&gt;For example this sql statement&lt;BR /&gt;insert into ... values ('A','');&lt;BR /&gt;cannot be written into&lt;BR /&gt;$ write o "insert into ... values ('A','');"&lt;BR /&gt;You must create a new symbol and use it&lt;BR /&gt;$ Q="'"&lt;BR /&gt;$ write o &lt;BR /&gt;"insert into ... values('A',",Q,Q,");"&lt;BR /&gt;&lt;BR /&gt;Antonio Vigliotti&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Nov 2004 02:36:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412603#M4091</guid>
      <dc:creator>Antoniov.</dc:creator>
      <dc:date>2004-11-03T02:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412604#M4092</link>
      <description>Antonio,&lt;BR /&gt;&lt;BR /&gt;where in the given example of the question did you find any sequence of two single quotes?&lt;BR /&gt;To my eyes, and as far as I remember SQL syntax, the single quote after a value is followed by a comma, before the single quote of the next value.&lt;BR /&gt;So, no problem there! (although, IF the issue should come to happen, then of course your solution is of course the way to go).&lt;BR /&gt;But as far as a sequence of values in an SQL statements is concerned, no need to make it any more complicated then needed.&lt;BR /&gt;&lt;BR /&gt;fwiw,&lt;BR /&gt;&lt;BR /&gt;Cheers.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;Jan&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Nov 2004 09:19:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412604#M4092</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2004-11-03T09:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412605#M4093</link>
      <description>I don't think Antonio wanted to correct me - it was rather a hint if H P needs to create an SQL command with two consecutive "'"s.</description>
      <pubDate>Wed, 03 Nov 2004 09:35:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412605#M4093</guid>
      <dc:creator>Uwe Zessin</dc:creator>
      <dc:date>2004-11-03T09:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412606#M4094</link>
      <description>&amp;gt;&amp;gt;&amp;gt; I don't think Antonio wanted to correct me - it was rather a hint if H P needs to create an SQL command with two consecutive "'"s. &lt;BR /&gt;&lt;BR /&gt;Ditto. And a good reminder/hint it is.&lt;BR /&gt;It is not easy to get dcl to write out two single quote with nothing in between. One is free. Two is hard.&lt;BR /&gt;You basically have to build the target string with concatenations or multiple arguments.&lt;BR /&gt;&lt;BR /&gt;$  write sys$output "insert into ... values ('A','"+"');"&lt;BR /&gt;---&amp;gt;&lt;BR /&gt;insert into ... values ('A','');&lt;BR /&gt;&lt;BR /&gt;Sometimes I use a 'QQ' symbol to help:&lt;BR /&gt;&lt;BR /&gt;$ qq= "'"+"'"&lt;BR /&gt;$  write sys$output "insert into ... values ('A',",qq,")"&lt;BR /&gt;---&amp;gt;&lt;BR /&gt;insert into ... values ('A','')&lt;BR /&gt;&lt;BR /&gt;two more hints:&lt;BR /&gt;- Sometimes you need a "&amp;amp;" when working with quotes in symbols in order to 'postpone' substitution.&lt;BR /&gt;&lt;BR /&gt;- Instead of generating SQl commands you may want to look in generating data, and using a dataloader tools instead of sql. By writing out the real data you'll drop one level of quoting quotes&lt;BR /&gt;&lt;BR /&gt;fwiw,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Nov 2004 10:53:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412606#M4094</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-11-03T10:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412607#M4095</link>
      <description>Jan,&lt;BR /&gt;my post is hard to read simply because it's not possible distinguish two single quote by double quote (may be this character font).&lt;BR /&gt;Two single quote, in SQL means a empty string and it's used to write an empty not null value.&lt;BR /&gt;Hein posted another interesting solution :-)&lt;BR /&gt; &lt;BR /&gt;Antonio Vigliotti&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Nov 2004 02:43:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412607#M4095</guid>
      <dc:creator>Antoniov.</dc:creator>
      <dc:date>2004-11-04T02:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412608#M4096</link>
      <description>Antonio,&lt;BR /&gt;&lt;BR /&gt;You're right.&lt;BR /&gt;I totally forgot about empty string.&lt;BR /&gt;Guess it was just a bit too late when I wrote the previous entry  :-(&lt;BR /&gt;&lt;BR /&gt;Cheers.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe</description>
      <pubDate>Thu, 04 Nov 2004 03:09:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-job/m-p/3412608#M4096</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2004-11-04T03:09:45Z</dc:date>
    </item>
  </channel>
</rss>

