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

2. Which of the following statement(s) explains the difference(s) between the /INCLUDE and ICOPY directives? a.) No difference, they function the same b.) ACOPY cannot be used as a conditional directive c.) IINCLUDE files cannot contain embedded SQL d.) Nesting /TNCLUDE directives is not allowed

2 Answers   IBM,


which program rpg or cl is efficent to update a transaction onto a database file and why ?

0 Answers   IBM,


suppose i i am changing / updating record of subfile and i want to change the record in reverse order . means i want to change the bottom record first and so on through readc . how i do it please any one explain .

4 Answers   CSC,


Suppose we have one database file and it is used by 5 programs and in 3 program we have to add some records in datbase file s what is the impact on other program?

0 Answers  


Difference between RESET and CLEAR

1 Answers   TCS,






I am Submitting one job in batch that job calls three progams(PGMA, PGMB, PGMC). PGMB should be called after sucessfully completion of PGMA as like for PGMC also. So Can you please tell me how can we do that (without using data area)

2 Answers   CTS,


how we retrieve records without using key field (ex:name) from Physical File through RPG in as/400?

8 Answers  


difference between 1:%found and %equal built function in detail with example .

6 Answers   Polaris,


CAN WE READ RECORDS WITHOUT USING SETLL,READ,CHAIN IN RPG?

6 Answers   Satyam,


Are all these RPG/400 Interviewed Questions being asked recently? are current?

1 Answers  


suppose we have 10 members in physical file and i have to use 4 out of 10 so how can we read this in RPG

3 Answers   TCS,


1) How to declare a file? 2) How to define a display file? 3) How to monitor error messages in RPG? 4) How to find the attributes for subfiles? and what is the DDS for subfiles?

2 Answers   TCS,


Categories