AS/400 Interview Questions Answers-section 11
What are the different Opcodes available in RPG for Database access ?
Ans:READ, CHAIN, WRITE, UPDAT, DELET, SETLL, SETGT, READE, READP, REDPE, OPEN, CLOSE, FORCE, NEXT, UNLCK.
How can database records be read without lock ?
Ans:Put 'N' in position 53 of C specs.
What does CHECK opcode do ?
Ans:The check operation verifies that each character in the base string (factor 2) is among the ` character indicated in the comparator string(factor 1).
In conjunction with which statements can ORxx and ANDxx conditions be used ?
Ans:DOUxx, DOWxx, IFxx, and WHxx.
What does opcode POST do ?
Ans:Puts information in INFDS.
Can you have multiple key lists for a single file ?
Yes.
What are the different types of arrays available in RPG ?
Ans:Pre-execution time array.
Compile time array.
Execution time array.
Can we define Multi-dimensional arrays in RPG ?
Ans:No.
What is XFOOT opcode ?
Ans:Adds all the elements in a numeric array, and places the sum in the result field.
During input operation which indicator position is seton if there is a record lock?
Ans:LO indicator position is seton.
What is the difference between *LIKE and *NAMVAR ?
Ans:
*LIKE defines the variables as in database.
*NAMVAR is used to define variables as data area.
What would be the effect on the field where reverse image, underline and highlight display attributes are active ?
Ans:The result is same as if you had specified ND.
What is the purpose of OVRDTA and OVRATA keywords ?
Ans:OVRDTA keyword (field or record level) can be used to override the existing data contents of a field or record already on the display.
OVRATA keyword (field or record level) can be used to override the existing display attributes of a field or record already on the display.
What keyword must be used with PROTECT keyword ?
Ans:OVERLAY
What is RPG ?
Ans:Report Program Generator.
Where will control be passed after the execution of the *PSSR subroutine if the factor2 of the ENDSR is blank ?
Ans:Control will return to the next sequential instruction.
What is the maximum number of subfiles that can specified in a display file ?
Ans:512
The maximum number of subfiles that can defined in a RPG program for one display file is ___ .
Ans:24
The maximum number of subfiles that can be active for a single file is ____ .
Ans:12
What are the different opcodes used for file operation on a subfile in a RPG pgm?
Ans:READ, READC, CHAIN,UPDAT and WRITE
How will you display a particular page in subfile ?
Ans:Move a valid relative record number(RRN) in the field specified using SFLRCDNBR keyword in DDS.
Can a single screen format occupy a screen area above and below a subfile format ?
Ans:Not possible.
What is SFLPAG and SFLSIZ ?
Ans:
SFLPAG : it is an attribute which specifies the number of records that can be displayed in a screen.
SFLSIZ : it is an attribute which specifies the number of records can be stored in the subfile.
How to pick up the changed records every time in a subfile after the first change made ?
Ans:Seton SFLNXTCHG keyword indicator and update the subfile record.
How do you specify the number of records to roll in a subfile ?
Ans:Use SFLROLVAL keyword in DDS along with the number, which specifies the number of records to scroll at a time.
What are the three line types in RLU ?
Ans:Report line, Filler line & Sample line.
What is the function of RLU ?
Ans:To design & prototype a report.
A program variable coded in an Embedded SQL statement is referred to as?
Ans:Host Variable
Which of the CL command can be used to determine which logical files are dependent on a specific file?
Ans:DSPDBR
What does DFU program you to do on a record?
Ans:Insert, Update Delete & File Enquiry.
When are the Unique Constraints executed?
Ans:During Insert.
When are the Referential Constraints executed?
Ans:Insert, Update & Delete.
How many triggers can be associated with a file?
Ans:6(Maximum)
Why is the Declare cursor statement is used for?
Ans:To define & name the cursor & specify rows to be fetched.
What do we can do with the Embedded SQL statements?
Ans:We can Insert/Update/Delete records, fetch records, fetch values from records into variables.
Which CL command is used to trap error messages during program execution?
Ans:MONMSG
Which CL command can be used at program execution to redirect the file named in an RPG program?
Ans:OVRDBF
What is the length of the variable in the given example?
Ans:DCL VAR (&Name) TYPE (*Char)? Default 32 & for Decimal 15,5
We can determine weather a record is in use bye another user with the help of status code (*STATUS). If
*STATUS = 01218 i.e. record already locked.
How to write *PSSR ?
Ans:It just similar to any other subroutine.
*PSSR BEGSR
………………
………………
…………….
ENDSR
What is Procedure ?
Ans:A procedure is the set of self contained high level language statements that can perform a particular task and then returns to a caller.
What is Procedure Prototype and Procedure Interface.
Ans:
Procedure Prototype
In this section we specify the name of the procedure along with PR.
D PROC1 PR
Procedure Interface
It is section where we define all the parameter which are receiving or returning some values.
D PROC1 PI 5 0
D PARMA 5 0
D PARMB 5 0
How to define a procedure ?
Ans:
First we have define Procedure Prototype along with all parameter. And PR.
D PROC1 PR
Then define Procedure with Begin/End
Procedure Name Begin/End
P PROC1 B Export
Then define Procedure Interface along with parameter and PI
D PROC1 PI 5 0
D PARMA 5 0
D PARMB 5 0
Define all the parameters as a variable to the procedure
D PARMA S 5 0
D PARMB S 5 0
In not returnable procedure, the procedure should end with
C PROC1 E
In returnable procedure, it should end with
C RETURN PARMA + PARMB
What are the different Opcodes available in RPG for Database access ?
Ans:READ, CHAIN, WRITE, UPDAT, DELET, SETLL, SETGT, READE, READP, REDPE, OPEN, CLOSE, FORCE, NEXT, UNLCK.
How can database records be read without lock ?
Ans:Put 'N' in position 53 of C specs.
What does CHECK opcode do ?
Ans:The check operation verifies that each character in the base string (factor 2) is among the ` character indicated in the comparator string(factor 1).
In conjunction with which statements can ORxx and ANDxx conditions be used ?
Ans:DOUxx, DOWxx, IFxx, and WHxx.
What does opcode POST do ?
Ans:Puts information in INFDS.
Can you have multiple key lists for a single file ?
Yes.
What are the different types of arrays available in RPG ?
Ans:Pre-execution time array.
Compile time array.
Execution time array.
Can we define Multi-dimensional arrays in RPG ?
Ans:No.
What is XFOOT opcode ?
Ans:Adds all the elements in a numeric array, and places the sum in the result field.
During input operation which indicator position is seton if there is a record lock?
Ans:LO indicator position is seton.
What is the difference between *LIKE and *NAMVAR ?
Ans:
*LIKE defines the variables as in database.
*NAMVAR is used to define variables as data area.
What would be the effect on the field where reverse image, underline and highlight display attributes are active ?
Ans:The result is same as if you had specified ND.
What is the purpose of OVRDTA and OVRATA keywords ?
Ans:OVRDTA keyword (field or record level) can be used to override the existing data contents of a field or record already on the display.
OVRATA keyword (field or record level) can be used to override the existing display attributes of a field or record already on the display.
What keyword must be used with PROTECT keyword ?
Ans:OVERLAY
What is RPG ?
Ans:Report Program Generator.
Where will control be passed after the execution of the *PSSR subroutine if the factor2 of the ENDSR is blank ?
Ans:Control will return to the next sequential instruction.
What is the maximum number of subfiles that can specified in a display file ?
Ans:512
The maximum number of subfiles that can defined in a RPG program for one display file is ___ .
Ans:24
The maximum number of subfiles that can be active for a single file is ____ .
Ans:12
What are the different opcodes used for file operation on a subfile in a RPG pgm?
Ans:READ, READC, CHAIN,UPDAT and WRITE
How will you display a particular page in subfile ?
Ans:Move a valid relative record number(RRN) in the field specified using SFLRCDNBR keyword in DDS.
Can a single screen format occupy a screen area above and below a subfile format ?
Ans:Not possible.
What is SFLPAG and SFLSIZ ?
Ans:
SFLPAG : it is an attribute which specifies the number of records that can be displayed in a screen.
SFLSIZ : it is an attribute which specifies the number of records can be stored in the subfile.
How to pick up the changed records every time in a subfile after the first change made ?
Ans:Seton SFLNXTCHG keyword indicator and update the subfile record.
How do you specify the number of records to roll in a subfile ?
Ans:Use SFLROLVAL keyword in DDS along with the number, which specifies the number of records to scroll at a time.
What are the three line types in RLU ?
Ans:Report line, Filler line & Sample line.
What is the function of RLU ?
Ans:To design & prototype a report.
A program variable coded in an Embedded SQL statement is referred to as?
Ans:Host Variable
Which of the CL command can be used to determine which logical files are dependent on a specific file?
Ans:DSPDBR
What does DFU program you to do on a record?
Ans:Insert, Update Delete & File Enquiry.
When are the Unique Constraints executed?
Ans:During Insert.
When are the Referential Constraints executed?
Ans:Insert, Update & Delete.
How many triggers can be associated with a file?
Ans:6(Maximum)
Why is the Declare cursor statement is used for?
Ans:To define & name the cursor & specify rows to be fetched.
What do we can do with the Embedded SQL statements?
Ans:We can Insert/Update/Delete records, fetch records, fetch values from records into variables.
Which CL command is used to trap error messages during program execution?
Ans:MONMSG
Which CL command can be used at program execution to redirect the file named in an RPG program?
Ans:OVRDBF
What is the length of the variable in the given example?
Ans:DCL VAR (&Name) TYPE (*Char)? Default 32 & for Decimal 15,5
We can determine weather a record is in use bye another user with the help of status code (*STATUS). If
*STATUS = 01218 i.e. record already locked.
How to write *PSSR ?
Ans:It just similar to any other subroutine.
*PSSR BEGSR
………………
………………
…………….
ENDSR
What is Procedure ?
Ans:A procedure is the set of self contained high level language statements that can perform a particular task and then returns to a caller.
What is Procedure Prototype and Procedure Interface.
Ans:
Procedure Prototype
In this section we specify the name of the procedure along with PR.
D PROC1 PR
Procedure Interface
It is section where we define all the parameter which are receiving or returning some values.
D PROC1 PI 5 0
D PARMA 5 0
D PARMB 5 0
How to define a procedure ?
Ans:
First we have define Procedure Prototype along with all parameter. And PR.
D PROC1 PR
Then define Procedure with Begin/End
Procedure Name Begin/End
P PROC1 B Export
Then define Procedure Interface along with parameter and PI
D PROC1 PI 5 0
D PARMA 5 0
D PARMB 5 0
Define all the parameters as a variable to the procedure
D PARMA S 5 0
D PARMB S 5 0
In not returnable procedure, the procedure should end with
C PROC1 E
In returnable procedure, it should end with
C RETURN PARMA + PARMB