<?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: Returning Status From Datatrieve (DTR) in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/returning-status-from-datatrieve-dtr/m-p/3915615#M35269</link>
    <description>&lt;BR /&gt;Hi Ramondo,&lt;BR /&gt;&lt;BR /&gt;Actually the Callable DTR is intended to be used when you need that type of error handling control of Datatrieve functions. However there is a way to first grab the Datatrieve Status Value and then put it into your own DCL symbol. Please see the example below that has already worked for me.&lt;BR /&gt;&lt;BR /&gt;$ mc dtr32 DEC DATATRIEVE V7.2&lt;BR /&gt;Digital Query and Report System&lt;BR /&gt;Type HELP for help&lt;BR /&gt;DTR&amp;gt; show mydomain&lt;BR /&gt;Element "MYDOMAIN" not found in dictionary.&lt;BR /&gt;DTR&amp;gt; FN$SET_SYMBOL("DTR_STATUS",FN$STATUS)&lt;BR /&gt;DTR&amp;gt; exit&lt;BR /&gt;$ set message sys$message:DTRMSGS.EXE&lt;BR /&gt;$ say f$message("%D''DTR_STATUS'") %DTR-E-ELTNOTDIC, Element "!AS" not found in dictionary.&lt;BR /&gt;$ show symbol DTR_STATUS&lt;BR /&gt;  DTR_STATUS = "9273746"&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;Note that the DTR Status returned is a Decimal base 10 value.&lt;BR /&gt;&lt;BR /&gt;Cheers!&lt;BR /&gt;&lt;BR /&gt;Keith Cayemberg&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 20 Dec 2006 07:13:26 GMT</pubDate>
    <dc:creator>Keith Cayemberg</dc:creator>
    <dc:date>2006-12-20T07:13:26Z</dc:date>
    <item>
      <title>Returning Status From Datatrieve (DTR)</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/returning-status-from-datatrieve-dtr/m-p/3915612#M35266</link>
      <description>Hi guys, only my second post here...&lt;BR /&gt;&lt;BR /&gt;I don't know if anyone uses DTR anymore, but I'd like to know if it's possible to return a status to a command procedure to indicate when an error has occurred with a DTR command. Here's the situation:&lt;BR /&gt;&lt;BR /&gt;Log of DTR within a command procedure to write a record to an RMS file that has "no duplicates" (simplified version)...&lt;BR /&gt; &lt;BR /&gt;$&lt;BR /&gt;$ DTR&lt;BR /&gt;DATATRIEVE V7.2A&lt;BR /&gt;Digital Query and Report System&lt;BR /&gt;Type HELP for help&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;ready interface_domains.svoc_interface_tracking as trf write&lt;BR /&gt;&lt;BR /&gt;store trf using&lt;BR /&gt;begin&lt;BR /&gt;        run_number       = "000001";&lt;BR /&gt;        file_type        = "NOTEIF";     &lt;BR /&gt;        extract_date     = "20061220";   &lt;BR /&gt;        batch_status     = "P";         &lt;BR /&gt;        data_flag        = "N";      &lt;BR /&gt;        sched_seq_number = "000001";  &lt;BR /&gt;        file_seq_number  = "01";&lt;BR /&gt;        day_seq_number   = "01"; &lt;BR /&gt;end&lt;BR /&gt;You cannot store a duplicate value in an RMS key field that doesn't allow duplicates. &lt;BR /&gt;&lt;BR /&gt;exit&lt;BR /&gt;$ l_stat = $status&lt;BR /&gt;$!&lt;BR /&gt;$ if .not. l_stat&lt;BR /&gt;$ endif&lt;BR /&gt;$!&lt;BR /&gt;$ exit&lt;BR /&gt;&lt;BR /&gt;$status always has a value %X008D8CB9 on exit from DTR, no "on error goto" or checking of $status is going to pick up the fact that the record wasn't written.&lt;BR /&gt;&lt;BR /&gt;Seeing as all the data in this case is character means I could use DCL to concatenate and $write/error=[err trap], but the DTR method seems more correct.&lt;BR /&gt;&lt;BR /&gt;Redirecting the output to a separate log and searching for "You cannot store..." seems like too much trouble too.&lt;BR /&gt;&lt;BR /&gt;Maybe it's not designed to be used this way.&lt;BR /&gt;&lt;BR /&gt;Any thoughts?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Ramondo.</description>
      <pubDate>Tue, 19 Dec 2006 20:40:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/returning-status-from-datatrieve-dtr/m-p/3915612#M35266</guid>
      <dc:creator>Ramondo</dc:creator>
      <dc:date>2006-12-19T20:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: Returning Status From Datatrieve (DTR)</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/returning-status-from-datatrieve-dtr/m-p/3915613#M35267</link>
      <description>Ramondo,&lt;BR /&gt;&lt;BR /&gt;  %X008D8CB9 is a DTR facility message, see: &lt;BR /&gt;&lt;BR /&gt;$ WRITE SYS$OUTPUT F$MESSAGE(%X008D8CB9)&lt;BR /&gt;%DTR-S-NOMSG, Message number 008D8CB9&lt;BR /&gt;&lt;BR /&gt;  Since I don't have a DTRMSG file (DTR not installed here), I can't identify the actual message, but you may be able to. Try:&lt;BR /&gt;&lt;BR /&gt;$ SET MESSAGE SYS$MESSAGE:DTRMSG&lt;BR /&gt;&lt;BR /&gt;and repeat the above command.&lt;BR /&gt;&lt;BR /&gt;The severity is -S- which means "Success", so whatever DTR has done, it's been considered successful.&lt;BR /&gt;&lt;BR /&gt;By OpenVMS conventions, an image should return a longword status code in R0 when it exits. DCL makes that value available as $STATUS. It's entirely up to DTR to decide what to place in R0. My recollection is that DTR doesn't give you anything useful. However, it's been a long time, so I may be incorrect. There may also be switches or commands within DTR to return something to DCL which you can test.</description>
      <pubDate>Tue, 19 Dec 2006 22:07:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/returning-status-from-datatrieve-dtr/m-p/3915613#M35267</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2006-12-19T22:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Returning Status From Datatrieve (DTR)</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/returning-status-from-datatrieve-dtr/m-p/3915614#M35268</link>
      <description>Thanks for the prompt reply.&lt;BR /&gt;&lt;BR /&gt;DTR&amp;gt; exit&lt;BR /&gt;$ sh sym $status&lt;BR /&gt;  $STATUS == "%X008D8CB9"&lt;BR /&gt;$ SET MESSAGE SYS$MESSAGE:DTRMSGs&lt;BR /&gt;$ write sys$output f$message("%X008D8CB9")&lt;BR /&gt;%DTR-S-EXIT, Exit from DATATRIEVE requested by operator. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;It's the status of EXIT command at the end of my DTR session that it's returning.&lt;BR /&gt;&lt;BR /&gt;If I remove the EXIT the last DTR command executed is the attempt to store the record - but same result. It seems there's an implied exit that returns the generic DTR Exit Status regardless of what's gone before.&lt;BR /&gt;&lt;BR /&gt;I've had a look at DTR help and can't find anything relating to return of status codes...&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Dec 2006 23:24:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/returning-status-from-datatrieve-dtr/m-p/3915614#M35268</guid>
      <dc:creator>Ramondo</dc:creator>
      <dc:date>2006-12-19T23:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: Returning Status From Datatrieve (DTR)</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/returning-status-from-datatrieve-dtr/m-p/3915615#M35269</link>
      <description>&lt;BR /&gt;Hi Ramondo,&lt;BR /&gt;&lt;BR /&gt;Actually the Callable DTR is intended to be used when you need that type of error handling control of Datatrieve functions. However there is a way to first grab the Datatrieve Status Value and then put it into your own DCL symbol. Please see the example below that has already worked for me.&lt;BR /&gt;&lt;BR /&gt;$ mc dtr32 DEC DATATRIEVE V7.2&lt;BR /&gt;Digital Query and Report System&lt;BR /&gt;Type HELP for help&lt;BR /&gt;DTR&amp;gt; show mydomain&lt;BR /&gt;Element "MYDOMAIN" not found in dictionary.&lt;BR /&gt;DTR&amp;gt; FN$SET_SYMBOL("DTR_STATUS",FN$STATUS)&lt;BR /&gt;DTR&amp;gt; exit&lt;BR /&gt;$ set message sys$message:DTRMSGS.EXE&lt;BR /&gt;$ say f$message("%D''DTR_STATUS'") %DTR-E-ELTNOTDIC, Element "!AS" not found in dictionary.&lt;BR /&gt;$ show symbol DTR_STATUS&lt;BR /&gt;  DTR_STATUS = "9273746"&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;Note that the DTR Status returned is a Decimal base 10 value.&lt;BR /&gt;&lt;BR /&gt;Cheers!&lt;BR /&gt;&lt;BR /&gt;Keith Cayemberg&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Dec 2006 07:13:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/returning-status-from-datatrieve-dtr/m-p/3915615#M35269</guid>
      <dc:creator>Keith Cayemberg</dc:creator>
      <dc:date>2006-12-20T07:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Returning Status From Datatrieve (DTR)</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/returning-status-from-datatrieve-dtr/m-p/3915616#M35270</link>
      <description>Cheers Keith.&lt;BR /&gt;&lt;BR /&gt;I notice there's nothing in the online help about FN$STATUS, but there are lots of other functions listed.&lt;BR /&gt;&lt;BR /&gt;Also, if you do nothing in a DTR session (as in no reads or writes), the status returned is zero. A value of 1 would be better, I think.&lt;BR /&gt;&lt;BR /&gt;Anyhow, just what I needed.&lt;BR /&gt;&lt;BR /&gt;Thanks again,&lt;BR /&gt;&lt;BR /&gt;Ramondo.</description>
      <pubDate>Thu, 21 Dec 2006 16:52:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/returning-status-from-datatrieve-dtr/m-p/3915616#M35270</guid>
      <dc:creator>Ramondo</dc:creator>
      <dc:date>2006-12-21T16:52:27Z</dc:date>
    </item>
  </channel>
</rss>

