- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- syntax for index file with multiple keys and each ...
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
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
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-24-2018 07:21 AM
08-24-2018 07:21 AM
syntax for index file with multiple keys and each key have multiple columns
Hi,
i have index file with 100 columns and 3 keys. each key have mulltiple columns at random positions from file.
example: index.dat K1, K2 and K3. columns: C1,C2,C3,C4....C100.
K1 - C10,C11,C12,C13 K2 - C9,C10,C11,C12,C13,C14 K3 - C5,C40
i tried to read this index file thru COBOL program as below:
I-O section: SELECT index orgnaization is indexed record key is K1 alternate key is K2 alternate key is K3
Data section:
FD index.
01 k1.
05 C10
05 C11
05 C12
05 C13
01 k2
05 C9
05 C10
05 C11 ---
01 K3
05 C5
05 C40
01 index-rec
05 c1
05 c2 .....
or
I-O section: SELECT index orgnaization is indexed record key is C10,C11,C12.. alternate key is C9,C10... alternate key is C9, C40
Data section:
FD index.
01 index-rec
05 c1
05 c2 .....
i am getting error in both cases with error as " attempting to open indexed file index.dat whose actuals keys don't match" while opening file statement in debug the code.
i tried to find syntax or example in multiple websites but most of them has single key or multiple key also with each key has one column and that too first rows not from random columns.
Please help me how to resolve this issue and help in delcaration on file?
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2018 01:13 PM
08-24-2018 01:13 PM
Re: syntax for index file with multiple keys and each key have multiple columns
Just do not specify the alternate keys if you do not need the,
If you specify them, then Cobol ensures they are matching the file.
If you leave them out, there is nothing to check, nothing to fail.
If you are just processing from first to last (as suggested by other posts here) then you casn probably even leave of the primary key if my recollection is correct.
Most importantly you do NOT specify those K1 and K2 thingies. Those are just names/labels for a collection of columns.
Get rid of...
FD index.
01 k1.
05 C10...
Only use...
01 index-rec
05 c1
05 c2 .....
Or... do NOTHING, after CONVERTING the file to sequential as per other topic
(CONVERT/FDL=NL: /STAT idx.dat seq.dat)
The bits/record-layout will be the same, just no indexes, and just read as a sequential file.
And oh.... RTFM :
for example: HP COBOL UserManual Order Number: AA–Q2G1H–TK January 2005
Processing Files and Records 6.3 Creating and Processing Files
Example 6–26 Creating and Populating an Indexed File
Good luck!
Hein.