× 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.


  • Subject: Re: Reading a Flat File
  • From: Jim Langston <jlangston@xxxxxxxxxxxxxxxx>
  • Date: Fri, 05 Nov 1999 08:07:22 -0800
  • Organization: Conex Global Logistics Services, Inc.

A "flat file" is a file without DDS.  S/36 files with just their two fields,
K000001 and F000001 are considered "flat files".  A file transferred
from a PC to the AS/400 is considered a "flat file".

Any file that's not a DB2 file is a flat file.

Now, the best way to read them, there are 3 or so ways.

The way I normally do it is I create a DDS for the file, compile it, then
copy the flat file to the DB2 file with FMTOPT(*NOCHK).  Then read
it the same as any other AS/400 file.  This is the best way, IMO.

Second best way to do it, is make it an internally described file, and give
the file layout in the I specs of your RPG program.

Lastly, instead of using I specs create D specs for the layout.  Define the
file as one huge field and move the buffer to the your DS.  This is doable,
but I don't know why you would want to do this instead of using the I
specs.

Regards,

Jim Langston

"Stone, Brad V (TC OASIS)" wrote:

> What's a flat file?  One that's not bumpy?
>
> My apologies.  Our sys admin made me say this.  He says he's never heard it
> called a flat file and wants to know what the opposite of a flat file would
> be.

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


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.