5 pts.
 How can I define a flat file in RPGLE?
How can I define a flat file in RPGLE?

Software/Hardware used:
ASKED: September 16, 2008  10:39 PM
UPDATED: September 19, 2008  11:49 AM

Answer Wiki:
Here is an example. It is based on a file which has the same file/record/field name. This happens when you create the file with the CRTPF and a length value. <pre> Fmyfile uf e disk rename (myfile : myRecord) F prefix (m_) D mystring s 15 C read myfile C eval mystring = %subst(m_myfile : 1 :10) C mystring dsply C eval m_myfile = 'xxxx' C update myRecord C eval *inlr = *on C return</pre>
Last Wiki Answer Submitted:  September 17, 2008  4:32 pm  by  philpl1jb   44,090 pts.
All Answer Wiki Contributors:  philpl1jb   44,090 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Here is an example. Note the “F” in format type & length of record on the file spec.
Also, not the use of I-Spec to define field(s) in that record.

     FFlatFile  IPE  F  130        Disk
     FNewFile   O  A E             Disk
     IFlatFile      01
     I                                  1  130  FLAT
      /FREE
       Field1 = %subst(FLAT:1:10);
       Field3 = %subst(FLAT:21:10);
       Write NewFileRF;
      /END-FREE                 
 3,115 pts.