The RP program is displaying records 11 times .But there
are 10 records in
a pf.(ie last record is displayed twice).How to
display records only 10 times?

Answers were Sorted based on User's Feedback



The RP program is displaying records 11 times .But there are 10 records in a pf.(ie last ..

Answer / sauml

in DDS sepc-

SFLPAG(10)
SFLSIZ(11)
RRN1 H 4 SFLRCDNBR
Rollup 27
in rpgiv:-

in D SPEC:-
SFLpag s 2 0 inz(10)
lstrrn s 4 0

In C Spec:- in load subroutine
Eval rrn = Lstrrn
*Loval Setll Rcd
Do SFLpag
Read Rcd
|
|
|
Eval rrn = rrn + 1
Write Sfl
Enddo
If rrn > 0
on SFLDSP indicator
Endif
Eval lstrrn = rrn

Hope it's enough for u to understand -----cheers

Is This Answer Correct ?    1 Yes 0 No

The RP program is displaying records 11 times .But there are 10 records in a pf.(ie last ..

Answer / ramesh

FPF1 IF E DISK
C READ PF1
C DOW NOT%EOF(PF1)
C ............
C ...........
C READ PF1
C ENDDO
C SETON LR

RPG400
FPF1 IF E DISK
C READ EMP 90
C DOU *IN90=*ON
C ............
C ............
C READ EMP 90
C ENDDO
C SETON LR

Is This Answer Correct ?    1 Yes 0 No

The RP program is displaying records 11 times .But there are 10 records in a pf.(ie last ..

Answer / mathan kumar

RPG400

FPF IF E DISK k
C *LOVAL SETLLEMP
C READ EMP 90
C *IN90 DOWEQ *OFF
............
C ............
C READ EMP 90
C ENDDO
C SETON LR

Is This Answer Correct ?    1 Yes 0 No

The RP program is displaying records 11 times .But there are 10 records in a pf.(ie last ..

Answer / vinits

dou %eof
read ....
.
.
.
.
enddo

Is This Answer Correct ?    0 Yes 0 No

The RP program is displaying records 11 times .But there are 10 records in a pf.(ie last ..

Answer / siva

Try this

Read File1
If %Found
Dou %Eof
|

|
Read File1
Enddo
Endif

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More RPG400 Interview Questions

Hi, Can anybody give me real sinario for SFLRCDNBR?with example?

2 Answers  


How to read a record from file where there is multiple record occurrence is available?

1 Answers  


How to code Page up and Page down in RPG for Single page subfile without using ROLLUP/ROLLDOWN in DSPF ?

3 Answers   HCL,


how to find whether a date format is valid or not in RPG400 not in RPGILE.Can you please write the coding for this sir,i'm new to AS400.Please help.

1 Answers  


Please tell me how to read the records from a file with load an array of size with error conditions(The logic answer for this question is ARR is array of 99 elements Z-ADD 0 IDX *LOVAL SETLL FILE READ FILE 99 *IN99 DOWEQ *OFF IDX ANDLT 99 ADD 1 IDX MOVE FIELD ARR,IDX READ FILE 99 ENDDO).So,Please give me the complete of this code.

0 Answers  






Hi guys, anybody know How RPG/400 code can be converted to RPG IV code with a single command?

1 Answers  


How to check which are the pgms using 1 perticulate file.? I know there is many tool available for X-reference...but need to know is there any command available in the system...?

4 Answers   IBM,


How to find d key field of a pf that doesn’t have source physical file?

2 Answers  


I want to declare the number of elements of an array dynamically in RPGLE ? Is it possible? If yes, then how do I do it ?

2 Answers  


How can we override a file during runtime in RPG? Without using OVRDBF or calling a CL program

1 Answers   UST,


what is use of sflnxtchg and use of MDT(modify data tag).both r same r not and can we use these on dspf and subfile.

2 Answers  


what is mean by *MAP and *DROP?what commands use these two keywords?why are they used?

4 Answers  


Categories