What is significance of a file designated as a Primary file
in Rpg400 program....also what's use of secoundry file



What is significance of a file designated as a Primary file in Rpg400 program....also what's u..

Answer / abhishek bajpai

Primary File is the one which uses the RPG logic cycle. It
is defined in the F spec as:
FABPF1 IP E Disk
Here, ABPF1 is primary file.
For a primary file we cannot use any operations like Read,
Reade, Chain etc. It automatically reads from the 1st to
the last record and executes the program from the 1st to
the last line. A program can have only 1 primary file
defined.
Secondary file is exactly like the primary file in
functioning except that the program starts processing the
secondary file only when the EOF is found for primary file.
A program can have multiple secondary files defined in it.

Is This Answer Correct ?    5 Yes 0 No

Post New Answer

More RPG400 Interview Questions

list down and describe the sub systems vailable

5 Answers   IBM,


i)What is the command to lock a file in a program ii)2. Can you get a level check error in a CL program

6 Answers  


To check the locks , we use cmd WRKOBJLCK , but how we confirm whether it's objeck lock / member lock. I confused with the Lock type and Status values...Can any body please tell me ...

5 Answers  


A rpg or clp command to find if the file field is defined as a character or numeric field.

1 Answers   IBM,


Assume 2 users are using the same file and first user updates some record in the file. Will the 2nd user will be able to see the updated record or not?

0 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,


difference between 1:%found and %equal built function in detail with example .

6 Answers   Polaris,


Mr.Sidc sirfor my question{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} you have answered using MOVE opcode,can you illustrate me with a small example sir very kind of you.

1 Answers   CTS, IBM, iGate,


how we retrieve records without using key field (ex:name) from Physical File through RPG in as/400?

8 Answers  


Setps to create .csv file on IFS folder in AS/400( V4R3)....?

3 Answers   TCS,


i have 1000 records in pf.what are all the ways to read a particular name records in rpg?? ie.. in pf i have a name called demo appeared around 52 times hw will we read this particular records in rpg/400?.

11 Answers   IBM,


how can an indexed file be used as arrival sequence in RPG?

3 Answers   IBM,


Categories