<?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 in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/5060016#M24535</link>
    <description>Sentosa,&lt;BR /&gt;&lt;BR /&gt;On a sequential file you can use a similar aproach as Hein give you for an indexed file:&lt;BR /&gt;&lt;BR /&gt;$open/read/write file name.ext&lt;BR /&gt;$loop:&lt;BR /&gt;$read file record /end=end&lt;BR /&gt;$if ... (put some test for which record should b updated)&lt;BR /&gt;$then&lt;BR /&gt;$ write sys$output "old text: ", f$ext(20,10,record)&lt;BR /&gt;$ write sys$output "old binary: ", f$cvsi(30*8,32,record)&lt;BR /&gt;$ record[20,10] := "new text value"&lt;BR /&gt;$ record[30*8,32] = 12345 ! New binary value&lt;BR /&gt;$ write/update/symbol file record&lt;BR /&gt;$endif&lt;BR /&gt;$goto loop&lt;BR /&gt;$end:&lt;BR /&gt;$close file&lt;BR /&gt;&lt;BR /&gt;The length of the new record must remain the same as the old record for all sequential files!&lt;BR /&gt;&lt;BR /&gt;Bojan</description>
    <pubDate>Thu, 26 Jul 2007 04:23:22 GMT</pubDate>
    <dc:creator>Bojan Nemec</dc:creator>
    <dc:date>2007-07-26T04:23:22Z</dc:date>
    <item>
      <title>DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/5060011#M24530</link>
      <description>Dear ALL,&lt;BR /&gt;&lt;BR /&gt;I want to open a file &amp;amp; retreive the desired record. Then, i will update the particular field into the same record &amp;amp; write back to the file.&lt;BR /&gt;&lt;BR /&gt;Could anyone provide the DCL example to me how to update the particular field into the same record &amp;amp; write back to the file?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Sentosa</description>
      <pubDate>Thu, 26 Jul 2007 01:20:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/5060011#M24530</guid>
      <dc:creator>Sentosa</dc:creator>
      <dc:date>2007-07-26T01:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/5060012#M24531</link>
      <description>&lt;BR /&gt;For an RMS indexed file using DCL as language it could look like (untested):&lt;BR /&gt;&lt;BR /&gt;$key="xyz"&lt;BR /&gt;$open/read/write file name.ext&lt;BR /&gt;$read/key=&amp;amp;key file record&lt;BR /&gt;$write sys$output "old text: ", f$ext(20,10,record)&lt;BR /&gt;$write sys$output "old binary: ", f$cvsi(30*8,32,record)&lt;BR /&gt;$record[20,10] := "new text value"&lt;BR /&gt;$record[30*8,32] = 12345 ! New binary value&lt;BR /&gt;$write/update/symbol file record&lt;BR /&gt;$close close&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;Hein van den Heuvel</description>
      <pubDate>Thu, 26 Jul 2007 01:31:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/5060012#M24531</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-07-26T01:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/5060013#M24532</link>
      <description>Dear ALL,&lt;BR /&gt;&lt;BR /&gt;Sorry for missing some information.&lt;BR /&gt;the source &amp;amp; target file is normal text file in OpenVMS.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Sentosa</description>
      <pubDate>Thu, 26 Jul 2007 02:35:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/5060013#M24532</guid>
      <dc:creator>Sentosa</dc:creator>
      <dc:date>2007-07-26T02:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/5060014#M24533</link>
      <description>Sentosa,&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;the source &amp;amp; target file is normal text file in OpenVMS.&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;You will have to use some tool then.&lt;BR /&gt;You want to replace any occurrence of &lt;OLDSTRING&gt; with &lt;NEWSTRIN&gt;  &amp;gt;&lt;BR /&gt;&lt;BR /&gt;$ create modify.edt&lt;BR /&gt;s?&lt;OLDSTRING&gt;?&lt;NEWSTRING&gt;?wh&lt;BR /&gt;exit &lt;TARGETFILE&gt;&lt;BR /&gt;$&lt;BR /&gt;$ edit/edt &lt;SOURCEFILE&gt; /command=modify.edt&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;- oldstring or newstring contains a questionmark  "?", then replace "?" in the EDT file with another character, eg "/" or "#"&lt;BR /&gt;- if you only need to replace 1 occurrence, leace out the "wh" ( = whole ) in the s ( = substitute ) command&lt;BR /&gt;- if targetfile is just a higher version of sourcefile, leave out the filename on the exit command.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Far, and far more is possible, but you will need the manual for that.&lt;BR /&gt;&lt;BR /&gt;---  EDT is one possibility, there are many more.&lt;BR /&gt;EDT has the advantage to be available on ANY VMS system, without any extra software, I have used it since VMS V3.&lt;BR /&gt;&lt;BR /&gt;hth&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe&lt;/SOURCEFILE&gt;&lt;/TARGETFILE&gt;&lt;/NEWSTRING&gt;&lt;/OLDSTRING&gt;&lt;/NEWSTRIN&gt;&lt;/OLDSTRING&gt;</description>
      <pubDate>Thu, 26 Jul 2007 02:48:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/5060014#M24533</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2007-07-26T02:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/5060015#M24534</link>
      <description>Thanks for your information.&lt;BR /&gt;&lt;BR /&gt;Actually, i need to do the (update) action in batch mode using DCL for handling different suitation. So, edit mode is not suitable for me.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Sentosa</description>
      <pubDate>Thu, 26 Jul 2007 03:10:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/5060015#M24534</guid>
      <dc:creator>Sentosa</dc:creator>
      <dc:date>2007-07-26T03:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/5060016#M24535</link>
      <description>Sentosa,&lt;BR /&gt;&lt;BR /&gt;On a sequential file you can use a similar aproach as Hein give you for an indexed file:&lt;BR /&gt;&lt;BR /&gt;$open/read/write file name.ext&lt;BR /&gt;$loop:&lt;BR /&gt;$read file record /end=end&lt;BR /&gt;$if ... (put some test for which record should b updated)&lt;BR /&gt;$then&lt;BR /&gt;$ write sys$output "old text: ", f$ext(20,10,record)&lt;BR /&gt;$ write sys$output "old binary: ", f$cvsi(30*8,32,record)&lt;BR /&gt;$ record[20,10] := "new text value"&lt;BR /&gt;$ record[30*8,32] = 12345 ! New binary value&lt;BR /&gt;$ write/update/symbol file record&lt;BR /&gt;$endif&lt;BR /&gt;$goto loop&lt;BR /&gt;$end:&lt;BR /&gt;$close file&lt;BR /&gt;&lt;BR /&gt;The length of the new record must remain the same as the old record for all sequential files!&lt;BR /&gt;&lt;BR /&gt;Bojan</description>
      <pubDate>Thu, 26 Jul 2007 04:23:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/5060016#M24535</guid>
      <dc:creator>Bojan Nemec</dc:creator>
      <dc:date>2007-07-26T04:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/5060017#M24536</link>
      <description>Sentosa,&lt;BR /&gt;&lt;BR /&gt;There are many choices for doing the change in batch.&lt;BR /&gt;&lt;BR /&gt;If you wish to stay with using DCL, you can manipulate the record using the F$LOCATE, cut out the unchanging portions of the string using F$EXTRACT, and then use the "+" (which on strings does concatenation; or simple substitution) to put the pieces of the new record together again. I have used both approaches, depending on the context, to wit:&lt;BR /&gt;&lt;BR /&gt;  $! Extract Item Field and change it.&lt;BR /&gt;  $  FRONTRECORD = F$EXTRACT(0, 20, RECORD)&lt;BR /&gt;  $  BACKRECORD = F$EXTRACT(30, F$LENGTH(RECORD)-30, RECORD)&lt;BR /&gt;  $ ITEM = F$EXTRACT(20, 10, RECORD)&lt;BR /&gt;  $ IF ITEM .EQS. "C-09876543"&lt;BR /&gt;  $    THEN&lt;BR /&gt;   .....&lt;BR /&gt;  $    ITEM = "D-12345678"&lt;BR /&gt;  $    ENDIF&lt;BR /&gt;  $!&lt;BR /&gt;  $ RECORD = FRONTRECORD + ITEM + BACKRECORD&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The above code snippet is for illustrative purposes, I sanitized it and had to retype it from an exemplar (Please type it into a test case and experiment with it before using).&lt;BR /&gt;&lt;BR /&gt;For masses of records, there are also the SLP TPU and TECO editors which can be used for batch processing.&lt;BR /&gt;&lt;BR /&gt;All of the functions and editors are documented in the help text and documentation set. The DCL lexical functions are documented under "Lexical functions".&lt;BR /&gt;&lt;BR /&gt;I hope that the above is helpful.&lt;BR /&gt;&lt;BR /&gt;- Bob Gezelter, &lt;A href="http://www.rlgsc.com" target="_blank"&gt;http://www.rlgsc.com&lt;/A&gt;</description>
      <pubDate>Thu, 26 Jul 2007 04:23:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/5060017#M24536</guid>
      <dc:creator>Robert Gezelter</dc:creator>
      <dc:date>2007-07-26T04:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: DCL</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/5060018#M24537</link>
      <description>Thanks</description>
      <pubDate>Thu, 26 Jul 2007 05:11:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl/m-p/5060018#M24537</guid>
      <dc:creator>Sentosa</dc:creator>
      <dc:date>2007-07-26T05:11:38Z</dc:date>
    </item>
  </channel>
</rss>

