iSeries – CL program record update.
Posted by QB on June 7, 2008
CL programs can read and update database records as well as read and write formats. CL programs can’t handle large database effectively so it is not good practice to update records from CL programs.
The simple example of CL program record update.
DCL Var(&FileName) *Char Len(10)
DCL Var(&LibName) *Char Len(10)
ChgVar Var(&FileName) Value(‘AcctPayble’)
ChgVar Var(&LibName) Value(‘Accounts’)
Read: RCVF /* Read the first record */
MonMsg MSGID(CPF0864) EXEC(GOTO CMDLBL(EOF))
Process: Do your processing here….. whatever it may be
SndF /* Update record after processing */
EOF: /* End Of File */
Very simple program to update database.
Update : CLLE program did not update keyed database. It works well for SDA formats. Did not try to update sequential file yet.