1. Last statement of any RPG pgm is LR?

Not necessarily. LR is generally set on after all
processing is doen i.e. at the end of the program but there
is no hard and fast rule for that.

2. Maximum how many fields we can create under a record format of PF?

We can give max of 8000 fields in rec format of a PF.But it
also depend on the no. of bytes occupied by the record
formate.Because rec. format of PF may occupy atmax 32766
bytes.ie if there is only one field which occupy 32766
bytes then we can't define a new field in record format.
so it depend on the no. of bytes occupied by the field
defined in the record format.
Char field - max value(32766 bytes)
variable length field - max value(32740 bytes)
allow null field - max value(32765)
variable & allownull field - max value(32739)

3. How many max. Record format a logical file have?

8000. this can vary,can be lesser if date format,
alphanumeric fields are used.

4. Why Journalling is compulsory before Commitment Control?

Commitment ctrl is use to save /rollback the group of
chages and Journalling is use to save the changed records
in Jorunal reciver.

5. Why we create the Physical File Member?

A member is like an Individual file.It is possible to Have
32767 such members within the same PF.Each member added to
the file will exactly get the same record format(
fields,types and KWDS) on the file.This facility is
provided to meet the requirement when many files are needed
to be created with same structure.Here just Create file
once with MAXMBRS(as many reqd) and ADDPFM will do it.Easy
to create and maintain as a single object.Each member is
identified by unique name within file.
Examples : A School has attendance register per class. Each
Class has 4 sections and in all10 classes. Instead of
Creating and maintaining 40 files and scaterred in a
library, one can create a PF and add 40 members in one
Secondly All Physical files created need not necessarily
have members. Some files are created to store field
definitons only and are called field refrence files. They
need not have members.

6. Is Constent can be define as a key field?

Firstly a Constant cannot be a part of a File field list.
There is no meaning in having a Constant in the Key field.

7. Is it possible to create a logical file whose Physical file is not in same library?

Yes, Just put the user library in which you want to create
on top and followed by other library in which physical file
is located.

provided the first library should not have physical file.

Then try to create the logical.

8. How to add a field to a PF and compile it without loss of data?

First Add the fields whatever you want

then use CHGPF command

Physical file . . . . . . . . . > MyPf
Library . . . . . . . . . . . MyLib
System . . . . . . . . . . . . . *LCL
Source file . . . . . . . . . . MYSourceFile
Library . . . . . . . . . . . MyLib

Update the Physical file.No need to compile again.

10. Suppose i have a PF,it contains 5 members,how to access particular member data from logical file ?and what is the use of member in PF?

A1. Reading member 5 of myfilepf

A2.For accounting purpose each month data can be stored as
12 different members.
So that we can easily access one month data or 12 months
Easy to maintain 12 members in one PF file instead of 12 PF

Download Interview PDF