AS/400 Interview Questions Answers-section 13
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.
What is a library in AS/400 ?
Ans:Library in AS/400 is an object that serves as a repository for other objects.
Name few IBM supplied libraries ?
Ans:GPL, QTEMP, QUSRTOOL, QSYS, QRPG & QCBL.
What is a library list ?
Ans:Library list that indicates libraries used for the process and the order in which it has to be
searched. System identifies it in *LIBL.
How many libraries can be there in a library list ?
Ans:Total 40 (15 system and 25 application).
DDS - Data Description Specification.
Source Physical File contains the source for the various objects created. This file has a specific structure.
RPG, CLP, DSPF, PRTF, etc.
A-spec
UNIQUE, PFILE, REFFLD
What is the difference between Physical and Logical files ?
Ans:Physical file contains data, where as Logical file serves as a access path to database.
What does the keyword UNIQUE mean ?
Ans:Records with duplicate key values are not allowed.
What is FCFO, FIFO, LIFO in Database environment ?
Ans:These are file level keywords which are used to access the records in the order
FCFO : First Changed First Out
FIFO : First In First Out
LIFO : Last In Fist Out
How many record formats can you have in a Physical file and in a Logical file ?
Ans:Physical file can contain only one record format, Logical file can contain more than one record format.
What is Multi-format logical file ?
Ans:Logical which uses fields from two or more physical files.
What is keyword PFILE specifies ?
Ans:PFILE is used define the Physical file being referenced.
What is a Join Logical File, Can it be used for Update ?
Ans:Logical file that combines more than one physical file.
Update is not possible through JLF.
Is it possible to join the same file to itself ?
Ans:Yes.
What does SDA stands for ?
Ans:Screen Design Aid.
What is the symbol used for defining a new field in SDA?
Ans:'+'.
What is the symbol used for shifting fields in SDA?
Ans:'<' , '>'.
What is the symbol used for copying & moving new field in SDA?
Ans:
Copying : '-' & '=='.
Moving : '-' & '='.
What is the symbol used to get name & length of a field in SDA?
Ans:'?' .
*DATE, *TIME.
How can a screen field that has changed since the last output operation be detected ?
Ans:Attach the MDT attribute to the field, to detect whether field has been changed as a result of user input.
What are the different types of specification available in RPG/400 ?
Ans:
Control Spec.( H )
File Spec.( F )
Extension Spec.( E )
Line counter Spec.( L )
Input Spec.( I )
Calculation Spec.( C )
Output Spec.( O )
Is it necessary to define all formats ? Which are mandatory and which are Optional ?
Ans:No, all are Optional.
What is the use of E specification in RPG ?
Ans:Extension Specs describes all record address files, arrays and tables.
In which specification can a report layout be defined ?
Ans:O Specification.
How many files can be defined in F specs ?
Ans:A maximum of 50 files.
Can an indexed file be accessed in arrival seQuence in RPG program ?
Ans:Yes.
In which specification Data Structures can be defined?
Ans:I - Spec.
When is a TAG statement used in RPG ?
Ans:It is used as a Label.
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.
What is a library in AS/400 ?
Ans:Library in AS/400 is an object that serves as a repository for other objects.
Name few IBM supplied libraries ?
Ans:GPL, QTEMP, QUSRTOOL, QSYS, QRPG & QCBL.
What is a library list ?
Ans:Library list that indicates libraries used for the process and the order in which it has to be
searched. System identifies it in *LIBL.
How many libraries can be there in a library list ?
Ans:Total 40 (15 system and 25 application).
DDS - Data Description Specification.
Source Physical File contains the source for the various objects created. This file has a specific structure.
RPG, CLP, DSPF, PRTF, etc.
A-spec
UNIQUE, PFILE, REFFLD
What is the difference between Physical and Logical files ?
Ans:Physical file contains data, where as Logical file serves as a access path to database.
What does the keyword UNIQUE mean ?
Ans:Records with duplicate key values are not allowed.
What is FCFO, FIFO, LIFO in Database environment ?
Ans:These are file level keywords which are used to access the records in the order
FCFO : First Changed First Out
FIFO : First In First Out
LIFO : Last In Fist Out
How many record formats can you have in a Physical file and in a Logical file ?
Ans:Physical file can contain only one record format, Logical file can contain more than one record format.
What is Multi-format logical file ?
Ans:Logical which uses fields from two or more physical files.
What is keyword PFILE specifies ?
Ans:PFILE is used define the Physical file being referenced.
What is a Join Logical File, Can it be used for Update ?
Ans:Logical file that combines more than one physical file.
Update is not possible through JLF.
Is it possible to join the same file to itself ?
Ans:Yes.
What does SDA stands for ?
Ans:Screen Design Aid.
What is the symbol used for defining a new field in SDA?
Ans:'+'.
What is the symbol used for shifting fields in SDA?
Ans:'<' , '>'.
What is the symbol used for copying & moving new field in SDA?
Ans:
Copying : '-' & '=='.
Moving : '-' & '='.
What is the symbol used to get name & length of a field in SDA?
Ans:'?' .
*DATE, *TIME.
How can a screen field that has changed since the last output operation be detected ?
Ans:Attach the MDT attribute to the field, to detect whether field has been changed as a result of user input.
What are the different types of specification available in RPG/400 ?
Ans:
Control Spec.( H )
File Spec.( F )
Extension Spec.( E )
Line counter Spec.( L )
Input Spec.( I )
Calculation Spec.( C )
Output Spec.( O )
Is it necessary to define all formats ? Which are mandatory and which are Optional ?
Ans:No, all are Optional.
What is the use of E specification in RPG ?
Ans:Extension Specs describes all record address files, arrays and tables.
In which specification can a report layout be defined ?
Ans:O Specification.
How many files can be defined in F specs ?
Ans:A maximum of 50 files.
Can an indexed file be accessed in arrival seQuence in RPG program ?
Ans:Yes.
In which specification Data Structures can be defined?
Ans:I - Spec.
When is a TAG statement used in RPG ?
Ans:It is used as a Label.