ADABAS Descriptor and NATURAL Redefine

Hello all,

We are faced with expanding the size of one of our elements. The ADABAS file contains descriptor, CONTROL-KEY. The CONTROL-KEY descriptor is redefined in our NATURAL programs. The element that must be expanded is part of the CONTROL-KEY redefinition. We need to increase the size without affecting the current data. In other words, the elements following field11 must contain their current data after FIELD11 is increased. Any suggestions will be much appreciated.

An example to clarify:

ADABAS File
1 EXPEND-ACCT-FILE
2 CONTROL-KEY A78

NATURAL program
1 EXPEND-ACCT view of EXPEND-ACCT-FILE
2 CONTROL-KEY
2 REDEFINE CONTROL-KEY
3 field1 A2
3 field2 A4
3 field10 A3
3 FIELD11 A1 <— need to increase size
3 Field 12 A2
3 field 20 A2
2 EF-SUBJOB

If CONTROL-KEY is a super-descriptor, then use Adabas utilities to release the key, change its definition, and re-invert. In Natural, change the DDM to increase the sizes of CONTROL-KEY and FIELD11, and change your program to increase FIELD11.

If CONTROL-KEY is a descriptor (ie CONTROL-KEY is an elementary field), then use Adabas utilities to release the descriptor and increase the field’s length. Create a program to update CONTROL-KEY, inserting blanks to increase the length of FIELD11.

In your example, there are 10 bytes up to the end of FIELD11, so you want to move the contents of CONTROL-KEY starting from position 11 to the right. To increase by 2 bytes, insert 2 spaces.

DEFINE DATA LOCAL
1 EAF VIEW EXPEND-ACCT-FILE
  2 CONTROL-KEY
END-DEFINE
READ EAF BY ISN
  MOVE SUBSTR (CONTROL-KEY, 11) TO SUBSTR (CONTROL-KEY, 13)     /* 2 bytes
  MOVE '  '                     TO SUBSTR (CONTROL-KEY, 11, 2)  /* 2 bytes
  UPDATE
  --  ET logic --
END-READ
END TRANSACTION
END

Then re-invert CONTROL-KEY.

Ralph,

Thank you for sharing.

Maricela