HOME  NEWS  FORUM  DOWNLOAD  LINK
OpenCOBOL - an open-source COBOL compiler
Main Menu
Download
Documentation
Development
Who's Online
16 user(s) are online (4 user(s) are browsing Forum)

Members: 0
Guests: 16

more...
Powered by
SourceForge

Xoops

Creative Commons

OpenCOBOL Forum Index
   OpenCOBOL
     Split Keys
Register To Post

Threaded | Newest First Previous Topic | Next Topic | Bottom
Poster Thread
wmklein
Posted on: 2012/9/5 20:51
Home away from home
Joined: 2008/12/27
From:
Posts: 327
Split Keys
Human (and/or others) (follow on to the "porint Micro Focus" topic, but limited to split keys)

My memory from when I last looked at it, was that Micro Focus and the ISO Standard's support for "split keys" is EXACTLY the sam functionally, but different in the syntax used.

Is this correct (from what you have looked at) or are there any funcitonal differences between the two?
human
Posted on: 2012/9/6 11:07
Home away from home
Joined: 2007/5/15
From: GERMANY
Posts: 1416
Re: Split Keys
The only syntax difference for split keys is SOURCE IS in ISO:
ALTERNATE RECORD KEY IS record-key-name-1 SOURCE IS { data-name-2 } ...
to = in MF/ACU
ALTERNATE RECORD KEY IS record-key-name-1 = { data-name-2 } ...

Functional difference for alternate keys (including split keys or not):
In ISO (and ACU) all keys have to be identical used in all programs, Quote:
ISO/IEC 1989:20xx CD 1.2 (E), 12.4.4.5.3 [...] The number of alternate record keys for the file shall also be the same as that used when the physical file was created.
From the other thread I guesses it's not true for MF. This is the reason why I wrote that behaviour should NOT change by default but via an environment entry or config/compile flag. I just read the same rule in MF docs but there's a sentence added, Quote:
This checking is configurable in some environments. (Look up the KEYCHECK parameter in your COBOL system documentation.)
--> This is the way it should be done in OC, too.

Simon 'human' Sobisch
wmklein
Posted on: 2012/9/7 3:41
Home away from home
Joined: 2008/12/27
From:
Posts: 327
Re: Split Keys
As you say, the "identical" thing is NOT limited to split keeys. In fact, IBM mainframes (which I think is still the largest base of COBOL programs) does NOT enforce the "same number and location of alternate keys" requirment.

As I have (always?) read the STandard, it does (and HAS) defined how things work if the keys are identical (same number, location, etc) but does NOT define what happens if they are not.

There are two (at least) possible behaviors when there are mismatches.

1) Get FS=39 on an OPEN when the keys don't match (for OPEN INPUT or I-O, maybe OUTPUT). However, FS=39 really is an implmentor defined condition as to WHICH "permanent file attributes" need to be checkede.

2) If you WRITE to a file in a program without one (or more than one) possible alternate keys, then it may or may not be possible to use them again in a program that DOES have them.

On IBM mainframes "IDCAMS" and related software make certain that alternate keys that are defined for a file when it is defined, are ALWAYS available to any program using the file. However, I do not think this is "universal" among COBOL implementations.
Threaded | Newest First Previous Topic | Next Topic | Top

Register To Post
 
Copyright (C) 2005 The OpenCOBOL Project. All rights reserved.
Powered by Xoops2 | PHP | MySQL | Apache
ocean-net