Periodgroup field in Format buffer

As per the documentation of format buffer, a periodic group field can be specfied as follows.

Would it be possible to specifiy the fieldname alone, What would happen in that case? Is it “Periodic Group Occurrence (ACBISN)” relevant for that case?

Hello cobp3,
this is a good question.

In general the occurrence needs to be specified with the format element for the field otherwise Adabas returns response 41.

However, with the L9 it is possible to omit the occurrence number because it is ignored in the format element.

The L9 takes the returned value from the index and not from the compressed record. In the index, the occurrence is appended to the value and on the ascending L9 same values are returned with ascending occurrence number in the ACBISN field.

In order to only select values from one occurrence specify the occurrence number in the search buffer.

Kind regards,
Marbod Mueller

Hallo Marbod,
Thanks for the reply. That means if occurence nr. is not specified in searchbuffer, the result would be all possible combinations of (value, occurencenr) on repeated invocation.

e.g if field has 3 occurences and field has values (“A” in 2 and 3 occurence, “B” 1 and 2 occurence) then on repeated invocation the result would be

“A” -
2 (occurence nr in 1 invocation)
3 (occurence nr in 2 invocation)
“B” - 1 (occurence nr in 3 invocation)
2((occurence nr in 4 invocation)

right?

btw, For adabas response code 41, how the subcode can be found?

When additions-2 is redefined as PIC 9(5) BINARY (which is exactly 4bytes) value is 689766400. when the last two bytes are redefined as BINARY the result is Zero.
How this an be determined?

Nope, S9(5) BINARY is a halfword (2 bytes), S9(9) would be a fullword(4 bytes).

But that doesn’t help you here, because Rsp 41 doesn’t have a subcode, but:

If available, then the short name of the field for which the error occurred is stored in the leftmost two bytes of the Additions 2 field

compiler COBOL85 V02.3A12 on Bs2000, listing shows 4 bytes for the definition, 9(5) BINARY.

ok, thanks.