20 pts.
0
Q:
RPG procedure
Hello Martin,

Below is the codeline which i used for reading a DB file via RPG:

FMYFILE IF E K DISK
C READ PFRPG1
C DOW NOT%EOF
C NAME DSPLY
C ID DSPLY
C ADDRESS DSPLY
C ENDDO
C SETON LR

could you verify the code b'coz i am not getting the output.
ASKED: Nov 25 2008  5:32 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
24105 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
Hi,

Your code will only read the first record in the file, then keep displaying the three variables. You need another read in your loop. You should also set the pointer to the first key in your file (you have the file defined as keyed) using setll :-

FMYFILE IF E K DISK
C *LOVAL SETLL MYFILE
C READ PFRPG1
C DOW NOT%EOF
C NAME DSPLY
C ID DSPLY
C ADDRESS DSPLY
C READ PFRPG1
C ENDDO
C SETON LR

This should loop through displaying the values for each record.

Regards,

Martin Gilbert

If yhu are calling this program/not submitting it then you should have seen the first values.
Not getting any output .. make certain there are rercords inthe MyFile.
You can check this with DSPFD MyFile. Record count would be near the bottom.

Phil
Last Answered: Nov 25 2008  2:20 PM GMT by Philpl1jb   24105 pts.
Latest Contributors: Gilly400   23625 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



0