|AS400 Interview Questions and Answers part16|
Q1: How to retrieve RRN value in the RPGLE program?
Relative Record Number (RRN) is associated with every record of a file, it also identifies which position in a file the record is in. for example, a record has an RRN of 6 there does not have to be 5 records before it.
Q2: Difference between CHAIN and READE?
CHAIN and READE are two operation codes in the RPG program. CHAIN will retrieve one record and READE will retrieve one or more than one record. Basically, CHAIN retrieves the exact matching of the record whereas READE retrieves all the equal records.
Q3: What is the benefit of using Externally Described files over Internally Described files?
Externally Described files are easy to manage because they are created separately from the program and also they can be used in any of the programs the system, In the case of Internally Described files, there is no benefit because they are defined internally in the program and cannot be used anywhere else.
Q4: What is the function the of CRTDUPOBJ command?
The Create Duplicate Object (CRTDUPOBJ) command creates a copy of a single object or a group of objects. For more details please refer to the following link created Create Duplicate Object (CRTDUPOBJ) command in AS400.
Q5: How can you identify the End of the file in the CLP program?
The mon message-id for checking the end-of-file is CPF0864 and this message id helps us to check whether the end-of-file has been reached or not while reading a file.
Q6: What controls which printer a report goes to?
When the report gets printed, it should go to the printer to get printed and there is a parameter named OUTQUEUE which basically controls the printer for printing a report.
Q7: Can we use multi-format LF in CL program?
We cannot use multi-format LF in CL program instead we can use the single format LF in the CL program.
Q8: What is the significance of UDATE?
It gives us a date when the job is actually entered into the system or became active. It does not provide the current system date.
Q9: Can we copy the records created by the OPNQRYF to other files and how?
Yes, we can copy the records created by the OPNQRYF to other files and there is a command available in the IBM i named Copy From Query File (CPYFRMQRYF) and this command basically copies the records which are created by the OPNQRYF command.
Q10: How can we override a file during runtime in RPG? Without using OVRDBF or calling a CL program?
EXTFILE keyword is used in F-SPECS in RPG program with file definition to override a file during runtime.