There are two excellent iSeries NEWS articles that describe how to process database files from a CL program. These articles are available to iSeries Network Professional members:
Processing Database Files with CL
This tutorial was excerpted from the book "Starter Kit for the IBM iSeries
and AS/400."
http://www.iseriesnetwork.com/article.cfm?ID=13968 [1]
CL Flexes Its Database Muscles
This article provides a set of database I/O commands that let you OPEN,
CLOSE, READ, UPDATE, WRITE, DELETE, and UNLOCK a record, as well as POSITION
a file cursor in a database file, and retrieve and change a named field --
all from your CL programs.
http://www.iseriesnetwork.com/article.cfm?ID=7217 [2]
The article source code is available here:
http://www.iseriesnetwork.com/resources/code/index.cfm?fuseaction=ShowAllIssueCode&IssueSelect=Past&IssueYear=2000&IssueMonth=05 [3]
Links:
[1] http://systeminetwork.com/article.cfm?id=13968
[2] http://systeminetwork.com/article.cfm?id=7217
[3] http://systeminetwork.com/resources/code/index.cfm?fuseaction=ShowAllIssueCode&IssueSelect=Past&IssueYear=2000&IssueMonth=05