BEST Interveriw Questions For AS400
BEST Interveriw Questions For AS400
2. What is the difference between array and a multiple occurrence data structure?
The values stored in array don’t vary. In the other hand, we can store the
Different values in same variables at various stages.
4. How can you execute a command from within an RPG program without calling a CLP program?
By calling QCMDEXC application program interface we can execute a CL command with in an RPG program.
6. Which of the following operations does NOT zero the field FLDA defined as 4,0?
7. How can you check for a records existence without causing and I/O (CHAIN/READ)?
With the help of File Information Data Structure, we can check existence of records in a physical file. The code is
described below:
In File description continuation line (IPFK),
KINFDS RCDS
IRCDS DS
I *RECORD #RCDS
with the above code we can check the existence of records in a file without causing I/O operation.
8. Define what a data area is along with a brief example of what it may be used for?
Data queues provides communication between programs by calling API's QSNDDTAQ and QRCVDTAQ along with
parameters like data queue name, library in which data queue exists, variable to store the number of characters to be
sent, variable to store the information to be sent. We can send the same data queue to the many programs.
I 'CLOSED' C STAT01
I 'OPEN' C STAT02
It is a type of initializing the variables in I-spec. and these are further used in C-spec.
11. What is the difference between UDATE and the system date?
RCVF command used to receive the records either from the data base file or device file.
17. Describe the difference between the DOWxx and DOUxx operations?
DOWxx : If the condition becomes true, then only the group of instructions allowed executing.
DOUxx : Irrespective of condition, it will execute at least one time.
If you specify LEAVE, the control transfers to the statement below the ENDDO.
If you specify the ITER, the groups of statements are allowed to execute repeatedly.
FORDHDR1 IF E K DISK
ORDHDRF KRENAMEORDHDRF1
C/COPY QRPGSRC,ORDERR
During the compilation the source code of ORDERR copy book is copied into the existing program. Where as /COPY is
compiler directive statement.
FORDHDR1 CF E WORKSTN
$2SFN SFILE FMT2
The above line indicates that, $2SFN is a relative record number and FMT2 is name of the subfile record format.
I UDS
I 1 60ORDER#
I 7 90LINE#
The purpose is to define the variables in I-Spec and these are further used in C-spec. Where as ‘U’ indicates data area
data structure? The above code is used to update the data area value through the program. The letter "U" indicates
that the defined data structure is a data area data structure.
Using this record level keyword, you can specify cursor location on an output operation to the record format you are
defining. The program sends output after setting the cursor location.
28. Define what the operation will do, the purpose of the result field and the purpose of *IN66?
HI LO EQ
C CALL 'CVTDAT' DTPRM 66
The above statement causes, call the program and pass the parameter.
30. Define the purpose of the following code (If you know, how would this be written in RPG ILE)
HI LO EQ
C *IN66 DOUEQ *OFF
C KEY1 CHAIN FILEA 90 66
C 66 CALL PGM1 PRM
C ENDDO
Whenever the indicator *IN66 becomes *OFF, the control transfers after ENDDO statement. Otherwise, it reads the
records from the data base file based on indicator specified on HI position. If the specified indicator on LO position
becomes *OFF, then only CALL statement will execute.
31. How do you set the keywords SFLSIZ and SFLPAG if you want the subfile to dynamically expand?
It is the most desirable method in building a real time applications. We can use at all the times.
33. How can you detect and handle a record lock situation?
If you try to read the locked record, we can get system defined message i. e. , the program will ended abnormally.
With the help of File Information Data Structure we can handle record lock situation. Generally it will happen, when
the same file of type " U" used in different programs.
34. How can you detect overflow for a print program that prints multiple lines per cycle?
You specify the indicators OA through OG and OV in 33 - 34 columns in a printer file. This indicator automatically set
on whenever overflow occurs on a type of page.
35. How would you design the process for a nightly, high volume check producing process that needs to select only
records that are flagged to be processed?
With the help of OPNQRYF Clp command, we can select the records from the data base file. The process involves
following steps:
36. How would you join 3 separate fields, a first name, middle initial and last name together as 1 field with proper
spacing? You can describe in either RPG and/or RPG ILE (Integrated Language Environment)
37. When PGMA calls PGMB for the first time PGMB executes the *INZSR. PGMB uses the RETRN operation to return to
PGMA. When PGMA call PGMB the second time is the *INZSR executed?
If you specify RETRN in called program, the *INZSR will not execute again.
PGM
DCL VAR(&VAR1) LENGTH(6) TYPE(*CHAR) VALUE('YYMMDD')
DCL VAR(&RCVD) LENGTH(6) TYPE(*CHAR)
DCL VAR(&VAR2) LENGTH(4) TYPE(*CHAR)
DCL VAR(&VAR3) LENGTH(2) TYPE(*CHAR)
CHGVAR VAR(&VAR2) VALUE(%SST(&VAR1 3 4))
CHGVAR VAR(&VAR3) VALUE(%SST(&VAR1 1 2))
CHGVAR VAR(&RCVD) VALUE(&VAR2 *CAT &VAR3)
SNDMSG MSG(&RCVD) TOUSR(*USRPRF)
ENDPGM
a. Cost = $110. 00
b. Tax = 20%
c. MarkUp= 05%
d. Sale = 10%
40. Define the purpose of Factor 1 the Operation Code and *IN15 in following code
HI LO EQ
C *YMD Test(D) yymmddDate 15
If the factor 1 value matches with factor2 value, the indicator specified in EQ comes *ON.
The SETLL operation positions a file at the next record with a key or relative record number that is greater than or
equal to key or relative record number specified in factor1.
The SETGT operation positions a file at the next record with a key or relative record number that is greater than key
or relative record number specified in factor 1.
Specifies whether the level identifiers of the record formats in the physical file are checked when the file is opened
by the program.
Subsystem is nothing but it provides specialized environment to complete the execution of jobs.
Query/400 is a licensed program that uses a query to analyze and select the information contained in the data base
files and create a query report.
A query report can be:
* displayed on a workstation (screen)
* printed
* stored in another database file.
WRKQRY
The basic purpose of Overrides is to temporarily change the attributes of a file. So you don't have to create
permanent files for every combination of attributes your application might need. Overrides gives you the flexibility to
use existing model files and dynamically change their attributes.
Data structures are specified in the Input specifications of an RPG/400 program to define an area in storage and
layouts of related sub fields.
When the data area is defined in an RPG/400 program as a data area data structure, its data is implicitly
retrieved for processing and written back at the end of the program. In the data area data structure, letter "U"
must be entered to define the data structure as a data area data structure.
A file information data structure provides exception/error information that may be occurred when processing a
file during program execution. This type of data structure contains pre defined sub fields that identify
* The name of the file for which the error occurred
* The record processed when the error occurred
* The operation being processed when the error occurred
* The status code number
* The RPG/400 routine in which the error occurred.
Exception errors may be controlled by testing for an error code in the *STATUS field which is included in a file
information data structure. Specifically, keywords including *FILE, *RECORD, *OPCODE, *STATUS, *ROUTINE
provide the previously named information.
Program status data structure however identity exception/errors that are generated in the program by RPG/400
operations and not by a file. Note that any code greater than 00099 is flagged as an exception/error. Four
keywords - *STATUS, *ROUTINE, *PROGRAM, *PARMS are supported by a program status data structure.
This is a file level keyword used in a logical file. If you specify this in a file level, the system doesn't perform record
selection until the program reads file. Then on the Select/Omit criteria, it selects the records from the specified file.
59. What is the difference between access path and Dynamic select?
Dynamic select occurs whenever the program reads file. But access path occurs before the file is read (but not
necessarily). Because access path maintenance performed on the file.
The main difference is : Logical file creates permanent object on the system. OPNQRYF creates temporary access
path.
The physical file you are working with very large, creating and using a logical file will allow an application to perform
faster than using an open query file. Since access paths created by open query files are temporary, applications that
use an access path frequently will be more efficient using a logical file, since the access path will not have to be
rebuilt every time the file is open.
These keywords are used at file level. The purpose of each one is described below:
FIFO: The duplicate key records will retrieved in first in first out order.
LIFO: The duplicate key records will retrieved in last in first out order.
FCFO: The duplicate key records will retrieved in first changed first out order.
63. What is the difference between regular logical file and join logical file?
Field reference file is a file, which contains field definitions and descriptions, and it doesn't have member. Physical
contains data derived by the field reference file.
66. What is the necessary keyword used in a physical file to refer field definitions from the field reference file?
REF which is a file level keyword is necessary to define at file level in a physical file. The syntax is as follows:
REF(library name/name of the field reference file)
Even if you delete the records in a physical file through the program, still the space used by the deleted records not
used by the other purpose. Hence using RGZPFM command we can compress the deleted records space.
CHGPF command is used to change the attributes of a physical file. Attributes like
* Maximum number of members
* Member size
* Level check enforced
* Open data path is shared
Which is a subfile record format keyword. If you perform read on the subfile, the
internal indicator MDT (modified data tag) is automatically set off by the system. If you again perform read on the
same records, records won't be read. Because internal indicator MDT would be off. Hence you should be explicitly set
on the MDT by SFLNXTCHG keyword.
Array: Array is stored any where in the body of the input records.
Table: Table is stored at the begining of the input records.
Array: We can access all the elements in array by specifying the array name.
Table: Only one table element can be accessed at a time.
Array: Array can be searched randomly.
Table: Table can be searched consecutively.
72. What are the different types of access paths maintained on the file?
Immediate: All the access paths (open and close) associated with a file will be updated whenever changes made to a
file.
Rebuild- only open access paths will update whenever changes made to the file. Rebuild takes place whenever
remaining access paths will be open.
Delay : Rebuild will not takes place.
With the help of MONMSG MSGID(CPF0864) we can identify end of file in clp program.
74. What is the difference between production library and test library ?
In debug mode, the files exists in production library not allowed to update.
In the other hand, the files exists in test library allowed to update.
Message subfile is special file contains multiple messages taken from program message queue and placed in message
sub file for display on the screen.
If you specify SETON LR, all the files used in program will be closed.
If you specify RETRN, all the files used in program will remain open.
78. When will you use OPEN and CLOSE opcodes in RPG program?
If you specify the letter "U" at columns 73 - 74 in a file description specification indicating that user control on a file.
Hence we have to explicitly open and close the file in a program.
79. What is difference between fully procedural file and primary file?
In primary file the records will be read and processed from begining to end. This order is not changed.
In fully procedural file the records will be read and processed in any order. The logic flow is controlled by the opcodes
in RPG program.
80. What is the difference between externally described file and program described file?
The field definitions and descriptions are defined out side of the program in a externally described file. The field
definitions and descriptions are defined in side the program in a program described file.
With the help of CHKOBJ clp command, we can find existence of object on the system.
The usage of command in clp is as follows:
CHKOBJ OBJ(JBA001DT) OBJTYPE(*DTAARA)
MONMSG MSGID(CPF9801) EXEC(DO)
CRTDTAARA DTAARA(QGPL/JBA001DT) TYPE(*CHAR) LEN(6) +
VALUE('010196') TEXT('The last day that had job acct.+
data extracted')
ENDDO
RTVDTAARA DTAARA(JBA001DT *ALL) RTNVAR (&FROMDATE)
It is always good CLP programming approach to check the object before you
rename, delete the objects on the system.
Use this record-level keyword to immediately display a record format, without waiting for the next input or
output/input operation.
Use this field level keyword in display file to specify one or more display attributes for the field you are defining. You
can specify the DSPATR keyword more than once for the same field, and you can specify more than one attribute for
the same keyword. The following are valid attributes:
Display
Attribute Meaning
BL Blinking field
HI High Intensity
RI Reverse Image
CS Column separator
ND Non Display
PC Position cursor
UL Underline
89. What is the purpose of PUTOVR (Put with explicit override) keyword?
Use this record-level keyword to permit the override of either display file attributes or data contents of specific fields
within a record displayed on the work station device.
Use this field level keyword with PUTOVR keyword to override the existing the data contents of a field already on the
display.
43 (Forty three)
In 'EQ' position.
Physical file nothing but a table contains a only one record format in which we can describe the field definitions and
descriptions.
Join logical file joins more than one file. The maximum of number of files allowed to join is 32 (thirty two).
103. What are the necessary keywords for the Join Logical file?
It only provides logical view based on the physical file. This is also called as regular logical file.
Four levels. They are File level, Record level, Field level, Key field level.
It will avoid to enter duplicate key values. We have to define it in a file level.
108. At what level S,O are defined and what they will do?
S, O are to defined at key field level. The purpose Select/Omit logic is depends on the criteria (condition) given at
the key field level (At function entry) it selects and omits the records. The S/O is allowed in Logical file only.
109. What is the difference between Packed decimal and Zoned decimal?
110. What is default data type (if you define decimals '0') in Physical file?
Packed decimal
111. What is default data type for the fields(sub fields) defined in data structures in RPG?
Zoned decimal
If you specify JDFTVAL at file level, even the primary file record does not match with secondary file record, the join
takes place.
Yes. With the help of CRTPF we can achieve this. But we have to give record length.
Defining a field as a key in physical file. Hence we can access records through the key field.
The records will be accessed the way in which records are added to physical file.
117. What is the maximum number of key fields allowed defining in a physical file?
120
RPG/400
There are seven specifications are exits in RPG/400. They are listed below:
* Header Specification
* File Description specification
* Extension specification
* Line counter specification
* Input specification
* Calculation specification
* Output specification
* In order to refer the named record format as a subfile record format in the program.
* In order to rename the record format of a database file in a program.
* In order to define a named data structure as a file information data structure.
124. When do you explicitly open files and close files in an RPG program?
If you specify the letter ' U ' at column 73-74, you need to be open and close files explicitly in a RPG program.
With the help of 'IN' opcode, we can access the data area record in to the program.
The different types of Data Areas are general data area, local data area, group data area, pip (program initialization
parameter data area) data area.
*General Data Area - It can be created by user implicitely or explicitly
It can be referred by any other jobs.
It can be associated with a library.
It can be created, deleted by the user.
129. What are various techniques to pass parameters from one program to another?
130. Which single RPG opcode performs both SETLL and READE?
CHAIN
Everything on the AS/400 System that can be stored and retrieved is contained in the object.
Distribution Data Management is a function of the OS/400 that allows an application program or user on one system to
use database files stored on remote system.
An object is any thing that exists in and occupies space in storage and on which operation can be performed.
All objects are stored on AS/400 in a single level storage. In this method all objects are referenced by one virtual
address which is translated in to a physical address whether it is an auxiliary storage or main memory.
A list that indicates libraries used for the process and the order in which it has to be searched System identifies it in
*LIBL.
A Folder is a named object that is used as a directory for documents and other folders.
Folders can be filed with in another folder.
A file that holds output data to be processed, such as information waiting to be printed.
A Job description defines an environment in which a batch job or an interactive job to be executed.
A Group Job is attached to one workstation and a user. There should be an initial group job and it can be branched to
many other group jobs. The group jobs can have different library lists and different output, message queues. Group
Job is useful in enhancing the programmers productivity. It is as though logging into the same user-id many times.
147. What are the two main attributes, which govern the execution of a job?
Sub-Systems are specific user defined partitions of the CPU where various jobs may be executed. One subsystem can
have more than one active job at a time.
A device file contains the description of how data is to be presented to a program from a device or vice versa. Device
file can be Printer, Disk, Tape and Remote system.
A device file that allows a program on the system to communicate with program in other system.
It is a file which contains the messages of an application. For example all RPG/400 messages are stored in a file, all
COBOL/400 messages are stored in a file.
A record of request submitted to system be a job. The message related to the requests, and action performed by the
system on the log. The system program maintains it.
OPNQRYF is used to select certain records of the database file based on the QRYSLT (Query select ) condition.
Through OPNQRYF
Data area is an object used to hold data for access by any job running on the system. A data area can be locked to a
single user, thus preventing other users from processing at the same time.
LDA is created by the system for each job in the system, including auto-start jobs, jobs started on the system by a
reader, and subsystem monitor jobs.
The system creates a GDA when an interactive job becomes group jobs. Only one GDA can exists for group.
162. What are the different ways to input data into data area?
164. What are the valid user defined data area types?
Data queue is a type of system object that you can create. Data Queues are used in Program to program
communication.
169. What are the two types of read performed on data queues?
A lists of two or more user Ids & their authorities for system resources. The system identifies it an object type *AUTL
*USE, *CHANGE, *ADD, *DLT, *READ, *UPD, *ALL, *EXCLUDE, *OBJEXIST, *OBJMGT, *OBJOPR
SBMJOB
You can use the Override with Database file (OVRDBF) command to replace the database file named in a CL program
or to change certain parameters of the existing database file.
Override with Printer file (OVRPRTF) command is used to override certain parameters of the printer files used in the
program or to replace the printer file.
177. How to change file attributes such as size, file wait time, record wait time etc. , permanently?
Allows user of AS/400 system to submit jobs and receive jobs from a host system.
It converts compressed data written to an AS/400 database file to decompressed data written to another AS/400
database, diskette, or device file.
Journaling is a function which records the changes in a file in a journal. These record images are used to recover the
changes in the file should the system ends abnormally. Commitment control is a function that allows you to define
and process a number of changes to database files as a single unit (transaction).
188. What are the different definition levels in Data Description Specifications?
File level, Record level, Field level, Join level, Keyfield level, Select/Omit level.
189. What the difference between Source Physical File and Physical File?
A Source Physical File contains the source for the various objects created this file has specific structure.
A Physical File contains data, and the record format can be different for different physical files.
The order in which the database fields are organized for processing in the program.
192. What is the default value for the number of increment for the physical file?
Three
This is used to specify rules for the Selection/Omission of records from a Physical File.
200. What is the maximum number of records you can specify in a display file?
1024
201. How can a screen field that has changed since the last output operation be detected ?
202. What would be the effect on the field where reverse image, underline and highlight display attributes were active?
Sets on the modified Data Tag of the field. The Data Tag detect whether the field has been changed as a result of
user input.
204. If DSPATR(PC) and CSRLOC were specified for a format, which keyword would have priority?
205. Can error messages as a result of a COMP, RANGE or VALUES keyword be overridden?
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.
207. How can a message from a message file appear as a constant on the screen?
208. In conjunction with what other keyword must OVRDTA and OVRATA be used?
This File-level keyword is used to remove option and response indicators from the buffer and places them in 99-byte
separate indicator area.
KEEP: Keep the display from being deleted when the display file is closed.
ASSUME: It is used to specify that the OS/400 program is to assume that this record is already shown on the display
when this file is opened.
Immediately display a record format without waiting for the next I/O operation.
OVERLAY
Subfile is group of records of same record format and can be read from or write to the display in a single operation.
Subfile Record Format, Subfile Control Record Format, Relative Record Number, Subfile Record Number, Associated
Subfile Keywords.
Subfile record forma (SFL), and subfile control record forma (SFLCTL).
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 subfile.
218. What is the maximum number of subfiles that can be specified in a display file,
512
219. Maximum number of subfiles that can Defined in a RPG program for one display file is
24
220. Maximum number of subfiles that can be active for a single file is?
12
221. Can more than one subfile record be displayed on one line?
Use SFLROLVAL keyword in DDS along with number, which specifies the number of records to scroll at a time.
Move a valid relative record number (RRN) in the field specified using SFLRCDNBR keyword in DDS.
224. How to pick up the changed records every time in a subfile after the first change made?
By specifying this keyword, the Bottom/More message could be displayed at end of screen.
226. How to toggle between single line and Multi - line display of a particular record in a subfile?
Subfile record is defined by SFL keyword, where as Message subfile is defined by SFLMSG keyword.
you can not use CL program to ADD or UPDATE records in database files.
Use Printer or ICF files.
Use Program described files.
Use the concept of subfile (to display more than one record), but a single output message subfile is a special type of
subfile that is supported well in CL.
Use subroutines.
You cannot declare more than one object (file) in a CL programme.
Overflow indicators
Record Identifying Indicators
Field Indicators
Resulting Indicators
Control Level Indicators
L1 to L9 used to identify certain fields on control fields and then used to condition which operations are to be
processed at detail or total calculation or output time.
Extension Specs describes all record address files, arrays and tables.
Line counter specification can be used to describe printer file to indicate the length of the form and number of lines
per page.
O Specification.
50
To define files, to describe the files, to assign the files to specified devices.
244. How do you specify page overflow indicator for printer files in RPG?
Yes.
The field name and length of the fields are defined with in the RPG program.
All information about the fields is specified in DDS and the RPG program can use them with in the program.
249. Can you specify a display file to be used in the following modes Input, Output, or Combined modes ?
Yes.
Matching record indicator is seton when all the matching fields in the record of a secondary file matches with all the
matching fields of a record in a primary file.
6 Characters.
It is used as Label.
253. What opcode could be used to test an alphanumeric field for all numeric values?
TESTN
254. What opcode will be used to test the zone of a character field?
TESTZ
SCAN operation scans a character string (base string) contained in factor 2 for a substring (compare string ) contained
in factor 1.
XLATE operation translates characters in source string (factor 2 ) to the from and to strings (factor 1 ) and put into
the result field.
Using COMIT operation. Makes all changes to the files that have been specified in output operation since the previous
COMIT or the begining of operations under commitment control(if there has been no previous COMIT or ROLBK
operation).
The FREE operation removes a program from the list of activated programs, frees static storage and ensures program
initialization (first cycle processing) the next time program is called. It does not close file or unlock data area.
9999
No.
Adds all the elements in a numeric array, and places the sum in the result field.
267. How can the user implicitly open and close the files in RPG program ?
255
A Program status DS can defined to make program exception/error information available to an RPG program.
DS is defined as program status DS by an S in position 18 of the DS statement.
*STATUS contains status code.
*ROUTINE : contains name of routine in which the exception/error occurred
*PARMS : contains the number parameters passed to this program from the calling program.
271. What is the maximum number of times Multiple Occurrences DS can occur in a program?
9999
Systems Application Architecture (SAA) is a collection of selected software interfaces, conventions, and protocols that
will provide a consistent framework across the System/370, AS/400 and PS/2.
274. During execution, an RPG/400 program automatically follows a sequence of operations for each record that is
processed.
The built-in program cycle includes the following logical steps.
1. reading input (READ)
2. processing calculations (PROCESS)
3. writing output (WRITE)
Productivity tool for copying, deleting, scanning, changing & creating source files.
Library list that indicates libraries used for the process and the order in which it has to be
searched. System identifies it in *LIBL.
Physical file contains data, where as Logical file serves as a access path to database.
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
285. How many record formats can you have in a Physical file and in a Logical file ?
Physical file can contain only one record format, Logical file can contain more than one record format.
291. What is the symbol used for defining a new field in SDA?
'+'.
'<' , '>'.
293. What is the symbol used for copying & moving new field in SDA?
294. What is the symbol used to get name & length of a field in SDA?
'?' .
*DATE, *TIME.
Attach the MDT attribute to the field, to detect whether field has been changed as a result of user input.
296. What would be the effect on the field where reverse image, underline and highlight display attributes are active ?
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.
OVERLAY
Control Spec.( H )
File Spec.( F )
Extension Spec.( E )
Line counter Spec.( L )
Input Spec.( I )
Calculation Spec.( C )
Output Spec.( O )
301. Is it necessary to define all formats ? Which are mandatory and which are Optional ?
Extension Specs describes all record address files, arrays and tables.
O Specification.
A maximum of 50 files.
Yes.
I - Spec.
It is used as a Label.
308. What are the different Opcodes available in RPG for Database access ?
The check operation verifies that each character in the base string (factor 2) is among the ` character indicated in
the comparator string(factor 1).
311. In conjunction with which statements can ORxx and ANDxx conditions be used ?
313. Can you have multiple key lists for a single file ?
Yes.
No.
Adds all the elements in a numeric array, and places the sum in the result field.
317. During input operation which indicator position is seton if there is a record lock?
319. Where will control be passed after the execution of the *PSSR subroutine if the factor2 of the ENDSR is blank ?
320. What is the maximum number of subfiles that can specified in a display file ?
512
321. The maximum number of subfiles that can be active for a single file is ?
12
322. What are the different opcodes used for file operation on a subfile in a RPG pgm?
Move a valid relative record number(RRN) in the field specified using SFLRCDNBR keyword in DDS.
324. Can a single screen format occupy a screen area above and below a subfile format ?
Not possible.
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.
326. How to pick up the changed records every time in a subfile after the first change made ?
Use SFLROLVAL keyword in DDS along with the number, which specifies the number of records to scroll at a time.
330. What are the three types of keywords associated with printer file ?
Using CLC.
DR - Define Record, CLC - Change Line for Continuation, CLR - Change Line for Record, SD - Create Sample Data, VF -
View Fields, NP - New Page, DC - Define Constants, DF - Define Fields, CF - Centre Fields & SP - Space Fields evenly.
STRRLU.
SFL, SFLCTL, SFLDSP, SFLSIZ, SFLPAG are the mandatory key words
SFLRCDNBR will give the RRN of the First record displayed on the screen at a given time.
Whenever a record is changed on display file. An MDT is set ON. If an indicator is associated with SLFNXTCHG and it is
SETON then READC will read only the changed record. And if the indicator is not associated and it is seton it READC
reads all the records from sub-file
DSPDBR
DSPFD
A procedure is the set of self-contained high level language statements that can perform a particular task and then
returns to a caller
A Service Program is a collection of runnable procedures and available data items easily accessible by other ILE
programs. In many respects it is similar to a subroutine library and procedure library.
A service program differs from a program in two ways:
It does not contain a program entry procedure. This means that you cannot call a service program using the CALL
operation.
A service program is bound into a program or other service programs using binding by reference
344. How many files, printer files you can describe in a RPG
It is Dynamically creation of access path, and it can have resultant fields i.e. if the expression is A = B + C then B and
C are from the file while A is defined in OPNQRYF. We can divert the output of command to an OUTFILE. Command
associated with OPNQRYF is CPYFRMQRYF to save the output permanently
It is a CL command to monitor and error/exception message so that in case of an error a dump is avoided and the
control is in program. It is also used to monitor user message.
SETGT.
348. How will I explicitly open a file in an RPG program? By defining UC in file condition and to opening the file mention
OPEN opcode and closing the file by mentioning CLOSE in opcode of C spec.
LR closes all the files used in the program and RETURN is used to return the control to the parent program.
351. What are the uses of FACTOR1, FACTOR2 and RESULT field for the RPG operation code PARM?
It is add value of FACTOR1 to FACTOR2 or compare the value of FACTOR 2 with FACTOR1.
By using FNDSTRPDM.
LOKUP
It is file which contain messages created by the user through which a user can display own message while validating.
SUBFILE DISPLAY (SFLDSP) SUBFILE DISPLAY CONTROL (SFLDSPCTL) SUBFILE CLEAR (SFLCLR) SUBFILE SIZE (SFLSIZE)
SUBFILE PAGE (SFLPAGE).
When subfile size is greater then subfile page size it is called elastic subfile and when subfile size is equal to subfile
page size it is called non-elastic subfile.
SFLINZ stands for subfile initialize. It initialized all the character field as blanks and numeric fields as zeros.
SFLRNA stands for subfile record not active (It means records are there in the subfile but active).
READC is to read those records which have changed in the subfile. If you validate a record in subfile on some condition
all the invalid records can display in reverse image. The first which have changed and made valid and released still
displaying in reverse image. The records have read even it has not been changed due to SFLNXTCHG.
364. How you will find an error which is not in the first page of the subfile without using ROLLDOWN key?
By using this keyword you can tell system to roll on of records when the user presses ROLLDOWN key (For this you
define a hidden of 4 byte).
366. How you will know whether you are in SFLDROP or SFLFOLD mode?
367. How you get the relative record in a subfile in which cursor is located?
9999.
SBMJOB.
372. How to translate field values form lower case to Upper case?
373. What are the maximum parameters can be passed from one RPG program to another RPG program?
255
374. How many maximum parameters can be passed from on RPG program to another CL program?
40
375. How many maximum arrays can be used in a single RPG program?
200.
376. How many maximum loops can be used in a single RPG program?
100
377. How many maximum printer files can be used in a single RPG program?
9999.
Subfile is a group of records which can be used for (Displaying, Adding new record, Modifying the existing record, and
Deleting the existing records).
9999.
381. How do you write and read a value (similarly as EXFMT of RPG) using a display file in CL?
SNDRCVF.
SNDF.
NO.
NO
All the jobs in WRKUSRJOB are seen including Active jobs where as in WRKACTJOB only active jobs are seen.
It is a system subroutine which is executed by default when any error occurs in a program.
It frees the memory. All the fields and parameters in the memory will become blank.
PWRDWNSYS.
395. If your workstation does not show login screen what might be the problem?
396. You have given a job for printing and you are not getting the printout what might be the reason?
397. There are multiple jobs for printing in job queue & you want to print a important document then what will you do?
WRKACTJOB or WRKSYSSTS
399. Which Function key should be pressed to define hidden field while you are working with SDA?
F4
400. Which function key should be pressed to watch all strings defined on the SDA screen?
F20
401. While designing the screen using SDA, which function key should be pressed to get the field from the field reference
file?
F10
402. From work with member using PDM screen you have to modify existing member using SDA, which option do you
select?
17
403. Write system defined function used to place system name on the screen
*SYSNAME
404. While designing the screen, F3 function key is kept common for all record formats. On which level should it be
defined?
File Level
405. Write down any two mandatory keywords used when defining a subfile?
406. While designing the screen user wants to add file level keywords, then which function key should be pressed?
F14.
408. While designing the report using RLU, user wants to add record level keyword then which function key should be
pressed?
F18.
409. If user wants to add one field on the report then which function key should be pressed?
410. SDA: After getting field reference from reference file selected files will appear at the bottom of the screen and then
which command function will be used to get it on screen with its label to be left aligned?
&3L
411. If user wants to center the company name on his report then which line command will be used?
CF.
412. If user wants to change the length of the numeric field defined in report then which combination of keys will be
used?
SKIPB (2) skips 1 page & on the next page after skipping 2 lines space print next while SPACEB (2) skips 2 lines space
before printing.
414. RLU: If user wants to define new numeric field on record format then which line command will be used?
VF.
415. Maximum report length is 132, if user is designing a report using RLU?
416. To change constant field defined on RLU screen which field level keyword should be used?
DFT
417. RLU: Which field level keyword should be used to change any numeric field of length 8 to 99.99.9999 format?
EDTWRD (‘ . . ‘)
418. SPACE and SKIP are FIELD & RECORD LEVEL keywords.
420. Using Query, its also possible to create level break reports.
TRUE.
421. Using DFU, user will be able to ___________ from Physical File?
422. What is the difference between normal UPDDTA to PF and updating using DFU program?
Both are same only difference is DFU allows you to add or change selected fields.
A library is a system object that serves as a directory to other objects or collection of object
Source Physical File contains members who contain source statements & Physical File contains members, which
contain data.
There are 3 types of libraries on As/400 they are System (*sys), User (*test) & Product (*prod).
In I Specs.
Verb Object Qualifier Verb: - action Object: - on which action is performed Qualifier: - identifies your job
A file, which is created externally & described in the program, is called as external described file.
Qualified path means mentioning object name along with library name while Unqualified path means directly writing
the object name.
Unqualified path.
There are 2 types of files on As/400 they are Databases files & Device files.
437. What is the command to know how many LF are related to a PF?
No.
441. What is the object type of PF, LF, Printer file & Display file?
*File
442. How many types of display are available on As/400 for user interaction?
Prompt depending upon type, shows right hand side date & left hand side the line number.
Use the Start Source Entry Utility command (STRSEU) Option 8 from STRPGMMNU Through Program Development
Manager (PDM)
In I Specs.
Printed output items placed in an output queue are known as spooled files.
449. How many Specs are there in RPG & Which are they?
CA: - It does not retains the value into the buffer memory.
CF: - It retains the value into the buffer memory.
455. How many printer files maximum can be used in single RPG program?
456. When you are defining a flat file in your program in F Specs which format will you specify?
Skip before leaves the specified no. of lines moving to the next page while Space before leaves the specified no. of
lines on that page.
EQ (Equal to)
It compares Factor1 with Factor2 & if condition is true, control is transferred to label designated in the result field.
The label specified must appear as the Factor1 of a TAG operation somewhere in the program.
EXCPT.
A subroutine is a group of statements in a program that can be processed several times in that program.
Whenever there is any type error in the program the control straight away passes onto this subroutine.
There are 2 types of tables in RPG they are: - Compile Time Tables Pre-Runtime Tables
READ, SETLL, SETGT, READE, READP, READPE CHAIN, KLIST, KFLD, EXCPT & WRITE.
Batch job begins, runs & continues to execute instructions without human intervention or control while Interactive
job are user driven.
SBMJOB Command.
1024
A Subfile is a temporary area in memory which records may written to & read from a display file device.
482. Which is the subsystem that is always on till the main power switch is off?
WRKACTJOB (Work with active job) WRKSYSSTS (Work with system status)
485. Which are the libraries (system) always present in the library list?
No.
80
*LIKE DEFN ENAME $ENAME (Now the $ENAME has all the attributes same like ENAME)
A DBMS is a software system that controls the creation, organization & modification of a database & access to the
date stored within it.
A Join Logical File combines information from two or more physical files into one record format. Join Logical Files
have always one record format.
There are mainly 3 types of locks they are as follow: - *EXCL : Only the routing step holding the lock can use the
object *EXCLRD : Routing step can read/update the file other jobs can only read. *SHRUPD : All jobs can read/update
the object.
Data Area, Data Queue, File, Library, Message Queue, Menu &Program.
496. What is the opcode to release all the locks on a particular PF?
A trigger is an action that automatically occurs whenever a change Is made to a physical file.
6 (max)
499. How can we know the triggers associated with the PF?
501. F is the type of file desg. Used for externally described files given when file types are?
I&U
They are the holding areas that store printed output generated from Batch programs or Interactive applications.
It is a system job that selects files from the output queue & prints Them on a printer. It provides the interface
between output queue’s Spooled files & the printer.
No.
A table is collection of data elements in one column, data elements Must be of same type and same length.
We can hard code data within the program is said to be Compile Time Table.
Data from a separate disk file is loaded into a table each time the Program runs.
TABMT 1 12 2 A Where 1 = Number of entries per record 12 = Total number of entries 2 = Length of each entry A =
Ascending Sequene
511. If the data is likely to change over a period of time & Moreover data is large than which type of table is preferred?
RPG tables stores information in 1 column. To store information in multiple columns, it uses the concept of Alternate
Table.
Array is a collection of data, the data elements must be of same Length and same type.
514. The Qualified name for an object ORDPF residing in a library TRAINING is?
TRAINING/ORDPF
Access Path.
True
DSPLIBL
CRTPF
521. The function key to start SEU session through program development manager is?
F6
522. The Member type for an RPG & CL program which SEU supports is?
523. Printed output items placed in an output queue are known as?
Spool Files.
OUTQUEUE
WRKSPLF
526. Change in the externally described file does not require recompilation of the program? (True/False)
DSPCURLIB
Only one
529. Which one of the following has the highest priority Library on top of the library list, Library QGPL, Library on the
bottom of the library list & Current library?
Current library
531. While designing the screen user wants to add file level keywords then which function key is pressed?
F14
532. While designing the report using RLU user wants to add record level keywords which function key is pressed?
F18
533. If user wants to add one field on the report then which function key is pressed?
F11
534. If user wants to center the company name on his report then which command will be used?
CF (Center Field)
Member Type
YES
YES
539. What is the difference between UPDDTA to PF & updating using DFU?
Both are same, only difference is DFU program allows you to add & update selected fields.
540. Which function key should be pressed to define hidden field while you are working with SDA?
F4
541. Which function key should be pressed to watch all string defined on SDA screen?
542. While designing the screen using SDA, which function key should be pressed to get the field from the FRF?
F10.
543. From WRKMBRPDM screen you have to modify existing member-using SDA which option do you select?
17.
544. Write system defined function used to place system name on the screen?
*SYSNAME
545. While designing screen F3 function key is kept common for all record formats on which level should it be defined?
File level
547. If user wants to change the length of the numeric field defined in the report then which combination of the keys will
be used?
548. What is the difference between SKIPB (2) & SPACEB (2)?
SKIPB (2) skips 1 page & on the next page after skipping 2 lines space print next while SPACEB (2) skips 2 lines space
before printing.
549. RLU: If user wants to define new numeric field on record format then which line command will be used?
VF
550. Maximum report length is 132, if user is designing a report using RLU?
551. To change constant field defined on RLU screen which field level keyword should be used?
DFT (Default)
Union File
Members are separate entities within a database file & they are components of As/400 object.
8 Characters (Max.)
It refers to the way program will access or retrieve the data from the file.
It tells to the program that the records are within the program (F) or outside the program (E).
To describe the records within Program described file, fields, constants, divide fields into sub fields & to form a group
of fields.
L1 – L9.
Data Structures define an area of storage & layout of fields within the defined structure.
571. Which are the four keywords supported by Program Status Data Structure?
It is an Integrated RDBMS.
*FILE
CRTPF
580. Join Logical File displays data from how many files?
2 or more PF’s
True
582. Which are the Query selection criteria, which can be given in a Query?
LIST
583. To add a file to the ‘File Selection’ option of a Query, the function key to be pressed is?
F9
6(Maximum)
We can Insert/Update/Delete records, fetch records, fetch values from records into variables.
591. What is the values SQLCOD when there is an error in fetching the records specified in the select statement?
-ve value
False
False
595. Which are the DB2 tools to protect Integrity of the database?
Journaling & Commitment Control, Referential Integrity Embedded SQL & Object/Record Locks.
Host Variable
597. Which of the CL command can be used to determine which logical files are dependent on a specific file?
DSPDBR
598. Which CL command is used to trap error messages during program execution?
MONMSG
599. Which CL command can be used at program execution to redirect the file named in an RPG program?
OVRDBF
DCL VAR (&Name) TYPE (*Char)? Default 32 & for Decimal 15,5
601. Which of the following CL command us used to display a screen & wait for the user to press enter or a function key?
602. A CL program, EMPCL1 calls the RPG program EMP001 & the calls the RPG program EMP002.RPg program EMP001 &
EMP002 were both written to process the file, In order to test changes in EMP001 a test file called TESTEMP is library
TESTLIB needs to be used EMP002 should process EMPMAST as it normally would. Add the following CL statement
directly before the call to EMP002 DLTOVR FILE (EMPMAST)
CVTDAT
No command
RTVUSRPRF
DSPDTAARA “Name”
SBMJOB
608. Submitting a job using numeric parameters, the length of the parameter should be?
15,5
OVRPRTF FILE (Output) SPLFNAME (Reports)OVRPRTF FILE (Output) COPIES (3)CALL PGM (Rpg001) Copies = 3
RTVJOBA
True
CPYFRMQRYF
Opens a database file to a set of database records that satisfies a database Query request.
Override (replace) the file named in the program & Override certain parameters of a file that are used by the
program.
617. Which of the following options describes the result of using the USROPN keyword?
This file must be opened with an explicit OPEN operation prior to accessing this file.
D Arr S 30A Dim (30) PerRcd (1) CTADTA Compile Time Array
619. Given the following code segment.D PGMNAME S 20A Inz (‘THX1138’)C CALL PGMNAMEC PARM P1 5 The CALL to the
program name stored in the PGMNAME field ends in an error, the program is not found.
620. Which of the following methods will make externally describe file fields available to a program?
A Data Structure definition specification that names the file on the EXTNAME keyword.
621. In the following code %SUBST is aEval Result = %SUBST (Flda: Str: Len) Built in function
622. What ILE RPG/400 code procedures the same results as the RPG/400 code shown below?
C A Add B Sum1 Sum1 Mult X Rslt Rslt Div Tot Answ C Eval Answ = (A+B)*X/Tot
623. The DATFMT keyword allows you to specify which of the following date format?
*USA
624. What is the command invoked when we give option 14 to RPGLE program?
CRTBNDRPG
625. What will happen, if we use STRISDB command for RPGLE program?
626. If we want to define a new variable $Aprid with same attributes as field Crpid, the RPGLE code look like this: D
$Aprid S Like (Crprid)
627. The keyword used to define number of entries per record for Tables/Arrays in RPGLE is?
PerRcd (n)
628. What will be the output of the following ILE code? D Loandate S D DATFMT (*USA) Inz (D’12 31 92’)UBDUR -30: *D
Loandate
629. Which will be the output of the following ILE Code?D Answer S TC T’12:00PM’ ADDDUR 12: *Hours Answer 00.00 AM
E Specs.
631. Which is the Built in function to convert numeric field to Alpha field?
632. If user wants to retrieve the time in microseconds, what Would be data type of the field?
635. State whether the following code is correct?@Arr is an array. No of elements = 5, & Length of each element = 3A.C
Movel ‘ABC’ @Arr, X
False
No Limit
637. For CHAIN, SETLL, SETGT, READE, READPE & READE where indicators are given & their success?
Opcode Success Indicator CHAIN OFF HI READ, READE, READP, READPE OFF EQ SETLL ON EQ SETGT ON HI
It is group of records read from or written to display file in a column format. It is always a subset of records from
physical file hence the name subfile.
There are the two mandatory key words for subfile program /design. While SFL is used to define Subfile record format
while SFLCTL is used to define Subfile Control Record format. And this two are the different parts of sub-file.
Load All - In which all the records from the Physical file or at max. 9999 records are written to subfile. Here subfile
size should 9999 or the number of records form PF which ever is less. In this case PAGEUP AND PAGEDOWN is taken
care by system. SFLPAG should be less than SFLSIZ.
Single Page/non-elastic – In this case sub file size (SFLSIZ) must be equal to sub file page (SFLPAG). For example, if
SFLSIZ = 10 and SFLPAG = 10, then 10 records from file are written to subfile. In this case PAG.
Expandable/elastic/growing – In this case SFLSIZ should be grater at least by 1 than SFLPAG.(this is applicable to
Load all type also). For example, SFLSIZ = 10 and SFLPAG=9, then 10 records from written the sub file from physical
file but only 9 are displayed on screen.
SFLCSRRRN will give the RRN of the record where the cursor is positioned.
SFLRCDNBR will give the RRN of the First record displayed on the screen at a given time.
Whenever a record is changed on display file. An MDT is set ON. If an indicator is associated with SLFNXTCHG and it is
SETON then READC will read only the changed record. And if the indicator is not associated and it is seton it READC
reads all the records from sub-file
With the help of READC op-code we can read only changed records from subfile.
SFL, SFLCTL, SFLDSP, SFLSIZ, SFLPAG are the mandatory key words. SFLDSPCTL, SFLCLR, SFLINZ, SFLEND are the
optional key words used in subfile.
With help of op-code SETLL from RPG/RPGLE, it will position the record pointer just before the required record. Next
READ will read that particular record.
LR indicator – It close all the open files, Frees the space and release ODP.
RETURN – It dose not close files and dose not release the ODP and passes the control to the calling program /
command prompt if the program is called from command prompt.
There are only two operations on indicator those are SETON and SETOFF.
One is DELETE and other with the help of O-Specs ADD/DEL specify DEL.
With help of two op-code BEGSR(Begin subroutine) ENDSR (End subroutine) and between these two op-codes write the
instruction. The whole construct is defined as subroutine.
656. In case of Load all sub-file, if we type options and then PGDN,PGUP , will options be there on the display /in subfile.
657. How will you take care of multiple options in case sub-file?
658. If we type some options on screen out of which some are invalid and pressed enter, what should happen?
It should process all the valid options before invalid options encounter. Once invalid options is encountered program
should stop processing and display error message at the bottom of the scrreen.
While loading subfile move RRN, KEYVALUE in to a two dimensional array. When a key value is entered
into POSITION TO field, having a LOOKUP into a array we can get a corresponding RRN. Assigning RRN
value to SFLRCDNBR and then displaying the sub-file.
It is an exception/error handling routine which is specified in F-Sepcs for a file. INFSR(*PSSR), INFSR is an information
subroutine to specify the routine name in F-specs.
Whenever an exception/error occurs and *PSSR is declared in F-specs, it is automatically goes to *PSSR
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.
A procedure is the set of self contained high level language statements that can perform a particular task and then
returns to a caller.
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
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
We can not trace out at which point the value of variable is changed.
A Service Program is a collection of runnable procedures and available data items easily accessible by other ILE
programs. In many respects it is similar to a subroutine library and procedure library.
It does not contain a program entry procedure. This means that you cannot call a service program using the CALL
operation.
A service program is bound into a program or other service programs using binding by reference.
?????????????????????????????
677. If we tried to move year part of *ISO date into a field of length 3, what will happen ?
By using the standard Built In Expressions like %FOUND,%EOF, NOT %EOF, %BOF, NOT %BOF…etc.
Display / Printer File
EDTCDE & EDTWRD are key words used for formatting purpose. EDTCDE cannot be applied to Character filed. And
EDTCDE has some Codes pre-defined for example, EDTCDE(Z) – for suppressing the leading zero Y – for date field.
EDTWRD can be used to define user defined formatting for a fields.
680. OVERLAY
It allows a record format to be displayed on screen retaining the previous displayed record formats.
With the help of Command attention key we can pass only the indicator status to program not the data from screen.
While command function key passes indicator status as well as a data from screen to program.
with the help of Validity check key words VALUE, RANGE, COMP
684. Disadvantage of using Validity Check keyword? How to overcome these disadvantages ?
We must define error message record format (SFLMSG). And a Program Queue. (PGMQ) and Record format is
associated to a line number.
With the help of RTNCSRLOC keyword, here we need to define a field to get row and column. Length of variable
should be 5,0 fixed We can specify *FILED for filed *REC for Record on which a key is pressed.
688. What is the stored procedure and how do you define a stored procedure.
A stored procedure is a program that can be called to perform operations that can include both host language
statements and SQL statements. Procedures in SQL provide the same benefits as procedures in a hot language. That
is, a common piece of code need only be written and maintained once and can be called from several programs.
Stored procedures can be used in both distributed and non-distributed applicaitons.
We can have parameters as IN , OUT , INOUT type. Language can be RPGLE, C, CL, etc.. MYLIB/PROC1 this PROC1 is a
program written and compiled separately and it is of language which you are specifying in section LANGUAGE.
689. Writing an SQL statement from selecting records from TWO files using single statement and Nested select statement.
By adding Referential Integrity Constraints to a Physical file or Logical file. Constraints like PRIMARY KEY, FOREGIN
KEY, DELETE RULE, UPDATE RULE. ETC.
Commands are ADDPFCST for Physical file and ADDLFCST for Logical file.
Type of constraints
*REFCST - A referential constraint is being added
*UNQCST - A unique constraint is being added.
*PRIKEY - A primary key constraint is being added
*CHKCST - A check constraint is being added
If we want to have a look where the stored procedure, we can have a look through SQL.
Select * from ?????????????????????
View will not any data.. It only shows a data from table while Index has a Indexing Data for a sequence on which Index
is created. View is similar to Logical file without having Key and Index is similar to Logical File having Key (as keyed
logical file has access path data) Table is similar to PF.
693. Can we have records (with fields from more than one file) from multiple files and Nested / sub query in SQL ?
Yes, we can have record from multiple file with join condition and we also can have nested query or subquery like
SELECT * FROM FILE1 WHERE FILE1.FLD1 IN (SELECT FILE2.FLD1 FROM FILE2)
Define Cursor
Declare Cursor
Open Cursor
Fetch record
Processing
Close Cursor
697. What are the two important parameter while creating a SQLRPGLE program ?
698. Can we update database file with the help SQL Cursor ?
While declaring the cursor if we specify FOR READ then we cannot update but if we specify FOR UPDATE or nothing
(by default is FOR UPDATE) then we can update database file.
Yes, Records selected into cursor are locked when the cursor is opened.
700. What will happen if we call stored procedure again and again ?
It the creation of procedure is included in the called program, then we can have different set of output depending
upon the parameter passed to it. And If creation is outside the called program then we will be available with only one
set of output.
Miscellaneous
Library is an AS/400 object of type *LIB. It can contain all types of objects except another object of
type *LIB
It is sequence of objects of type *LIB, from which we would retrieve or save the required object.
It is Run-time environment, which provides all the resources required for the execution of program along with
necessary memory space required.
Trigger are the programs which are activated upon certain event. AS/400 triggers are file level triggers.
???????????????????/ needs to elaborated more….?????????????????
Job where user interaction is present is called an interactive job. A job where user interaction is not required is
called a batch job.
List that indicate libraries used for the process and the order in which it has to be searched. For example to find an
object system will search in the in the ascending order of libraries mention in library list.
Jobs go into the job queue in order to run in a subsystem. Print queue where the printer files (report) reside and wait
for their turn to get printed.
Data area is a type of an object which is used for storing data. It is defined using opcode *NAMVAR. The data is read
by "IN" and written by "OUT" opcode.
710. Which program RPG or CL is efficent to update a transaction onto a database file and why ?
CL program cannot update/write onto a data base file and hence, choice is RPG program.
It is associated to each job (Other Jobs can't access the other's QTEMP). QTEMP is created when the Job is started and
deleted when Job is closed.
OVRDBF is a command to temprorarly over ride the parameters of a Data base file. It is used in association with
OPNQRYF, to use different file with same record format in a program.
713. What kind of job is it --- you have signed on AS400 and then typed Call XYZ and pgm XYZ is an RPG program which
simply reads a database file and generates report.
It is not a job.
Main storage and disk stroage appears contiguous. An object is stored and retrieved via a device-independent
addressing mechanism.
OPNQRYF is temporary Logical file. OPNQRYF is used for dynamic selection, situation where frequency to run the
programs is less & very large number of records are present in data base file.
It is used to debug the batch programs or debug the interactive program of another job.
Physical file contain data where as logical file serve as access path.
719. How many record formats can you have in a Physical & Logical file?
Physical file can contain only one record format where as Logical file can have more than one record format.
720. Which is the better option to write a transaction (order header and detail transaction) using two physical files or one
join logical file(on those two physical files) in a program and why ?
Using two physical files is the better option because records can't be written through join logical file.
721. Can we have a multi record format join and non join logical file based on one physical file ?
We can only have Join logical file based on one physical file.
723. What is difference between Multi record format Join and Non- Join logical file ?
Multi record format logical file contain more than one record format( based on one or more physical file) With join
logical file only read operation can be done whereas in non-join logical file all operations can be done.
Triggers are programs (which carry out a particular business function) invoked either before or after manipulation of
the records in a database. Referential integrity maintain the integrity of a database using key fields.
Yes
726. Can a file be used under commitment control without being jorunaled ?
No
Difference is in program development (specification), program creation (create module, bind module to create
program), program running (activation group, resource sharing).
729. What are different types of Arrays and what is the difference between them ?
There are 3 types of arrays Compile time, Pre-Run time and Run time. Compile time array gets value at the time of
compilation of the source of a program. Pre-run time array gets value from a file at the beginning of a program
execution (before any statement of a program is executed). Run time array gets value during the program execution.
A data structure is a variable field which is partitioned by defining variable fields (call as Sub fields). Various uses are
converting character value into numeric, splitting date field into day, month and year, combining various key fields to
make one key field and so on.
732. Can an indexed file (File with key fields) be accessed in arrival sequence in an RPG program ?
Yes, don't specify "K" in F specification in the program for this file.
*LIKE defines program variable same as that of another pre defined variable. *NAMVAR is used to define variable as
Data area.
In a printer file the printing control goes to the line (of the page) mention in SKIPB where as it leaves number of lines
mention in SPACEB
736. How will you display a particular page (or record) in a Sub file?
Move a valid relative record number(RRN) in the field specified using SFLRCDNBR keyword in DDS
737. What is difference between Command Function and Command Attention key?
Command function key returns variable value along with response indicator (associated with CF key) where as
Command attention returns only the response indicator value.
There are three types of Subfile (1) Load all Subfile (Page Size = 9999) (2) Extendable Sub file (Sub file size > Sub file
page), (3) Load by Page (Sub file size = Sub file page)
To read the change records for 2nd, 3rd,...times from sub file after reading them once.
RTNCSRLOC returns the location of cursor into the variable (associated with this keyword) and SFLCSRRRN returns the
relative record number where the cursor is positioned.
742. What's the difference between CHAIN and SETLL? Is there a performance advantage?
743. The maximum number of subfiles that can defined in a RPG program for one display file is?
24