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

WHAT IS MEANT BY SIGNATURE VAILOTION ERROR

1 Answers   IBM,


What is Multi Occurrence Data Structure(MODS)?

1 Answers   CTS,


How to create a key field for a logical file inside RPG?

4 Answers   HSBC,


how to convert date format from one format to another i think in CL/400 its CVTDAT,Please tell in RPG/400 sir not in RPGILE

3 Answers   iGate,


How to change the name of physical members Dynamically?

1 Answers  






Can we trigger an rpg program which has user interaction with display file when updating a file using the command ADDPFTRG?

2 Answers  


Errors in Sql query will be in which state?

1 Answers  


1.Suppose my file has 10 fields and I want to make the 2nd field Zeros in all records. And assume I have millions of records and I dont want to read each record and update the desired field with 0. Any other way to do this in one step operation? 2. Assume my file has 100 records and I want to see only first 10 records. Is this possible through LF? 3.I have 3 jobs A B and C. I want to submit B after successful completion of A and want to submit C after successful completion of B. Without using job scheduler or job queue, how can i do that through CL program? 4.What is difference between Bind by copy and bind by reference?

4 Answers   Virtusa,


3. Given the DOS Specification below and the following information: • Indicator 50 is off • No records have been written to the subfile What will be the result if the EXFMT operation code is performed on the record format CTLR? A R SUBFL A DESCRIP 101 6 1ODSPATR(UL) A DFT(’NOT FOUND’) A R CTLR SFLCTL(SUBFL) A N50 SFLDSP A SFLDSPCTL A SFLINZ A 67 SFIJEND A SFLSIZ(13) A SFLPAG(12) A ACCOUNTNO 100 S 10 a.) Only AccountNo will display b.) SUBFL will be initialized with 13 blank records c.) An I/O exception error will occur d.) The screen will display 12 records with ‘NOT FOUND’

4 Answers   IBM,


1.Where we declare Variables in RPG/400,RPGIV,RPGILE.? 2.When do we use D-spec and I-spec in real time ?.what is difference between them?

1 Answers   HP,


wat is curser?? and its types???

4 Answers   HSBC,


Hi friends, Can you give the solution for the below mention simple code.and explain.what is output D CHR1 S 4A INZ('PEN') D CHR2 S 10A INZ('MYGET') D CHR3 S 8A INZ('GOOD') D CHR4 S 22A INZ C MOVEL CHR1 CHR4 C MOVE CHR2 CHR4 C EVAL CHR4=CHR3 C MOVE CHR1 CHR4

4 Answers  


Categories