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



While we're discussing "flatfiles", one of the features of WRKDBF that is
frequently overlooked is the ability to work with "flatfiles" as if they
were externally defined.  For those of us who have to work with these
flatfile beasts, it is a lifesaver and a timesaver.

Basically, you key in the RPG "F&I" specs that define your flatfile's
record length, key length and starting position, record ID details, and
field from and to's, and WRKDBF uses these to present you with a "virtual"
externally described flatfile.

For example, let's assume I have an 80-byte FLATFILE that has two different
record types ("A"ctive & "C"ancelled status), a Product ID key field in
position 1 to 5, and several data fields.  Assume also that I have stored
the following "F&I's" in an RPG source member named "FIFLATFILE":

     FFLATFILEIF  F      80  5AI     1 DISK
     I        NS  01   6 CA
     I                                        1   5 PRODID
     I                                        6   6 STATUS
     I                                        7  132PRICE
     I                                       14  53 DESCRP
     I        NS  02   6 CC
     I                                        1   5 PRODID
     I                                        6   6 STATUS
     I                                        7  120CANCDT
     I                                       13  13 RSNCOD
     I                                       14  23 USERID

Now at a command line, these "F&I's" can be accessed by:

     WRKDBF  FILENAME(FLATFILE)  FLATFILE(*YES)

There are optional command parameters where you can name where the source
member resides, but assuming the proper naming structure, this is all that
you need on the command.  Now you'll see the file with the keys and fields
broken down, records separated, and most of the functionality of WRKDBF
(including SQL!) is available to you.

Bill

--

NOTICE:  The information contained in this electronic mail transmission is
intended by Convergys Corporation for the use of the named individual or
entity to which it is directed and may contain information that is
privileged or otherwise confidential.  If you have received this electronic
mail transmission in error, please delete it from your system without
copying or forwarding it, and notify the sender of the error by reply email
or by telephone (collect), so that the sender's address records can be
corrected.




As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.