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.

Advertisements

3 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?

  2. Anonymous said

    It does not work…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: