+2 votes

1 Answer

0 votes
by

The DBADD command adds a new LREC to a subfile , Facilitates addition of LREC BEFORE or AFTER the current LREC , At a position in the subfile as defined by keys and organisation , By supplying a LRECNBR or at the end of the subfile

Mandatory Parameters for DBADD

REF= | FILE=  (or both)

NEWLREC= | NULLREC =

NEWLREC :  Specify  the   address  of  the  new  LREC to be  added  as the  argument ,   can  specify  a  label

 (Length > 3) , A/label or a register , For Variable length lrecs size and key should have been set up in the new LREC

NULLREC : To add an empty LREC to a subfile  , specify a location that contains the length of the empty LREC (register|label|A/label) and the primary key of the empty LREC , Adding a NULLREC to a UP/DOWN organised subfile might corrupt the organisation . Normally used with W-type and T-type files

EXAMPLE :

DBADD REF=TRABSQ,NEWLREC=EBW000,UP

KEY1=(R=TRABKEY,S=EBW002),

      KEY2=(R=TRABAWB,S=EBW003,L=L'TRABAWB)

DBADD FILE=WRXXSQ,UP,PKY=#WRXXK10,REG=R5,

      KEY1=(PKY=#WRXXK10),NULLREC==AL2(#WRXXL10),

      ERROR=ADDERROR

...