940 pts.
 reason for getting defaults value?
i have a file p1 (pf) and one one display file d1 whose fields are taken as reference (using f10) from p1 when i write a simple rpgle pgm to write records from display file in to file p1(pf) using following code: fp1 uf a e disk fd1 cf e workstn c *in03 doweq *off c exfmt rec1 c write rec c end c seton lr then when ever i insert 1 record then 1 more blank record is also inserted in to my pf( which has 2 fields eid(3p) and ename(8a) i get 0 in eid and blank in ename fields.this happens every time whenever i insert any record.plz give me appropriate suggestion to remove this error.

Software/Hardware used:
ASKED: September 14, 2008  6:31 AM
UPDATED: September 15, 2008  1:40 PM

Answer Wiki:
It's the sequence you're using. You make an entry and press enter - good record is written Your program has looped to exfmt rec You press f3 The next statement is write rec .. so you write the second record Two solutions * 1. this uses textbook logic with primary and secondary input c exfmt rec1 c *in03 doweq *off c write rec c exfmt rec1 c enddo c seton lr * 2. logic used frequently in RPG 400 c *in03 doweq *off c exfmt rec1 c if not *IN03 c write rec c endif c exfmt rec1 c enddo c seton lr
Last Wiki Answer Submitted:  September 15, 2008  1:40 pm  by  philpl1jb   44,630 pts.
All Answer Wiki Contributors:  philpl1jb   44,630 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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