30 pts.
 About FLAT FILE ?
I am working on V4R4M0 .
I would like to know clearly about a Flat File , its uses, and how can we enter data into it ? how to fetch data from it ?

Thanks in advance
ASKED: May 29, 2010  7:15 AM GMT
UPDATED: June 4, 2010  7:53:06 PM GMT
2,310 pts.

Answer Wiki:
Using a flat file on the IBM i is just a file with one big field defined in a physical file that contains all of the data. You define the fields in a high level language program like COBOL or RPG. Then the file is read sequentlially record by record to retrieve the information you want.

It usually was seen when you converted to a System 38 from a System 3, system 34 or System 36 which did not have an integrated database like the System 38, AS/400, iSeries, System i or IBM i today.

If you can find the starting and ending point of key fields you can create keys that can be used to read the file in key order or go to a set of records in a much shorted method than just reading the file sequentially.

Lovemyi
Last Wiki Answer Submitted:  May 31, 2010  3:06 PM (GMT)  by  Lovemyi   2,310 pts.
To see other answers submitted to the Answer Wiki View Answer History.
Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _




 

This could be a text file in the IFS or a single field file in the DB2
These files can be created using various copy commnds, queries, Sql or programs.
These are often used to import/export data.
Phil

 36,400 pts.

 

You may also CHAIN by rrn (relative record number) if file is a DB2-file.
If f.x. you have some data with numbers as id’s (ex employe numbers 105->125), it is possible to place these data in 20 records which you access via CHAIN - just subtract 104 from the emp.no. first. The solution requires all 20 records to exist in the file.
This kind of solution is possible, but NOT recommented.

DanF

 2,540 pts.

 

If you know where the fields begin/end you can define them in a data structure or
define the programaticaly. Somtimes flat files come from an external source or are created for external sources with a predefined record length.

Things that come to mind that we use them for here are some EDI formats and bank tranfer files that have mutliple record formats in the same file defined by a code.
ex. A code 1 record has 5 fields, the code 2 record has 3 fields, the code 7 has 8 fields all with a record length of 80 chars.

 1,480 pts.