Académique Documents
Professionnel Documents
Culture Documents
AND
s ON
AS /400
Q 106 What is the library order in which the search is done for an object ?
Answer: The search order is as follows:
System libraries, Product libraries, Current library, User library list.
Q 107
2
Q 201
as used in RPG ?
Ans
Q 202
Ans
Q 203
Ans
Q 204
Ans
All occurrences of data structure have the same attributes and can be referred to
individually.
Q 205
Ans
An IN operation with *LOCK specified has an exclusive allow read (*EXCLRD) lock
state
* An IN operation without *LOCK specified has a shared for read (*SHRRD) lock
state while transferring data. When the transfer is complete, RPG/400 program
releases the lock.
* An OUT operation has an exclusive (*EXCL) lock state during the transfer of
data and then lock state is released. The RPG/400 program then releases the
exclusive allow read (*EXCLRD) lock state established by the IN operation.
Q 206
Ans
OPCODE
CASxx
CHECK
CHECKR
*LIKE
FEOD
FORCE
FREE
*NAMVAR, IN
LOKUP
MOVEA
MVR
OCCUR
OUT
POST
RESET
SHTDN
OPCODE
SORTA
SQRT
SUBST
TAG
TESTB
TESTN
TESTZ
UNLCK
XFOOT
XLATE
Q 207
FUNCTION
Conditionally evokes a subroutine
Checks if each character in the source string is among the valid
characters indicated in Factor 1
Checks the above condition from right
Defines a field based upon the attributes of another field
Factor 2 - Name of the field being referenced
Result - Name of the field
Forced end of data
Only for primary and secondary files.
Factor 2 contains the name of the file from which the next
record is to be retrieved.
Deactivates a program
Retrieves data area
To search an array
Move an array
Move remainder to result field
Retrieve Data structure ( Multiple occurrence)
Write to data area and exit
Returns information in INFDS data structure
Sets elements in a structure ( Record format, DS, array, Table
etc., ) to its initial value.
Informs the user if the system operator has given a Shutdown.
FUNCTION
Sort an array ( Ascending / Descending)
Square root
Substring of a field is picked up
Defines Label Comes with GO TO and CABxx
Test Bit . Identifies the FAC 2 with the corresponding bits in field
name as result field.
Test Numeric
Tests if a field is a character field.
Unlocks a data area or releases a record.
Gives the sum of the elements in an array
Factor 2 is translated as per the Table name in factor 1
What is the maximum No. of nested loops that you can have in RPG ?
Ans : 50
Q 301
1.
Because the commands are compiled and stored in a form that can be run immediately, using CL
programs is faster than entering and running the commands individually.
2.
3.
Some functions require CL commands that cannot be entered individually and must be part of a CL
program.
4.
5.
Parameters can be passed to CL programs to adapt the operations performed by the program to the
particular requirements of that use.
Q 302
Q 303
Q401
How many record formats can a Physical File / Logical File have ?
Ans
A Physical file can have only one record format whereas a Logical file can have multiple
record formats.
Meaning
Applicable To
ALL
ALL
PF & LF
LF
LF
Join LF
DSPF only
Q 406 What are join logical files and what are their advantages ? How many maximum Physical Files
can we join ?
Answer: Join logical files are special case of logical files wherein we can select fields from different
Physical files having some relation. A maximum of 32 physical files can be joined in a join logical file.
Q 407 What is a message file ? How is it advantageous ?
Answer: A message file is used to store application related messages. It consists of two parts, the
Message Id and the Message Description. The advantage is that a standard list can be maintained and called
wherever necessary.
Q 408 List various data types that can be used to define a field ?
Entry
A
P
S
B
F
H
L
T
Z
Meaning
Character
Packed Decimal
Zoned Decimal
Binary
Floating point
Hexadecimal
Date
Time
Timestamp
If a duplicate key value is allowed then how would the system store
data ?
In this case we can specify that records with duplicate key values are stored in
the access path in one of the following ways :
a. Last in first out (LIFO)
b. First in first out (FIFO)
c. first changed first out (FCFO)
Q 416
Q 417
Q 418
Q 419
Q 420
Q 421
Q 422
Comparison Chart
IMMEDIATE
Fast open because the access
path is current
Slower
update/
Output
operations as the sys. must
maintain the access path
immediately
during
these
operations.
REBUILD
Slow open as the access path
must be rebuild
Faster
Update
operations
Output
DELAYED
Moderately fast. Access path
need not be build but must be
changed.
Moderately fast Update / output
operations
Q 423
Q 424
Q 425
Q 426
5
Q 501
SUBFILES
What is the maximum number of Subfile Records in a Subfile ?
Answer: 9999
Q 502
Q 503
Q 504
Q 505
An Index is used by the system for faster data retrieval. An Index must be created in an SQL
collection but the tables or files the index is created over can reside either in a collection or
library.
COMMENT ON statement is used to give comments to the view or table. Comments are
stored in the REMARKS column in the SYSTABLES.
7
Q 701
SYSTEM ADMINISTRATION
Ans : Minimal security : No pass words are used and any user can perform any function.
Password security : Pass words must be used, however any user can perform any function.
Resource security : Pass words are required and users can be controlled relative to the
objects they use, change or delete.
Q 702 What are the various user classes in AS/400?
Ans
1. System/Security Administrator
2. Security Officer
3. System Operator
4. Programmer
5. User
8
Q 801
Ans
WORK MANAGEMENT
what is the difference between Command Attention (CAnn) and Command Function
(CFnn) keys?
CAnn : These keys return only the indication of the function key pressed and not
data(data on the screen).
CFnn : These keys cause all input data(given to the screen) to be returned along
with the function key pressed.
Q 802 What are data areas ? What are their advantages ? Give an example
Answer: A Data Area is an object used to hold data for access by any job running on the system. A
data area can be used whenever you need to store information of limited size, independent of the
existence of programs or files. Typical uses of data areas are:
To provide an area (perhaps within each jobs QTEMP library) to pass information
within a
job
To provide a field that is easily and frequently changed to control references within a
job,
such as:
Supplying the next order number to be assigned
Supplying next check number
Supplying the next save/restore media volume to be used
To provide a constant field for use in several jobs, such as tax rate or distribution
list.
To provide limited access to larger process that requires the data area. A data area
can be locked to a single user, thus preventing other users from processing at
the
same time.
Local
Data Area
Group
Data Area
Program
Initialization
Parameter (PIP)
Data Area
Created By
Size
Type
No. Per job
Referred as
User
Variable
(1 - 2000)
Char/ Dec/
Logical
Variable
System
Fixed
(1024 )
Char
System
Fixed
(512 )
Char
System
Fixed
(2000 )
Char
One
*LDA
One
*GDA
One
Q 805 What is the variable used for automatic numbering of the Pages, Where and How do you
specify the same?
Answer: This is done by specifying PAGE in the Output Spec without being specified elsewhere, it is
assumed to be of length 4 with no decimal places.
Q 806
Is it possible to incorporate the command line facility into an user application? If so how is it
done?
Answer: Yes, it is possible. We can call QUSCMDLN to take us to the command line.
Q 807 What is a Subprogram ? What are relative pros and cons of using a subprogram ?
It is a child program called by a main program.
Adv :
1. You can have subprogram written in different languages which are called by one main
program.
2. If the code for a program becomes very large, It can be brokn into subprograms, thus the
maintenance of cod becomes easier.
Drawbacks :
1. Program initialization time increases.
2. Incrased open and close of files that results in an additional ODP
Q 808 What are various types of sharing on AS /400 ?
1. Data sharing
2. Record Format sharing
3. Access path sharing
Q 809 What is PAG ?
PAG is Process Access Group . They are temporary variables for each job started in
different places.
Q 810 What is POOL ?
There are four types of POOL
1. Machine / Storage pool - All the system codes are run
2. Interactive pool
- For Interactive jobs
3. Base pool
- For all sorts of jobs
4 Other reserved pools
Q 811 What do you mean by ACTIVITY LEVEL ?
Activity level is the no. of jobs that be simulteneously run.
e. g. Activty level 4 means that 4 jobs can be run simulteneously in machine.
Q 812 What is a Data Queue ? What are the commands related to it ?
A Data queue is an object that is used for faster data transfer.
It does not contain any data but only the data description.
Related commands are :
QSNDDTAQ - To send data to a data queue.
QRCVDTAQ - To receive data from a data queue.
Q 812 What is an asynchronous process ?
It is a process that can be executed concurrently with a job.
e.g Submitting a job in Batch.
EXCEPTION/ERROR HANDLING:
The RPG/400 compiler handles 2 types of errors: Program exception or errors and File exception or
errors.
Some examples of program exception or errors are divisible by zero, Invalid array index or SQRT of
a negative number.
Some examples of file exception or errors are undefined record type or a device error.
FILE EXCEPTION/ERROR HANDLING
FTRNFIL
F
FMSTFIL
F
FAUDITFIL
OF
DISK
UF
DISK
OF
DISK
KINFDS
KINFSR
KINFDS
KINFSR
FILDS1
ERRRTN
FILDS2
MSTERR
Three files are defined on the F-Spec. You want to control the program logic if an exception
or error occurs on the TRNFIL or on the MSTFIL file. Therefore, a unique INFDS and a INFSR are
defined for each File.
IFILDS1
I
I
I
I
I
IFILDS2
I
I
I
I
I
DS
*FILE
*RECORD
*OPCODE
*STATUS
*ROUTINE
FIL1
REC1
OP1
STS1
RTN1
*FILE
*RECORD
*OPCODE
*STATUS
*ROUTINE
FIL2
REC2
OP2
STS2
RN2
DS
The location of the subfields in the file information data structures is defined by special
keywords in positions 44 through 51. To access these predefined subfields, you must assign a name
to each subfield in positions 53 through 58. If an exception or error occurs, you can test the
information in the data structure to determine, for example,what exception or error
occured(*STATUS) and on which operation it occured (*OPCODE). You can then use that
information within the file exception/error subroutine to determine the action to take.
PROGRAM EXCEPTION/ERROR HANDLING
An Indicator can be specified in positions 56 and 57 of the calculation specifications
for any Opcodes. This indicator is set on if an exception/error occurs during the processing
of the specified file operation. The optional program ststus data structure is updated with
exception/error information. You can determine the action to be taken by testing the
indicator.
A program exception error subroutine can be specified. You enter *PSSR in factor1
of a
BEGSR operation to specify this subroutine. Information regarding the
program exception/error
is
made available through a program status
data structure that is specified with an S in position 18 of
the data structure
statement on the input specifications.
If the indicator or the *PSSR is not present, program exception/errors are handled by the
default error handler.
you
The location of the fields in the program status data structure is defined by
special keywords or by predefined From and To positions. In order to access the subfields,
assign a name to each subfield in positions 53 through 58.
*STATUS
*ROUTINE
*PARMS
which the
program
specified.
9
Q901
JOURNALLING
What are JOURNALS ?
A journal and journal receiver are used to record changes to tables and views
in the database. The journal and journal receiver are then used in processing
SQL COMMIT and ROLLBACK statements.
10
Input
Input
Input
Input
Char (20)
Char (10)
Bianary(4)
Char (1)
Public Authority
Text description
Input
Input
Char (10)
Char (50)
Replace
Error Code
Input
I/O
Char (10)
Char ( * )
Domain
Input
Char (10)
Optional (a)
Optional (b)
Input
I/O
Char (10)
Char (20)
Char ( * )
Char ( * )
Char (20)
Binary (4)
Binary (4)
Char ( * )
Char ( * )
Char (20)
Char ( * )
Input
Input
Input
Input
Input
Input
Input
Input
Input
Char (20)
Char (10)
Char
(1)
Binary (4)
Binary (4)
Binary
(4)
Binary (4)
Char
(10)
Char
(50)
Input
I/O
Input
Input
Char
(100
Char ( * )
Char
(10)
Char (10)
Input
I/O
Char
Char
(20)
* )
c.