<?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 How to use the below CROSS statement in a FOR loop in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/how-to-use-the-below-cross-statement-in-a-for-loop/m-p/4109550#M38862</link>
    <description>We cross two files A and B over X(a common field) with TRADE(a field in A) and STATUS(a field in B).From the result,i need to delete the records in A that matches with B.&lt;BR /&gt;READY A WRITE&lt;BR /&gt;READY B SHARED&lt;BR /&gt;FIND ALL A CROSS B OVER X WITH TRADE STARTING WITH "FR" AND STATUS="OK"&lt;BR /&gt;ERASE ALL&lt;BR /&gt;How can the above code be written in a FOR loop,so that i can erase the required records?</description>
    <pubDate>Thu, 29 Nov 2007 07:59:19 GMT</pubDate>
    <dc:creator>panneer</dc:creator>
    <dc:date>2007-11-29T07:59:19Z</dc:date>
    <item>
      <title>How to use the below CROSS statement in a FOR loop</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-use-the-below-cross-statement-in-a-for-loop/m-p/4109550#M38862</link>
      <description>We cross two files A and B over X(a common field) with TRADE(a field in A) and STATUS(a field in B).From the result,i need to delete the records in A that matches with B.&lt;BR /&gt;READY A WRITE&lt;BR /&gt;READY B SHARED&lt;BR /&gt;FIND ALL A CROSS B OVER X WITH TRADE STARTING WITH "FR" AND STATUS="OK"&lt;BR /&gt;ERASE ALL&lt;BR /&gt;How can the above code be written in a FOR loop,so that i can erase the required records?</description>
      <pubDate>Thu, 29 Nov 2007 07:59:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-use-the-below-cross-statement-in-a-for-loop/m-p/4109550#M38862</guid>
      <dc:creator>panneer</dc:creator>
      <dc:date>2007-11-29T07:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the below CROSS statement in a FOR loop</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-use-the-below-cross-statement-in-a-for-loop/m-p/4109551#M38863</link>
      <description>DATATRIEVE?  Been a few years since I've coded in that.  Good choice for ad-hoc queries, for its time.  (InstantSQL (if you can find it; officially ISQL is long gone) was better for ad-hoc tasks, but I digress.)&lt;BR /&gt;&lt;BR /&gt;The DATATRIEVE documentation is available here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://h30266.www3.hp.com/odl/i64lp/databases/dtr073/datrieve.htm" target="_blank"&gt;http://h30266.www3.hp.com/odl/i64lp/databases/dtr073/datrieve.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If you're programming in DATATRIEVE (as it appears here), the reference materials, as well as available programming examples and such are available there.&lt;BR /&gt;&lt;BR /&gt;As for your request, I'd not expect that to work: "Do not use a FIND statement in a compound statement, such as a BEGIN-END, FOR, REPEAT, or THEN statement. (To establish single record context in compound statements, use the RSE clauses of FOR, PRINT, or MODIFY statements. These RSEs can establish the record streams needed to control the name recognition and single record context inside compound statements.)"&lt;BR /&gt;&lt;BR /&gt;ERASE ALL removes the entirety of the current collection.  &lt;BR /&gt;&lt;BR /&gt;FIND establishes a collection.  &lt;BR /&gt;&lt;BR /&gt;Without running some tests, I'm not sure what might happen here, nor what you're specifically seeking to have happen.  (I usually confirm DATATRIEVE syntax on a test copy of the database.)&lt;BR /&gt;&lt;BR /&gt;Again, I'd suggest starting with a test database and with the manuals and with Yachts and other examples -- and you should get to where you need to be.&lt;BR /&gt;&lt;BR /&gt;Stephen Hoffman&lt;BR /&gt;HoffmanLabs LLC&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Nov 2007 09:01:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-use-the-below-cross-statement-in-a-for-loop/m-p/4109551#M38863</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2007-11-29T09:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the below CROSS statement in a FOR loop</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-use-the-below-cross-statement-in-a-for-loop/m-p/4109552#M38864</link>
      <description>I think you want something like:&lt;BR /&gt;&lt;BR /&gt;FOR ok_b IN B WITH STATUS = "OK" PRINT ALL A &lt;BR /&gt;WITH x = ok_b.x AND TRADE STARTING WITH "FR";&lt;BR /&gt;&lt;BR /&gt;If you like the result, then replace the PRINT with ERASE&lt;BR /&gt;&lt;BR /&gt;The problem might be the scale of the number of records.&lt;BR /&gt;&lt;BR /&gt;If B has millions of records with "OK" &lt;BR /&gt;and A has just a few records with trade starting with FR then the above is sub-optimal.&lt;BR /&gt;&lt;BR /&gt;But for now... let's see if this handles the problem.&lt;BR /&gt;&lt;BR /&gt;Hein&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 30 Nov 2007 04:44:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-use-the-below-cross-statement-in-a-for-loop/m-p/4109552#M38864</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-11-30T04:44:56Z</dc:date>
    </item>
  </channel>
</rss>

