Hi,Please give me complete code with this logic.
The question is how to read the records from a file with
load an array of size with error condition?
(The logic is
Z-Add 0 IDX
*LOVAL SETLL FILE
READ FILE 99
*IN9 DOWEQ *OFF
IDX ANDLT 99
ADD 1 IDX
MOVE FIELD ARR,IDX
READ FILE 99
ENDDO)please give me complete code with
explanation?



Hi,Please give me complete code with this logic. The question is how to read the records from a fil..

Answer / indraneel

Z-Add 0 IDX --- Initialize a array index field to 0
*LOVAL SETLL FILE -- repostion pointer to a file.
READ FILE 99 -- read file (EoF indicator is *in99)
*IN9 DOWEQ *OFF -- read FILE till EoF not reached
IDX ANDLT 99 -- and array index is less than 99
ADD 1 IDX -- add one to index
MOVE FIELD ARR,IDX -- moved data from FILE (field)
to array ARR(1)..
READ FILE 99

This code is reading records from a file and moving the
FIELD data to a array..

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More RPG400 Interview Questions

Suppose i am having 3 programs PgmA,pgmB,pgmC and using source debugger. At debugging time i found that pgmC having some code error..then in debug mode directly how can i debug pgmC

2 Answers  


How to print Superscript / Subscript from RPG400

1 Answers  


What is the difference between inner join @ outer join

4 Answers  


i hav 2 logical files(L1,L2) both r derived from one physical file(P1). how can i use both the logical files in one RPG program? if yes what i have to d.

5 Answers   TCS,


What is the RPG cycle?

3 Answers   CSC,






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

4 Answers  


How do you do indexing in a physical file?

2 Answers  


When we have a file with Duplicate records and I want to read the unique record from the file. For example a file containing Emp Name as 'Ram' and there are 3 entries of it. So how to read a unique record from File?

0 Answers  


steps involved in debugging and types of debugging modes?

1 Answers  


what is *place and *auto keyword in prtf ?plz explain

0 Answers   CSC,


In ProgramB there is a SBMJOB, which is a call to program C .There is also a CALL to program D from B. How would you check the program C has been executed in D?

4 Answers  


One of the job in subsystem is in Running status,expected time to complete this job is 2 minutes. But from last 5 -10 minutes this job is still in running status....What are the possible reasons...and What are the actions i need to perform to check this...?

4 Answers  


Categories