AS400 Interview questions - Part 2 |
Q1: Which library gets loaded first when we login to IBM i?
Answer:
- QSYS
Q2: How to see all the objects in the library and their size?
Answer:
- DSPLIB
Q3: How to check all members of a file?
Answer:
- DSPFD <FILENAME> TYPE(*MBRLIST)
Q4: How to see all the record format in a file?
Answer:
- DSPFD <FILENAME> TYPE(*RCDFMT)
Q5: How to change the record size of a PF?
Answer:
- CHGPF SIZE(<changed Size>)
Q6: Why do we use the USROPN keyword in RPGLE?
Answer:
- To explicitly open a file in the RPG program.
Q7: Why do we use the EXTMBR keyword in RPGLE?
Answer:
- Override the file member.
- EXTMBR('Member Name')
- EXTMBR('ALL')
Q8: What is the purpose of using VARYING?
DVAR1 S 10A VARYING
/Free
VAR1 = 'HELLO';
/End-Free
Answer:
- To dynamically allocate the length.
Q9: What is CPF4131?
Answer:
- It's a Level Check Error.
Q10: Difference between CRTDUPOBJ and CPYF command?
Answer:
- CRTDUPOBJ will create the exact replica of an object such as LF would be LF.
- CPYF is used to copy data and it makes LF a PF.
Q11: What are mandatory keywords for a Subfile?
Answer:
- SFL (Subfile format keyword)
- SFLCTL (Subfile control format keyword)
- SFLDSP (Subfile Display keyword)
- SFLPAG (Subfile Page keyword)
- SFLSIZ (Subfile Size keyword)
Q12: What is the difference between PLIST ad KLIST?
Answer:
- PLIST is list of parameters.
- KLIST is list of key fields.
Q13: What is the difference between *INLR = *ON and RETURN?
Answer:
- RETURN will return the program to the caller.
- *INLR = *ON would free the memory and the program gets end.
Q14: What are the effective use and side effects of *INLR? How to overcome the side effects? Example use case scenarios?
Answer:
Effective Use:
- If *INLR = *OFF, return from called program, next call faster, program variable do not get reinitialized and program defined files do not get closed.
Side Effects:
- File stay open.
- Variable keep their values between calls.
Downside:
- File locking.
A better solution would be,
- Activation group use in ILE.
- Reclaim activation group.
- Ends all programs running in activation group.
- Files closed.
- Reinitialize all variables.
- No tracking is required, OS takes care of that.
Q15: What operations we can perform on Indicators?
Answer:
- SETON
- SETOFF
Q16: How to check if a record is locked in RPGLE?
Answer:
- *STATUS INFDS, Code 01218
Q17: How we can execute a CL command from within RPG program without calling a CL program?
Answer:
- QCMDEXC API
- QCAPCMD API
- SYSTEM API (C API)
Q18: Can we use a file with the same file name and same record format name in RPGLE?
Answer:
- No, but if we RENAME the record format name in F specs in RPG then Yes.
Q19: What are those commands which can only be executed in CL program but not in the RPG program?
Answer:
- CL commands starts with RTV*
Q20: How to retrieve the RRN value of the file record in RPGLE?
Answer:
- Using INFDS (file information data structure)
Related Post
AS400 Interview Questions - Part 1
AS400 Interview Questions - Part 3
AS400 Interview Questions - Part 4
AS400 Interview Questions - Part 5
AS400 Interview Questions - Part 6
AS400 Interview Questions - Part 7
AS400 Interview Questions - Part 8
AS400 Interview Questions - Part 9
AS400 Interview Questions - Part 10
AS400 Interview Questions - Part 11
AS400 Interview Questions - Part 12
As400 Interview Questions - Part 13
AS400 Interview Questions (DB2) - Part 1
AS400 Interview Questions (DB2) - Part 2