<?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: OpenVMS COBOL: Dynamic Filenames in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/openvms-cobol-dynamic-filenames/m-p/5064334#M38321</link>
    <description>Hi&lt;BR /&gt;&lt;BR /&gt;If You know what file to open before the program is started You can use 'logical names'.&lt;BR /&gt;Logical names works like an 'alias' and can be used as filenames in programs.&lt;BR /&gt;&lt;BR /&gt;From DCL create the logical name FILE_TO_OPEN:&lt;BR /&gt;$ DEFINE/JOB FILE_TO_OPEN ANY_FILE.DAT&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;From program use the logical name:&lt;BR /&gt;OPEN FILE_TO_OPEN&lt;BR /&gt;&lt;BR /&gt;For more info about logical names do:&lt;BR /&gt;$ HELP DEFINE&lt;BR /&gt;&lt;BR /&gt;/Regards&lt;BR /&gt;Leif J</description>
    <pubDate>Thu, 23 Aug 2007 00:42:11 GMT</pubDate>
    <dc:creator>Leif R. Jansson</dc:creator>
    <dc:date>2007-08-23T00:42:11Z</dc:date>
    <item>
      <title>OpenVMS COBOL: Dynamic Filenames</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/openvms-cobol-dynamic-filenames/m-p/5064329#M38316</link>
      <description>This is probably just me having tunnel vision from another platform, but I need to use dynamic filenames in a program.&lt;BR /&gt;&lt;BR /&gt;I have about 40 files, all of which are small and all of which have exactly the same internal format. I need to be able to dynamically open any of these files in a program and RWUD the records in them. &lt;BR /&gt;&lt;BR /&gt;Yes, I could just combine them all into a single file, and use a type key to differentiate the data, but these are basically "domain tables" and keeping them separate makes life *much* easier. &lt;BR /&gt;&lt;BR /&gt;Anyone know how I can do this easily? The files are indexed by the way, with only a primary key, which is in the exact same place in the record of each file (the first six bytes). &lt;BR /&gt;&lt;BR /&gt;Thanks -Paul&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Aug 2007 21:10:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/openvms-cobol-dynamic-filenames/m-p/5064329#M38316</guid>
      <dc:creator>Paul Raulerson</dc:creator>
      <dc:date>2007-08-21T21:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: OpenVMS COBOL: Dynamic Filenames</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/openvms-cobol-dynamic-filenames/m-p/5064330#M38317</link>
      <description>Maybe I don't understand your question, but normally you would just use a logical name for the file, and use that logical name as the file to open.&lt;BR /&gt;&lt;BR /&gt;Then you can define the logical name either inside or outside the program, and the program will open the file specified by the logical name.&lt;BR /&gt;&lt;BR /&gt;For example, choose a logical name that describes what the files are used for, for example "DOMAIN_TABLE_FILE", and in the open statement, use DOMAIN_TABLE_FILE as the file to open.  Outside your program, &lt;BR /&gt;&lt;BR /&gt;$ define DOMAIN_TABLE_FILE MY_DISK:[MYDIR]DOMAIN_0001.DAT&lt;BR /&gt;$ run table_updater&lt;BR /&gt;&lt;BR /&gt;The file MY_DISK:[MYDIR]DOMAIN_0001.DAT&lt;BR /&gt;will be used when the cobol program opens DOMAIN_TABLE_FILE&lt;BR /&gt;&lt;BR /&gt;This will work for any files, as long as they all have the same layout.&lt;BR /&gt;&lt;BR /&gt;But perhaps dynamic filenames has some specific meaning I am not aware of.&lt;BR /&gt;&lt;BR /&gt;Jon</description>
      <pubDate>Tue, 21 Aug 2007 21:48:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/openvms-cobol-dynamic-filenames/m-p/5064330#M38317</guid>
      <dc:creator>Jon Pinkley</dc:creator>
      <dc:date>2007-08-21T21:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: OpenVMS COBOL: Dynamic Filenames</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/openvms-cobol-dynamic-filenames/m-p/5064331#M38318</link>
      <description>OpenVMS Cobol provides two places to provide a file name.&lt;BR /&gt;&lt;BR /&gt;1) The ASSIGN clause in the SELECT&lt;BR /&gt;&lt;BR /&gt;2)  The FD clause VALUE OF ID which can be a data-name for a WS item.&lt;BR /&gt;&lt;BR /&gt;They map to the RMS 'filename' and 'default-filename'.&lt;BR /&gt;&lt;BR /&gt;Your option is to just set the rigth file name in the value of id, or to dynamically define a logical name for the 'select' name to follow.&lt;BR /&gt;&lt;BR /&gt;fwiw... from an RMS and system resource perspective the single file solution is LIKELY to be preferable. Not garantueed, just very likely. Shared overhead basically, and the exponential power of index trees.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps some,&lt;BR /&gt;Hein van den Heuvel (at gmail dot com)&lt;BR /&gt;HvdH Performance Consulting&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Aug 2007 21:57:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/openvms-cobol-dynamic-filenames/m-p/5064331#M38318</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-08-21T21:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: OpenVMS COBOL: Dynamic Filenames</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/openvms-cobol-dynamic-filenames/m-p/5064332#M38319</link>
      <description>Thank You Gentlemen: &lt;BR /&gt;&lt;BR /&gt;The VALUE OF ID clause is what I was looking for. I knew I could do it from DCL, but I needed to do it within an executing program to make all that work well. &lt;BR /&gt;&lt;BR /&gt;P.S. -You understood exactly what I meant by Dynamic Files, thank you. It's a bit different in a particular three letter competitor's COBOL. &lt;BR /&gt;&lt;BR /&gt;Thanks -Paul&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Aug 2007 22:18:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/openvms-cobol-dynamic-filenames/m-p/5064332#M38319</guid>
      <dc:creator>Paul Raulerson</dc:creator>
      <dc:date>2007-08-21T22:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: OpenVMS COBOL: Dynamic Filenames</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/openvms-cobol-dynamic-filenames/m-p/5064333#M38320</link>
      <description>Thank You!</description>
      <pubDate>Tue, 21 Aug 2007 22:19:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/openvms-cobol-dynamic-filenames/m-p/5064333#M38320</guid>
      <dc:creator>Paul Raulerson</dc:creator>
      <dc:date>2007-08-21T22:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: OpenVMS COBOL: Dynamic Filenames</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/openvms-cobol-dynamic-filenames/m-p/5064334#M38321</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;If You know what file to open before the program is started You can use 'logical names'.&lt;BR /&gt;Logical names works like an 'alias' and can be used as filenames in programs.&lt;BR /&gt;&lt;BR /&gt;From DCL create the logical name FILE_TO_OPEN:&lt;BR /&gt;$ DEFINE/JOB FILE_TO_OPEN ANY_FILE.DAT&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;From program use the logical name:&lt;BR /&gt;OPEN FILE_TO_OPEN&lt;BR /&gt;&lt;BR /&gt;For more info about logical names do:&lt;BR /&gt;$ HELP DEFINE&lt;BR /&gt;&lt;BR /&gt;/Regards&lt;BR /&gt;Leif J</description>
      <pubDate>Thu, 23 Aug 2007 00:42:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/openvms-cobol-dynamic-filenames/m-p/5064334#M38321</guid>
      <dc:creator>Leif R. Jansson</dc:creator>
      <dc:date>2007-08-23T00:42:11Z</dc:date>
    </item>
  </channel>
</rss>

