<?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 Using variable to set def directory in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/using-variable-to-set-def-directory/m-p/3942873#M11532</link>
    <description>Is there some way within a DCL command procedure to pass a variable to the set default direcory command.&lt;BR /&gt;&lt;BR /&gt;for example&lt;BR /&gt;&lt;BR /&gt;$newdir = test1&lt;BR /&gt;$set def sys$sysdeivce:[stuff.mine.newdir]&lt;BR /&gt;&lt;BR /&gt;where newdir is a variable name</description>
    <pubDate>Mon, 12 Feb 2007 10:48:16 GMT</pubDate>
    <dc:creator>gibson</dc:creator>
    <dc:date>2007-02-12T10:48:16Z</dc:date>
    <item>
      <title>Using variable to set def directory</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-variable-to-set-def-directory/m-p/3942873#M11532</link>
      <description>Is there some way within a DCL command procedure to pass a variable to the set default direcory command.&lt;BR /&gt;&lt;BR /&gt;for example&lt;BR /&gt;&lt;BR /&gt;$newdir = test1&lt;BR /&gt;$set def sys$sysdeivce:[stuff.mine.newdir]&lt;BR /&gt;&lt;BR /&gt;where newdir is a variable name</description>
      <pubDate>Mon, 12 Feb 2007 10:48:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-variable-to-set-def-directory/m-p/3942873#M11532</guid>
      <dc:creator>gibson</dc:creator>
      <dc:date>2007-02-12T10:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using variable to set def directory</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-variable-to-set-def-directory/m-p/3942874#M11533</link>
      <description>Hi Gibson&lt;BR /&gt;&lt;BR /&gt;$ newdir = "test1"&lt;BR /&gt;$ SET DEF sys$syssdevice:[stuff.mine.'newdir']&lt;BR /&gt;&lt;BR /&gt;This will do what you expected.&lt;BR /&gt;&lt;BR /&gt;or ...&lt;BR /&gt;&lt;BR /&gt;$ @my_commfile "test1" ! Supply the variable part as a variable to the commfile&lt;BR /&gt;&lt;BR /&gt;The commfile then looks like this:&lt;BR /&gt;&lt;BR /&gt;$ SET DEF SYS$SYSDEVICE:[stuff.mine.'P1']&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope that helps&lt;BR /&gt;&lt;BR /&gt;Regards &lt;BR /&gt;&lt;BR /&gt;Heinz&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Feb 2007 10:53:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-variable-to-set-def-directory/m-p/3942874#M11533</guid>
      <dc:creator>Heinz W Genhart</dc:creator>
      <dc:date>2007-02-12T10:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using variable to set def directory</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-variable-to-set-def-directory/m-p/3942875#M11534</link>
      <description>Hello and Welcome to ITRC.&lt;BR /&gt;&lt;BR /&gt;DCL symbol substitution will be of interest here, and applies here and most any other time when the $ prompt or DCL is otherwise reading and processing input:&lt;BR /&gt;&lt;BR /&gt;$ newdir := SYS$SYSDEVICE:[SOMEWHERE]&lt;BR /&gt;$ SET DEFAULT 'newdir'&lt;BR /&gt;&lt;BR /&gt;To perform a substring substitution&lt;BR /&gt;&lt;BR /&gt;$ newdir := test1&lt;BR /&gt;$ SET DEFAULT ddcu:[this.that.'newdir']&lt;BR /&gt;&lt;BR /&gt;(or potentially [.'newdir'], if you can use relative directory notation.)&lt;BR /&gt;&lt;BR /&gt;Navigation within a directory hierarchy can be a bit, um, interesting.&lt;BR /&gt;&lt;BR /&gt;Also look around for PUSHD and POPD tools, as these are widely available and potentially relevant here, and there are a gazillion versions of "CD" tools around for OpenVMS.  Start on the OpenVMS Freeware, but you should have no problem finding examples using Google or such.  (&lt;A href="http://www.hp.com/go/openvms/freeware)" target="_blank"&gt;http://www.hp.com/go/openvms/freeware)&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;As for learning more about DCL and DCL arcana, the OpenVMS User's Guide (in the OpenVMS documentation set) is a good start, and (if you can find a copy) Writing Real Programs in DCL 2nd Ed, a book I co-authored a few years back.&lt;BR /&gt;&lt;BR /&gt;Available tutorial and command-related information is referenced in the OpenVMS FAQ (&lt;A href="http://www.hoffmanlabs.com/vmsfaq)," target="_blank"&gt;http://www.hoffmanlabs.com/vmsfaq),&lt;/A&gt; for both books and tutorial sites, and comparisions between (say) Unix shell commands and DCL commands.&lt;BR /&gt;&lt;BR /&gt;And again, welcome to ITRC.&lt;BR /&gt;&lt;BR /&gt;Stephen Hoffman&lt;BR /&gt;HoffmanLabs</description>
      <pubDate>Mon, 12 Feb 2007 10:57:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-variable-to-set-def-directory/m-p/3942875#M11534</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2007-02-12T10:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using variable to set def directory</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-variable-to-set-def-directory/m-p/3942876#M11535</link>
      <description>Hi Gibson&lt;BR /&gt;&lt;BR /&gt;welcome to the forum. I did not recognize that you are a new member. &lt;BR /&gt;&lt;BR /&gt;Have Fun&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Heinz</description>
      <pubDate>Mon, 12 Feb 2007 10:58:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-variable-to-set-def-directory/m-p/3942876#M11535</guid>
      <dc:creator>Heinz W Genhart</dc:creator>
      <dc:date>2007-02-12T10:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using variable to set def directory</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-variable-to-set-def-directory/m-p/3942877#M11536</link>
      <description>Your instructions worked like a charm. I have my script running...saved me a bunch of time.&lt;BR /&gt;&lt;BR /&gt;Thanks for your help and friendly welcome to the forum !</description>
      <pubDate>Mon, 12 Feb 2007 13:48:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-variable-to-set-def-directory/m-p/3942877#M11536</guid>
      <dc:creator>gibson</dc:creator>
      <dc:date>2007-02-12T13:48:55Z</dc:date>
    </item>
  </channel>
</rss>

