- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- OpenVMS COBOL: Dynamic Filenames
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-21-2007 02:10 PM
тАО08-21-2007 02:10 PM
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.
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.
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).
Thanks -Paul
Solved! Go to Solution.
- Tags:
- COBOL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-21-2007 02:48 PM
тАО08-21-2007 02:48 PM
Re: OpenVMS COBOL: Dynamic Filenames
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.
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,
$ define DOMAIN_TABLE_FILE MY_DISK:[MYDIR]DOMAIN_0001.DAT
$ run table_updater
The file MY_DISK:[MYDIR]DOMAIN_0001.DAT
will be used when the cobol program opens DOMAIN_TABLE_FILE
This will work for any files, as long as they all have the same layout.
But perhaps dynamic filenames has some specific meaning I am not aware of.
Jon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-21-2007 02:57 PM
тАО08-21-2007 02:57 PM
Solution1) The ASSIGN clause in the SELECT
2) The FD clause VALUE OF ID which can be a data-name for a WS item.
They map to the RMS 'filename' and 'default-filename'.
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.
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.
Hope this helps some,
Hein van den Heuvel (at gmail dot com)
HvdH Performance Consulting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-21-2007 03:18 PM
тАО08-21-2007 03:18 PM
Re: OpenVMS COBOL: Dynamic Filenames
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.
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.
Thanks -Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-21-2007 03:19 PM
тАО08-21-2007 03:19 PM
Re: OpenVMS COBOL: Dynamic Filenames
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-22-2007 05:42 PM
тАО08-22-2007 05:42 PM
Re: OpenVMS COBOL: Dynamic Filenames
If You know what file to open before the program is started You can use 'logical names'.
Logical names works like an 'alias' and can be used as filenames in programs.
From DCL create the logical name FILE_TO_OPEN:
$ DEFINE/JOB FILE_TO_OPEN ANY_FILE.DAT
From program use the logical name:
OPEN FILE_TO_OPEN
For more info about logical names do:
$ HELP DEFINE
/Regards
Leif J