<?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: How to test if a symbol has been initialised in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/how-to-test-if-a-symbol-has-been-initialised/m-p/3062262#M413</link>
    <description>Try this:&lt;BR /&gt;&lt;BR /&gt;if f$type(MYSYMBOL) .eqs. "" then goto warnuser&lt;BR /&gt;&lt;BR /&gt;If MYSYMBOL has been defined, f$type will hold it's type. Consequently, if MYSYMBOL hasn't been initilazed (not even to "") -  so actually doesn't exist, f$type will return "".&lt;BR /&gt;&lt;BR /&gt;So this can be exploited....</description>
    <pubDate>Wed, 03 Sep 2003 09:20:07 GMT</pubDate>
    <dc:creator>Willem Grooters</dc:creator>
    <dc:date>2003-09-03T09:20:07Z</dc:date>
    <item>
      <title>How to test if a symbol has been initialised</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-test-if-a-symbol-has-been-initialised/m-p/3062261#M412</link>
      <description>Is there a nice tidy way to test if a symbol has ever been initialised?&lt;BR /&gt;&lt;BR /&gt;Cos the way I'm doing it seems a bit backwards.&lt;BR /&gt;&lt;BR /&gt;$ON WARNING THEN GOTO WARNUSER&lt;BR /&gt;$!&lt;BR /&gt;$!This will fail if MYSYMBOL not set&lt;BR /&gt;$TEMP = MYSYMBOL&lt;BR /&gt;$!&lt;BR /&gt;$!Restore action upon warning&lt;BR /&gt;$ON WARNING THEN GOTO JOBERROR&lt;BR /&gt;&lt;BR /&gt;When I joined this forum I thought I was quite good with DCL and OpenVms, having read a lot of this forum, I bow my head to you guys!</description>
      <pubDate>Wed, 03 Sep 2003 09:00:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-test-if-a-symbol-has-been-initialised/m-p/3062261#M412</guid>
      <dc:creator>matt burns</dc:creator>
      <dc:date>2003-09-03T09:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to test if a symbol has been initialised</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-test-if-a-symbol-has-been-initialised/m-p/3062262#M413</link>
      <description>Try this:&lt;BR /&gt;&lt;BR /&gt;if f$type(MYSYMBOL) .eqs. "" then goto warnuser&lt;BR /&gt;&lt;BR /&gt;If MYSYMBOL has been defined, f$type will hold it's type. Consequently, if MYSYMBOL hasn't been initilazed (not even to "") -  so actually doesn't exist, f$type will return "".&lt;BR /&gt;&lt;BR /&gt;So this can be exploited....</description>
      <pubDate>Wed, 03 Sep 2003 09:20:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-test-if-a-symbol-has-been-initialised/m-p/3062262#M413</guid>
      <dc:creator>Willem Grooters</dc:creator>
      <dc:date>2003-09-03T09:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to test if a symbol has been initialised</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-test-if-a-symbol-has-been-initialised/m-p/3062263#M414</link>
      <description>&lt;BR /&gt;Thanks for the help willem but the batches I need to add the code to may have various actions to perforn in the event of a warning.&lt;BR /&gt;&lt;BR /&gt;ie. they may start with&lt;BR /&gt;$ ON WARNING THEN GOTO JOBERROR&lt;BR /&gt;&lt;BR /&gt;Your suggestion works ok on the commands line, but in the code, causes the batches to jump to label JOBERROR.&lt;BR /&gt;Is there a way to do it without causing any warnings at all?</description>
      <pubDate>Wed, 03 Sep 2003 09:40:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-test-if-a-symbol-has-been-initialised/m-p/3062263#M414</guid>
      <dc:creator>matt burns</dc:creator>
      <dc:date>2003-09-03T09:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to test if a symbol has been initialised</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-test-if-a-symbol-has-been-initialised/m-p/3062264#M415</link>
      <description>Hi Matt,&lt;BR /&gt;if you will be sure symbol is initialized you can use this code run quicly than test f$type&lt;BR /&gt;&lt;BR /&gt;$ MYSYMBOL="''MYSYMBOL'"&lt;BR /&gt;&lt;BR /&gt;Otherwise you can assingn a value to another symbol, set null if symbol is not defined without test:&lt;BR /&gt;&lt;BR /&gt;$ SYMBOL_TWO="''MYSYMBOL'"&lt;BR /&gt;&lt;BR /&gt;Prior statement are functionally with string symbols. Using numeric symbol you need use f$type function.&lt;BR /&gt;&lt;BR /&gt;Bye&lt;BR /&gt;Antoniov&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Sep 2003 12:22:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-test-if-a-symbol-has-been-initialised/m-p/3062264#M415</guid>
      <dc:creator>Antoniov.</dc:creator>
      <dc:date>2003-09-03T12:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to test if a symbol has been initialised</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-test-if-a-symbol-has-been-initialised/m-p/3062265#M416</link>
      <description>Antoniov, I beleive you have misunderstood me.&lt;BR /&gt;My whole problem is trying to discover if a symbol is initialised without raising a warning.&lt;BR /&gt;&lt;BR /&gt;Your lines are basically assigning the string representation of MYSYMBOL to another symbol, (something that could also be done with the lexical f$string).&lt;BR /&gt;&lt;BR /&gt;I need to find out if MYSYMBOL (global symbol) has ever been initialised (ie. in a calling batch)&lt;BR /&gt;&lt;BR /&gt;I know I check search the result of&lt;BR /&gt;$ SHO SYM /GLOBAL MYSYMBOL&lt;BR /&gt;&lt;BR /&gt;Or I can do what I am doing which is&lt;BR /&gt;&lt;BR /&gt;$ SET NOON&lt;BR /&gt;$!&lt;BR /&gt;$ IF F$TYPE(MYSYMBOL) .EQS. ""&lt;BR /&gt;$ THEN&lt;BR /&gt;$     GOSUB JOBERROR&lt;BR /&gt;$ ENDIF&lt;BR /&gt;$!&lt;BR /&gt;$ SET ON&lt;BR /&gt;$!&lt;BR /&gt;&lt;BR /&gt;I just want to know if there's a tidier way!</description>
      <pubDate>Wed, 03 Sep 2003 12:58:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-test-if-a-symbol-has-been-initialised/m-p/3062265#M416</guid>
      <dc:creator>matt burns</dc:creator>
      <dc:date>2003-09-03T12:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to test if a symbol has been initialised</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-test-if-a-symbol-has-been-initialised/m-p/3062266#M417</link>
      <description>Ok Matt,&lt;BR /&gt;if you need only stop a batch, use f$type.&lt;BR /&gt;&lt;BR /&gt;Sometimes you could need assing value without error and f$string can't work!&lt;BR /&gt;I've learned use of "''MYSYMBOL'" reading various VMS system files.&lt;BR /&gt;&lt;BR /&gt;Bye&lt;BR /&gt;Antoniov&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Sep 2003 13:21:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-test-if-a-symbol-has-been-initialised/m-p/3062266#M417</guid>
      <dc:creator>Antoniov.</dc:creator>
      <dc:date>2003-09-03T13:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to test if a symbol has been initialised</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-test-if-a-symbol-has-been-initialised/m-p/3062267#M418</link>
      <description>Antoniov, I see what you mean now.&lt;BR /&gt;&lt;BR /&gt;$ MYSYMBOL = "''MYSYMBOL'"&lt;BR /&gt;&lt;BR /&gt;throws no warnings but will leave MYSYMBOL initialised to either the value or ""&lt;BR /&gt;&lt;BR /&gt;Cheers</description>
      <pubDate>Wed, 03 Sep 2003 13:55:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-test-if-a-symbol-has-been-initialised/m-p/3062267#M418</guid>
      <dc:creator>matt burns</dc:creator>
      <dc:date>2003-09-03T13:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to test if a symbol has been initialised</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-test-if-a-symbol-has-been-initialised/m-p/3062268#M419</link>
      <description>The lexical f$type(symbol_name) does not appear to trip the on warning code when I test it.  It did when I added "s around the symbol name as the argument to the f$type call, but when I coded it properly without the "s, it works fine.</description>
      <pubDate>Wed, 03 Sep 2003 15:09:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-test-if-a-symbol-has-been-initialised/m-p/3062268#M419</guid>
      <dc:creator>Dale A. Marcy</dc:creator>
      <dc:date>2003-09-03T15:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to test if a symbol has been initialised</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-test-if-a-symbol-has-been-initialised/m-p/3062269#M420</link>
      <description>&lt;BR /&gt;Yes, you are right, I don't know what I tried before but it works ok now ??!?!?!!</description>
      <pubDate>Wed, 03 Sep 2003 15:19:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-test-if-a-symbol-has-been-initialised/m-p/3062269#M420</guid>
      <dc:creator>matt burns</dc:creator>
      <dc:date>2003-09-03T15:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to test if a symbol has been initialised</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-test-if-a-symbol-has-been-initialised/m-p/3062270#M421</link>
      <description>Hi Matt&lt;BR /&gt;Excuse me&lt;BR /&gt;MY_SYMBOL=""MY_SYMBOL"" it's a error&lt;BR /&gt;&lt;BR /&gt;If you set a symbol and you can accept null value if symbol not defined you can write&lt;BR /&gt;TWO_SYMBOL="''MY_SYMBOL'"&lt;BR /&gt;If MY_SYMBOL is not defined TWO_SYMBOL is set to "".&lt;BR /&gt;If you write&lt;BR /&gt;MY_SYMBOL="''MY_SYMBOL'" you are sure MY_SYMBOL is defined as value of caller (if defined) or null (if caller has not set MY_SYMBOL).&lt;BR /&gt;Same using == (to assing global values).&lt;BR /&gt;F$STRING permit convert a numeric symbol into string symbol. There are few differents between string symbol and numeric symbol.&lt;BR /&gt;If you stil need help about symbol post question.&lt;BR /&gt;Excuse me again for prior error.&lt;BR /&gt;Antoniov&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Sep 2003 15:35:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-test-if-a-symbol-has-been-initialised/m-p/3062270#M421</guid>
      <dc:creator>Antoniov.</dc:creator>
      <dc:date>2003-09-03T15:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to test if a symbol has been initialised</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-test-if-a-symbol-has-been-initialised/m-p/3062271#M422</link>
      <description>If you have a job submitted to a batchqueue, the sumbmitted procedure won't hold the changes. AFAIK the quemanager holds the file-ID, not the file-specification (or, if it does, it will include the version number).&lt;BR /&gt;So the first run (using the original file)won't show the change, after re-submit (by hand or automatically) it will use the new file and then you'll notice the changes.&lt;BR /&gt;So if you run your procedures in batch, this _could_ have been the case. You should delete the existing entries and resubmit. (there will undoubtebly bee more sofisticated ways, but this is what I know working)&lt;BR /&gt;Don't blush, I made that mistake quite often myself ;-).</description>
      <pubDate>Wed, 03 Sep 2003 15:59:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-test-if-a-symbol-has-been-initialised/m-p/3062271#M422</guid>
      <dc:creator>Willem Grooters</dc:creator>
      <dc:date>2003-09-03T15:59:20Z</dc:date>
    </item>
  </channel>
</rss>

