<?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: Need help on datatrieve in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/need-help-on-datatrieve/m-p/4531787#M43147</link>
    <description>Sounds good.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; FIND IM WITH IDE=70 OR IDE=82 &lt;BR /&gt;&amp;gt;&amp;gt; FIND CURRENT CROSS IN OVER ITM&lt;BR /&gt;&amp;gt;&amp;gt; PRINT CURRENT ON EXPIRY_REC.DAT&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;And that's just fine for modest data volume like 10,000 records or so.&lt;BR /&gt;&lt;BR /&gt;You should be able to do this all in one command:&lt;BR /&gt;&lt;BR /&gt;PRINT IM CROSS IN OVER ITM WITH IDE=70 OR IDE=82 ON EXPIRY_REC.DAT&lt;BR /&gt;&lt;BR /&gt;Collections like 'CURRENT' are convenients, but slow down the results when processing large amounts of records (50,000+ ?).&lt;BR /&gt;They make Datatrieve re-read data.&lt;BR /&gt;&lt;BR /&gt;Hein&lt;BR /&gt;</description>
    <pubDate>Tue, 17 Nov 2009 16:47:29 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2009-11-17T16:47:29Z</dc:date>
    <item>
      <title>Need help on datatrieve</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/need-help-on-datatrieve/m-p/4531778#M43138</link>
      <description>I am just beginner in datatrieve. I am pretty much comfortable with writing records to retrieve data from DAT files. Now i need to combine few fields from 2 different DAT files and need to create new record. I wrote sample procedure and i am getting error which i explained in attached file with sample procedure. Like we define domain for records, do we need to do anything for procedures?&lt;BR /&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Vdya</description>
      <pubDate>Wed, 11 Nov 2009 12:43:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/need-help-on-datatrieve/m-p/4531778#M43138</guid>
      <dc:creator>vdya</dc:creator>
      <dc:date>2009-11-11T12:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on datatrieve</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/need-help-on-datatrieve/m-p/4531779#M43139</link>
      <description>You can DEFINE only once.&lt;BR /&gt;After that you need to REdefine.&lt;BR /&gt;Typically you get that automatically by using the EDIT command.&lt;BR /&gt;&lt;BR /&gt;Check out DTR&amp;gt; help command REDEFINE_Command&lt;BR /&gt;&lt;BR /&gt;The line "DEFINE PROCEDURE" ended up in the procedure.. remove it.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Free advice:&lt;BR /&gt;&lt;BR /&gt;1) A name like SAMPLE or TEST is prone to be duplicate and confusing. &lt;BR /&gt;Consider names like SAMPLE_PROC and SAMPLE_REC&lt;BR /&gt;Admittedly that is redundant data.. but it helps keeping sane.&lt;BR /&gt;&lt;BR /&gt;2) As you are learning Datatriece try to avoid FIND as soon as possible. Go for (nested) FOR loops if and when you can.&lt;BR /&gt;&lt;BR /&gt;FOR IMC CROSS INC OVER ITM WITH IDE ...&lt;BR /&gt;&lt;BR /&gt;Or stick the whole lot in the print statement.&lt;BR /&gt;Check: DTR&amp;gt; help command cross example&lt;BR /&gt;&lt;BR /&gt;3) If you have further questions, condsider whether you can express them in a YACHTS and OWNERS example. By doing so, we will understand you better and may be able to coble up working examples.&lt;BR /&gt;&lt;BR /&gt;4) When working with RMS INDEXED files, Start datatrieve with $ DATA /DEBUG&lt;BR /&gt;By doing so DTR will nicely tell you whether it is using an RMS INDEX.&lt;BR /&gt;&lt;BR /&gt;5) Enjoy! DTR is a fine tool. It was years ahead of its time at its time. Which made is miss the SQL boat.&lt;BR /&gt;&lt;BR /&gt;Good luck!&lt;BR /&gt;Hein&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Nov 2009 14:41:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/need-help-on-datatrieve/m-p/4531779#M43139</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-11-11T14:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on datatrieve</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/need-help-on-datatrieve/m-p/4531780#M43140</link>
      <description>Ok am a bit confused.  Your result of SH SAMPLE should not show the DEFINE it should just show the contents of the procedure. &lt;BR /&gt;&lt;BR /&gt;There is nothing "special" you need to do for procedures when using multiple domains.&lt;BR /&gt;&lt;BR /&gt;When you defined SAMPLE did you get the DFN&amp;gt; prompts?&lt;BR /&gt;&lt;BR /&gt;Can you EDIT SAMPLE?  If so what happens.</description>
      <pubDate>Wed, 11 Nov 2009 14:53:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/need-help-on-datatrieve/m-p/4531780#M43140</guid>
      <dc:creator>Bill Pedersen</dc:creator>
      <dc:date>2009-11-11T14:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on datatrieve</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/need-help-on-datatrieve/m-p/4531781#M43141</link>
      <description>Thanks alot Hein &amp;amp; Bill.&lt;BR /&gt;&lt;BR /&gt;Now its working fine after redefine.&lt;BR /&gt;My procedure name is expiry_date_rec.dtr When i execute procedure first time its creating file called expiry_date_prc.dtr.&lt;BR /&gt;Later its giving expected output.&lt;BR /&gt;&lt;BR /&gt;I have 2 records for example yacht_rec and owner_rec and domains defined for these records are yacht and owner respectively. Also RMS files are yachts.dat and owners.dat.&lt;BR /&gt;&lt;BR /&gt;Now i have filtered few fields from both records and combining those records using procedure(using cross and over keywords) owner_info.&lt;BR /&gt;&lt;BR /&gt;Now i want to write/store output in new DAT file. For records we can define file using domain name as below &lt;BR /&gt;&lt;BR /&gt;DTR&amp;gt;define file for yacht&lt;BR /&gt;DTR&amp;gt;ready yacht write&lt;BR /&gt;I hope its correct and will overwrite exisiting dat file.&lt;BR /&gt;But how to create dat file and and write output for procedures?&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Vidya&lt;BR /&gt;</description>
      <pubDate>Thu, 12 Nov 2009 10:47:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/need-help-on-datatrieve/m-p/4531781#M43141</guid>
      <dc:creator>vdya</dc:creator>
      <dc:date>2009-11-12T10:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on datatrieve</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/need-help-on-datatrieve/m-p/4531782#M43142</link>
      <description>Is there any way to create new DAT file to write output from procedure when we collect record from 2 different DAT files?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Vidya</description>
      <pubDate>Mon, 16 Nov 2009 06:18:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/need-help-on-datatrieve/m-p/4531782#M43142</guid>
      <dc:creator>vdya</dc:creator>
      <dc:date>2009-11-16T06:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on datatrieve</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/need-help-on-datatrieve/m-p/4531783#M43143</link>
      <description>Easy...&lt;BR /&gt;&lt;BR /&gt;DTR&amp;gt; help comm define_file&lt;BR /&gt;&lt;BR /&gt;DTR&amp;gt; FINISH ALL&lt;BR /&gt;DTR&amp;gt; DEFINE FILE FOR &lt;DOMAIN&gt; &lt;BR /&gt;DTR&amp;gt; READY &lt;DOMAIN&gt; EXCLUSIVE WRITE&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;/DOMAIN&gt;&lt;/DOMAIN&gt;</description>
      <pubDate>Mon, 16 Nov 2009 06:23:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/need-help-on-datatrieve/m-p/4531783#M43143</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-11-16T06:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on datatrieve</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/need-help-on-datatrieve/m-p/4531784#M43144</link>
      <description>But how to define domain for procedure?&lt;BR /&gt;&lt;BR /&gt;For record its&lt;BR /&gt;&lt;BR /&gt;DOMAIN EM  USING EMPDEF ON WMS$SEC:EMP.DAT;&lt;BR /&gt;&lt;BR /&gt;where EM domain name, EMPDEF record name and WMS$SEC:EMP.DAT; is complete path for DAT file.&lt;BR /&gt;&lt;BR /&gt;Is there any way to define domain for procedure since i have combined output from 2 different records&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Vidya</description>
      <pubDate>Mon, 16 Nov 2009 11:11:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/need-help-on-datatrieve/m-p/4531784#M43144</guid>
      <dc:creator>vdya</dc:creator>
      <dc:date>2009-11-16T11:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on datatrieve</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/need-help-on-datatrieve/m-p/4531785#M43145</link>
      <description>&lt;!--!*#--&gt;&amp;gt;&amp;gt; But how to define domain for procedure?&lt;BR /&gt;&lt;BR /&gt;Huh? Language problem! &lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; For record its&lt;BR /&gt;&amp;gt;&amp;gt; DOMAIN EM USING EMPDEF ON WMS$SEC:EMP.DAT;&lt;BR /&gt;&lt;BR /&gt;That's just 1 domain.&lt;BR /&gt;So is that there the desired OUTPUT domain?&lt;BR /&gt;Or is that 1 of the 2 inputs?&lt;BR /&gt;Or is that 1 domain, used twice for input crossed with itself?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; Is there any way to define domain for procedure since i have combined output from 2 different records&lt;BR /&gt;&lt;BR /&gt;Do you just want the output from a procedure to go into a file?&lt;BR /&gt;&lt;BR /&gt;Check out DTR&amp;gt; HELP COMMAND ON&lt;BR /&gt;or DTR COMMAND PRINT ... and look for ON clause.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You can also combine record from multiple input domains into a single output domain and have the procedure store data in that output.&lt;BR /&gt;&lt;BR /&gt;Three main methods&lt;BR /&gt;&lt;BR /&gt;DEFINE FILE FOR EM;&lt;BR /&gt;READY EM EXCLUSIVE WRITE;&lt;BR /&gt;EM = IN_1 CROSS IN_2 OVER &lt;FIELD&gt; WHERE ...&lt;BR /&gt;&lt;BR /&gt;or SINGLE loop with CROSS and IF-THEN-ELSEs as needed&lt;BR /&gt;&lt;BR /&gt;DEFINE FILE FOR EM;&lt;BR /&gt;READY EM EXCLUSIVE WRITE;&lt;BR /&gt;FOR N_1 CROSS IN_2 OVER &lt;FIELD&gt; WHERE ...&lt;BR /&gt;     STORE EM USING &lt;BR /&gt;       BEGIN&lt;BR /&gt;          EM_xxx = IN_yyy...&lt;BR /&gt;          :&lt;BR /&gt;       END&lt;BR /&gt;&lt;BR /&gt;or NESTED LOOPS with IF-THEN-ELSEs as needed&lt;BR /&gt;&lt;BR /&gt;FOR DEFINE FILE FOR EM;&lt;BR /&gt;READY EM EXCLUSIVE WRITE;&lt;BR /&gt;  FOR N_1 WHERE ...&lt;BR /&gt;    BEGIN&lt;BR /&gt;    : &lt;BR /&gt;    FOR IN_2 WHERE ...&lt;BR /&gt;       BEGIN&lt;BR /&gt;       :&lt;BR /&gt;       STORE EM USING&lt;BR /&gt;         BEGIN&lt;BR /&gt;           EM_xxx = IN_yyy...&lt;BR /&gt;           :&lt;BR /&gt;         END&lt;BR /&gt;       :&lt;BR /&gt;       END&lt;BR /&gt;    :&lt;BR /&gt;    END&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;/FIELD&gt;&lt;/FIELD&gt;</description>
      <pubDate>Mon, 16 Nov 2009 12:28:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/need-help-on-datatrieve/m-p/4531785#M43145</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-11-16T12:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on datatrieve</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/need-help-on-datatrieve/m-p/4531786#M43146</link>
      <description>Thanks Hein.&lt;BR /&gt;&lt;BR /&gt;I just want the output from a procedure to go into a file. &lt;BR /&gt;I tried with DTR&amp;gt;print on file_spec&lt;BR /&gt;&lt;BR /&gt;Its working fine. It created specified file and dumped data into that.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;That's just 1 domain.&lt;BR /&gt;&amp;gt;&amp;gt;So is that there the desired OUTPUT domain?&lt;BR /&gt;&amp;gt;&amp;gt;Or is that 1 of the 2 inputs?&lt;BR /&gt;&amp;gt;&amp;gt;Or is that 1 domain, used twice for input crossed with itself?&lt;BR /&gt;&lt;BR /&gt;Its one of the 2 inputs. There are 2 domains IM and IN.&lt;BR /&gt;&lt;BR /&gt;My procedure looks like&lt;BR /&gt;&lt;BR /&gt;REDEFINE PROCEDURE EXPIRY_REC&lt;BR /&gt;READY IM SHARED&lt;BR /&gt;READY IN SHARED&lt;BR /&gt;FIND IM WITH IDE=70 OR IDE=82 &lt;BR /&gt;FIND CURRENT CROSS IN OVER ITM&lt;BR /&gt;PRINT CURRENT ON EXPIRY_REC.DAT&lt;BR /&gt;END_PROCEDURE&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Let me try with methods you mentioned.&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Vidya</description>
      <pubDate>Tue, 17 Nov 2009 13:16:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/need-help-on-datatrieve/m-p/4531786#M43146</guid>
      <dc:creator>vdya</dc:creator>
      <dc:date>2009-11-17T13:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on datatrieve</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/need-help-on-datatrieve/m-p/4531787#M43147</link>
      <description>Sounds good.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; FIND IM WITH IDE=70 OR IDE=82 &lt;BR /&gt;&amp;gt;&amp;gt; FIND CURRENT CROSS IN OVER ITM&lt;BR /&gt;&amp;gt;&amp;gt; PRINT CURRENT ON EXPIRY_REC.DAT&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;And that's just fine for modest data volume like 10,000 records or so.&lt;BR /&gt;&lt;BR /&gt;You should be able to do this all in one command:&lt;BR /&gt;&lt;BR /&gt;PRINT IM CROSS IN OVER ITM WITH IDE=70 OR IDE=82 ON EXPIRY_REC.DAT&lt;BR /&gt;&lt;BR /&gt;Collections like 'CURRENT' are convenients, but slow down the results when processing large amounts of records (50,000+ ?).&lt;BR /&gt;They make Datatrieve re-read data.&lt;BR /&gt;&lt;BR /&gt;Hein&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Nov 2009 16:47:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/need-help-on-datatrieve/m-p/4531787#M43147</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-11-17T16:47:29Z</dc:date>
    </item>
  </channel>
</rss>

