How do I read records from Subfile? what is the purpose of
READC explain with example?

Answer Posted / ravi

When you declare SFLNXTCHG in the DDS. You can use READC opcode to find the changed records in the subfile. The MDT will be ON on the changed record. Once you read the record, it changes to off. This is how system identifies the changed records sequentially.

Best example is do WRKMBRPDM, it is nothing but a subfile. You can see all source members in your source file. Correct?

Now, enter display (option 5 i guess?) on say 5 sources and press Enter, control goes to the fisrt source and press enter, control goes to the second source etc.. isn't it?

That is nothing but READC usage.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create a login screen using a command instead of display file.... intention is to get a password field on a command..... how do you achieve this...

1306


what is data area and how it is used in rpg program ?

752


How do u design a physical file, when you have 2 Unique fields like for eg in A student file student ID and student examination no both are unique

546


How to write record if no field or the field are different in physical file in rpgle ?

483


What is the difference between copybooks and subprocedures in as400?

801






what is program status data structure?

1375


Explain mdt?

663


What is the difference between iter and do?

668


When it is desirable to describe files Internally?

1182


how do I preserve and clean the array?

669


what is the difference between do while and do until?

701


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?

1449


What is file identifier where we can use?

639


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?

496


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

740