Qur’an – Bible.

* Religion * Politics * News Networks * Mainstream Media Biased Reporting * Independent Analysis

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.

PGM

DCL Var(&FileName) *Char Len(10)

DCL Var(&LibName) *Char Len(10)

ChgVar Var(&FileName) Value(‘AcctPayble’)

ChgVar Var(&LibName) Value(‘Accounts’)

DCLF File(&LibName/&FileName)

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 */

GoTo Read

EOF: /* End Of File */

EndPgm

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.

2 Responses to “iSeries – CL program record update.”

  1. janitor said

    isnt SNDF only for display files? or is it now working with DB files also?

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>