There are a variety of ways to update a file from a CL program.
The standard i5/OS provided commands do not provide this capability, but a CLLE program can utilize the C language runtime APIs (giving CL the same capability for file IO which is found in the C language) assuming you are on V5R4. These C runtime APIs are provided as part of i5/OS independent of whether or not you have the C language compiler installed.
There are also several ways to execute a SQL function within a CL program.
Bruce Vining Services
As noted, the answer is “Yes.” But the answer might continue with “Why would you want to?” Using CL to update files is more troublesome and complicated than simply writing a RPG routine to do the work and calling it. If not RPG, then COBOL and sometimes even C.
If lack of compilers is the problem, then calling a REXX procedure can even be a better choice. REXX can use embedded SQL even without the SQL Development Kit installed.
Whether it <i>can</i> be done isn’t exactly the same as whether it <i>should</i> be done. Using system quirks isn’t always the best technique.
A few things have changed since 2007 when the question was originally posed (thanks Tom for updating this question so it’s “seen” again).
With the <a href=”http://www.powercl.com/”>Control Language for Files (CLF)</a> product CL commands are now available to update records in a file (along with read, write, delete, etc — in fact, CLF provides database capabilities that are not availabe with RPG, COBOL, and/or C!).
Calling another program, rather than using a CL command, to update a record is certainly an alternative. Some though find passing, back and forth, all of the fields as parameters to be error prone and not necessarily a good use of a developers times (that is, providing the initial linkage between programs and maintenance if/when the record layout changes).
End vendor response