reason for getting defaults value?

1,485 pts.
Tags:
PF/LF
RPG
RPGLE
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.
ASKED: September 14, 2008  6:31 AM
UPDATED: September 15, 2008  1:40 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following