Problem:
This error may be encountered when attempting to create an indexed file from a line sequential file maintaining the record format defined in the previous file. The loader is a C program which includes an FCD structure with the FCD3 format and a code which sets the value of the FCD field. It is set to OPEN OUTPUT and DYNAMIC ACCESS MODE.
This is a sample of the record to be loaded ; note that the records are not in ascending order.
X98699ESTERO URSS, 000000000000000000000000000000000000000000
X98999ESTERO YU, GR, TR, SYR, R000000000000000000000000000000000000000000
X99099ESTERO USA, CDN, DOM, 000000000000000000000000000000000000000000
X99199ESTERO AMERICA LATINA, 000000000000000000000000000000000000000000
X99299ESTERO MALTA, LIBIA, ETIO000000000000000000000000000000000000000000
X99399ESTERO ASIA, AUSTRALIA, 000000000000000000000000000000000000000000
X99499ESTERO CINA, GIAPPONE, 000000000000000000000000000000000000000000
X99599ESTERO AFRICA 000000000000000000000000000000000000000000
X99699ESTERO OCEANIA 000000000000000000000000000000000000000000
AP30 00 27
PP05 /70A4551/ ON LINE FORO
L40C***********************************4846F7****G7006300650066************07
L40P***************************************G6****N6***********************06
However, when the not ordered key is encountered, the following error is returned:
write error: status = 2/1
In older versions of the COBOL compiler (pre version 2.0.10) there were no problems when using the same C program and input files. However, from 2.2 onwards (including 5.0) the error occurs.
Clearly something has changed in the later versions of the product.
So, is iit possible to create an Micro Focus indexed file from a sequential file containing the record including the keys not in ascending order? If so, how?
Resolution:
The value used in the access mode byte of the FCD specifies only that this FCD uses a file status. It does not specify access dynamic so the 2/1 error is expected when inserting keys out of order.
However, it is true that the behaviour changed some time ago, where in past releases this sequence checking was performed on the basis of the K switch. At some point release or other, default behaviour was changed to be as expected with the option of a tunable to revert to previous.
To resolve this, either modify the C program to specify access dynamic, 0x88, or make use of the File Handler configuration option NOSEQCHECK.
#AcuCobol
#netexpress
#COBOL
#RMCOBOL
#ServerExpress