× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



> Madhu wrote:
> I'm new to programming, I don't know what differance does it make
> Reading the File and Reading the Record Format of the File.
> Anyone, please explain.


For consistency, it is best to use externally described files and then use
the file operations against the record format names.
Having said that, some file operations can be done only against the file
name in an RPG program, some can only be done against the record  format
name, and some can be done against either.

For example,

CLOSE, FEOD, OPEN, POST, and UNLCK can only be used against the file name.

CHAIN, DELET, READ, READE, READP, REDPE, SETGT and SETLL can be used against
the file name or the record format name.

READC can only be used against a subfile record format name.

UPDAT and WRITE can only be used with the record format name if the file is
externally described.  These operations can be performed against the file
name if the file is program-described, with the restriction that a data
structure containing the fields to update/write must be specified in the
result field.

There are times when it is necessary to use the operation against the file
name.

Example:

I have a multi-format logical file built over the sales order detail file
and the sales order detail history file.  If I want to process the records
from the multi-format file in a similar fashion as processing the result
table created by an SQL union over the two files, I can use SETLL against
the file name and use READ or READE against the file name instead of using
the record format name(s).

In this fashion the records are read from the union of the two files.  Each
time I read against the file name I get a record, but it could be from
either of the physical files comprising the multi-format logical.  My
program doesn't care.


The iSeries web site has some excellent reference material on RPG
programming. See the RPG400 reference at:
http://publib.boulder.ibm.com/iseries/v5r1/ic2924/books/sc09-1817-00-3.html
or the ILE RPG reference at:
http://publib.boulder.ibm.com/iseries/v5r1/ic2924/books/c092508302.htm#ToC

I would also advise you to buy one or more of the excellent books on RPG
programming that are listed on the bookstore link (see
http://store.midrange.com/ or www.midrange.com ).  No offense, but based on
your question, it sounds like you may need them.  I would recommend "The
Modern RPGIV Language" by Bob Cozzi, and  "Control Language Programming for
the AS/400" by Bryan Meyers.

Steve Landess
Austin, Texas
(512) 423-0935

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.