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?
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 |
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?
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?
WHAT IS MENT BY RECORD LEVEL IDENTIFIER ? WHAT IS THE PURPOSE OF THIS?
how do I declare a table or array in rpg iv?
Q1.How we can copy the data of file one session to another session? Q2.how we can execute a loop infinitely in AS/400 coding? Q3.In ALDON tool,multitask is posible on a perticular object by the user?
What is I90(Insure 90)?
Some times While checking MSGW for object / member / record locks ,I have seen it's locked by itself ...? How it happen and what action we need to perform if job is updating / writing a record....?
How to get only unique records from a file which contains duplicate data using CPYF command ? Example : FILEA has duplicate records and FILEB is a UNIQUE defined.... and I want to get the data from FILEA to FILEB by eliminating all the duplicate records...
steps involved in debugging and types of debugging modes?
what is plat file?
1.What is the Maximum field length we can declare in RLU?? 2. What is the difference if your designing RLU using DDS and using the option 19 for the RLU??
Can an indexed file be accessed in arrival sequence in RPG?