How to read alternative records in a pf by using rpg?

Answers were Sorted based on User's Feedback



How to read alternative records in a pf by using rpg?..

Answer / uday bagdi

we can create the pre-run time array so that data-base file come in our rpg program then we read that pre-run time array with loop and increment the array indexing by 2

Is This Answer Correct ?    7 Yes 0 No

How to read alternative records in a pf by using rpg?..

Answer / uday bagdai

1st set the pointer on the record(depend on rrn).after increase the rrn value by 2 (rrn=rrn+2).trape their on doweq loop so you can read alternative records.because (your pointer set on alternative records)

Is This Answer Correct ?    6 Yes 2 No

How to read alternative records in a pf by using rpg?..

Answer / abhishek

The first method is not very full proof. Actually it is not
necessary that RRN is always sequential.

Suppose initally there are 100 records in a file and so
does the RRN starts from 1 for first record and 100 for
last record.

If 1 record is deleted from the file RRN remains unchaned
and in that case adding 2 may cause a problem if system
does not get Record at that RRN it will read the next
sequential.

Is This Answer Correct ?    4 Yes 0 No

How to read alternative records in a pf by using rpg?..

Answer / ramrdy

hi uday,

can you write code for that program

Is This Answer Correct ?    1 Yes 0 No

How to read alternative records in a pf by using rpg?..

Answer / sreedhar reddy

Simple way is just read a PF process 1st record, then for second read ignore it. It is simple like having two read operations, first is at start of the loop and second is at just before end of the loop.

Is This Answer Correct ?    1 Yes 1 No

How to read alternative records in a pf by using rpg?..

Answer / mahalakshmi

All the records in a file is first loaded in to an datastructure and then incrementing the value of datastructure +2 then read the values in the datastructure.

Is This Answer Correct ?    0 Yes 0 No

How to read alternative records in a pf by using rpg?..

Answer / ramu

how to fetch alternate records from data base(pf) using RPG? (ex. 1st and 3rd and 5th .......etc)
I need Rpg code not theory?

Is This Answer Correct ?    0 Yes 0 No

How to read alternative records in a pf by using rpg?..

Answer / krishna

sample code for alternative record in a pf
fsamplepfif e disk
/free
dow not %eof(samplepf);
read samplepf;
If %eof(samplepf);
Leave;
endif;
---------;(doing some actions based on the conditions)
read samplepf;
enddo;
*inlr = *on;
/end-free

Is This Answer Correct ?    1 Yes 6 No

Post New Answer

More RPG400 Interview Questions

Why Rpg/400 is Famous?

2 Answers   IBM,


how do you use commitment control in rpg?

0 Answers   IBM,


I know chain keyword retreive records randomly but how chain keyword exactly works internally????

4 Answers  


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

1 Answers  


1) How to define keyed file in CL pgm. 2) How can i read particular records in CL pgm from database file.

2 Answers  


How can we know running job is batch or interactive?

0 Answers  


I have 1000 records in a file. I would like to generate 10 identical reports from this record with same format (structure of records) how do I do this?

1 Answers   IBM,


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

0 Answers  


A pgm subroutine calling child subroutine, that child subroutine again calling parent subroutine, u have 1000 lines of code, with out debugging , how can u find that error??? Is there any command to find errors in pgm???

3 Answers   HSBC,


Q1.How to read the Array? Q2.How to copy the content of one Array to another Array?

4 Answers   IBM,


Anyone help me for the below question:- If problem/error occur in *PSSR subroutine,how should I handel it in RPG program.

1 Answers  


WHAT IS MONMSG IDENTIFIER FOR STRTCPFTP command IN cl (as/400)?

3 Answers  


Categories