Vous êtes sur la page 1sur 15

Qs

AND

s ON
AS /400

AS/ 400 Machine

Q 101 What is the advantage of layered machine architecture of AS/400?


Ans : This unique machine architecture allows applications to be protected from any
hardware changes, both processor upgrades, and attachment of new devices.
Q 102 What is the storage management technique used by the AS/400 system?
Ans : Virtual storage technique. As/400 system implement their Virtual storage scheme
through a concept called the SINGLE LEVEL STORAGE. This term simply means that in
AS/400 systems, no distinction is made between disk storage and main storage. All storage
appears to be one homogeneous sea of main storage accessed exactly in the same way.
Q 103 a) What is the size of Virtual storage supported by AS/400 ?
Ans : 281 terabytes.(over 281 trillion unique addresses)
b) How many address lines are needed for that ?
Ans : 2 to the power of N = 281 trillion bytes
There fore N = 48
So 48 address lines are needed.
Q 104 What is the advantage of Object orientation in AS/400?
Ans : Object orientation makes users independent of the implementation techniques and
addressing structure used in the machine. Objects are created in a standard format using a
created instruction. Once the object is created its internal format is not apparent to the user.
This process is known as DATA ENCAPSULATION.
Q 105

Give any four advanced characteristics of AS/400 ?


Ans : 1. Layered machine architecture
2. Object orientation
3. Single level storage
4. Integrated data base
5. C-level security
6. SAA (Strategic Systems Application Architecture)

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

What are the subsystem configurations supplied by IBM ?


Answer: The subsystems supplied by IBM are as follows:
QINTER
QBATCH
QCTL
QSPL
QCMN

: Runs all interactive jobs


: Runs all batch jobs
: Only used by system operator, controls the system
: Runs all print jobs
: Runs all communication jobs.

2
Q 201

RPG / ILERPG / SQLRPG


List various specifications

as used in RPG ?
Ans

H Spec : Control Specification


Gives information about program generation and running.
Like Page No, Line , Date format, Debug, Currency Symbol,
Date Edit etc.,
F Spec : File Specification
Defines all files used in the program.( A Max. of 50 files can be declared
in RPG with a max. of 8 Printer files. Only one record address type file
can be declared pre RPG program )
E Spec : Extension specification
Defines Record address file, Array, Table etc., ( A max. of 200 arrays can
be defined)
L Spec : Line contour specification
Used for program described PRINTER files to define the No of lines and
form to print on a page.
I Spec : Input specification
For program described Input files, fields within a record, data within a
field, control fields etc.,
C Spec : Calculation specification
Indicates operations to be done on Data.
The order is,
1. Detail Calculation
2. Total Calculation
3. Subroutines
O Spec : Output specifications
Describes the record and the format of fields in a program described
output file and when the record is to be written.

Q 202
Ans

What are the three different types of arrays used in RPG?


/* ref.-RPG/400 reference 403 */
1. The RUN-TIME array is loaded by the program while it is running.
2. The COMPILE-TIME array is loaded when the program is created. Then it
becomes the permanent part of the program.
3. The PRERUN-TIME array is loaded from an array file when the program
begins running, before any input, calculation, or output operations are
processed.

Q 203
Ans

How many Record Address Files can be specified in a RPG program?


/* ref.-RPG/400 reference 457*/
Only one

Q 204

What is multiple occurrence data structure.?

Ans

A multiple occurrence data structure is a data structure whose definition is


repeated in a program to form a series of data structures with identical formats.

All occurrences of data structure have the same attributes and can be referred to
individually.
Q 205

What are different lock states of data areas in RPG/400?

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

List some important OPCODES in RPG .

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

CLP and System Commands

Q 301

What is CL? What are the advantages of using CL ?


Answer: CL stand for Control Language. It is the primary interface to the operating system and can
be used at the same time by users at different workstations.
The advantages are:

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.

Consistent processing of the same commands and logic.

3.

Some functions require CL commands that cannot be entered individually and must be part of a CL
program.

4.

CL programs can be tested and debugged like other HLL programs.

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

What is a MONMSG command? What is its use ?


Answer: The MONMSG command is used to monitor the error messages generated during the
execution of a program and take necessary action.

Q 303

What are the different Override commands ?


Answer: OVRDBF, OVRTAPF, OVRDSPF, OVPRTF, OVRDKTF

Q 304 Can a CL use Subfile ?


Answer: Only MSGSFL can be used
Q 305 How to find the number of record in the object ?
Ans : DSPFD <Lib> / < Obj>
Q 306 How to find the number of members in an object ?
Ans : DSPFD <Obj> TYPE <*mbrlist>
Q 307 How to find the Field description of an object ?
DSPFFD , DSPOBJD
Q 308 How to access all the members in a PF ?
Ans : Use OVRDBF with the member option *ALL
Q 309 What is the function of DSPDBR ?
Ans : Display Database Relations. To display a list of all Logical files based on a Physical file.
Q 310 What is the function of command FNDSTRPDM ?
Ans : Searches for member or file for a particular string.
Q 311 What is the function of command DSPPGMREF?
Ans : Displays list of all the files / programs referred by a program.
Q 312 What is the function of command RCLRSC ?
It is Reclaim Recources command. It frees the static storage and the unused ODPs.
Q 313 Which command related to Data Area can not be used on the command line ?
RTVDTAARA. Retrieve Data Area. Because we need to specify a return varible that receives
the retun value. Hence this command can be used only in CL and not on command line.

4 DDS / DISPLAY FILES / COMMAND / PRINTER FILES / RLU / HELP

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.

Q 402 Define OMIT / SELECT with reference to a LF .


Ans : They are used to omit or select record based on a criteria. O or S is defined in position 17
and the criteria is specified in function space.
S FIELD

COMP ( FIELD > 500)

Q 403 How to add members to a PF object ?


Ans : ADDPFM <Obj> / <Mbr>
Q 404 Define various forms of Normalization.
First form of Normalization : At least One key field should be defined which controls other fields
Second form of Normalization : In case of a compound key, any non key field should be dependent
on the complete KEY.
Third form of Normalization : A Non key field should not be dependent on any other non key field.
Q 405 What are various spec types as applicable to DDS ?
Specification
Type/ Name
R
Blank
K
S
O
J
H

Meaning

Applicable To

Specifies a Record Format name


Specifies a Field Name
Specifies a Key Field
Select Feld
Omit Field
Join
Help spec

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

* AS /400 system performs arithmatic operations more efficiently for packed


decimal than for zoned decimal.
Q 409 What do you mean by an access path ?
An access path describes the order in which the records have to be retrieved.
Q410 What are various access paths as applicable to PF and LF?
For a PF We can have,
a. Arrival sequence access path

b. Keyed sequence access path.


For a LF we can have,
a. Arrival sequence path
b. Keyed sequence path
c. Select and Omit criteria
Q 411 What is Arrival sequence access path ?
It is based on the order in which the records arrive and are stored in the file.
An externally described file has an arrival sequence path when no key fields are sopecified.
It is the only processing method that allows a program to use the storage space
previously occupied by a deleted record by placing another record in the deletd space.
An arrival sequence access path does not take any additional storage and is always
saved or restored with the file.
Q 412 What do you understand by Keyed Sequence Access Path ?
A keyed sequence accesss path is based on the contents of thekey fields as defined
in DDS .
Q 413 How are Character and Numeric key fields arrenged ?
Character key fields are arrenged based on the sequence defined for
EBCDIC characters. They can also be defined based on an alternating
collating sequence.( Keyword ALTSEQ in DDS )
Key fields defined as numeric are arrenged based on their algebric
values, unless ABSVAL or UNSIGNED are specified for it.
Q 414 What is significance of Keyword UNIQUE ?
This File leve keyword is used to prevent a duplicate Key value.
By specifying this keyword a record can not be entered or copied into a file if
its key value is the same as that of a record already existing in a file.
*INCNULL parameter of UNIQUE doesnt allow duplication of even blanks.
whereas *EXCNULL doesnt check if duplication exists in the form of blank
values.
Q 415

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

Can we use an already existing access path ? How ?


Yes. We can use DDS keyword REFACCPTH to use another files access path.
This keyword, however, can not be used with the join logical files.
Describe various ways of creating a database file ?
The system supports various ways of creating a database file ;
a. OS /400 IDDU ( Interactive Data Definition Utility )
b. SQL / 400 : It is a IBM System Application Architecture (SAA) relational
database language.
c OS/ 400 Control Language ; You can use CL command CRTPF or CRTLF
or CRTSRCPF.

Q 417

Q 418

What do you do if you have store data in a perticular palace in auxillary


storage ?
System by default automatically finds a place to store data. However if you
wish to specify which disk you want the file located on, specify the UNIT
parameter while creating file. In case there is not sufficient space in the UNIT
you have specified then the data is stored in some other unit and an
information message is flashed.

Q 419

What is the significance of parameter FRCRATIO ?


Normally the system decides when to write changed data from main storage
to Auxiliary storage. if you want to control when database changes are written
to auxiliary storage, you can do so using FRCRATIO on either the create,
change, or override database commands.

Q 420

What do you undestand by parameter FRCACCPTH ?


This parameter controls when the access path is written to auxiliary storage.

Q 421

What do you understand by parameter LVLCHK ?


This is a default parameter that checks the level compatiblity of the file when
any program tries to open it. In case of mismatch of level an error message is
delivered.

Q 422

What are various ways of maintening an access path ? Why do we need


to maintain access path ?
While a file is open, the system mainains the acccess path as changes are
made to the database file.
Because more than one access path can exist for the same data, changin data
in one file might cause changes to be made in access paths for other files that
are not currently open.
The type of access path maintainance can be specified on MAINT
parameter.Three ways of access path maintenance are :
A. IMMEDIATE : It means that the access path is maintened as changes are
made to its associated data, regardless if the file is open.
B. REBUILD : Means that the access path is maintained only when the file is
open and not when the file is closed. The access [path is rebuilt when the file
uis opened the next time.
C. DELAYED : means that any maintenance for the access path is done after
the file member is opened the next time and while it remains open. Delayed
maintainance can be faster than REBUILD but if the collected changes exceed
approx. 25 % of the # of entries in the access path the changes are no longer
accumulated and the sytem rebuilds the access path at the next open.

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

How do you recover access path if the system fails ?


Use RECOVER parameter while creating a file. On this parameter specify that
the access path should be REBUILD.

Q 424

What are WAITFILE and WAITRCD parameters while creating a file ?


When you create a file, you can specify how long a program should wait for
either file or record in the file if anothe job has it locked . If the wait time ends
before the file or record is released then an error message is sent.

Q 425

How do oy specify public authority while creating a file ?


Use AUT parameter.

Q 426

5
Q 501

Define some important keywords as related to LF .


a. SST `
: To specify which fields are in substring.
b. RENAME : To rename a PF field in logical file.
c. TRNTBL
: To define translation table for a field. The value in PF will be
translated as specified in the translation table while readin
LF.
d. DYNSLT : Dynamic select or omit. Only records whch meet Slect or Omit criteria are picked up
by logical . Its a file level keyword
e. CONCAT : Concats fields of PF to get a new field.

SUBFILES
What is the maximum number of Subfile Records in a Subfile ?
Answer: 9999

Q 502

What is a Message Subfile ?


Answer: A message subfile is a special type of subfile which is used to send messages to the
workstations. It has the facility to store multiple messages so that the user can go and check for the
list.

Q 503

Can a CL use Subfile ?


Answer: Only MSGSFL can be used

Q 504

What is a relative record number in subfiles?


Answer: It is used as a subfile record pointer. Using this one can position to any record
in the subfile.

Q 505

What are different types of subfiles ?


They can be divided as
a. Equal subfile - Subfile size = Subfile page
b. Unequal Subfile - Subfile size > Subfile page
1. All Load Type - Loads all the record from file
Both pageup & pagedown controlled by system.
2. Expanding type - Loads subfile page by page
Pageup is taken care by system but the user should take care of
pagedown.
They can also be divided as :
a. Vertical Subfile - Displays records vertically
b. Horizontal Subfile - Displays records horizontally. i.e. More than one
record in one line.

Q 506 What are the advantages of using a subfile ?


A subfile is used to display multiple records on the screen.
1. We can process multiple records from the screen thereby the
productivity and simplicity are improved.
2 . Ease of modifying.
3. It simulates Arrays and data stuctures. In case of arrays and data
structures the length has to be defined beforehand. This limitation
does not apply to subfiles.
Q 507 Describe the basic subfile structure ?
A subfile issencially consists of two parts :
1. Subfile control format: It defines the header of the subfile.
2. Subfile record format : It is a file that resides in memory.
It holds the subfile records which reside in yhe memory
with the job. It also defines the record layout of the subfile.
Q 508 What are the keywords mandatory to define a subfile ?
The mandatory keywords are :
1. SFLCTL - To specify subfile control format
2. SFLDSPCTL - To display subfile records
3. SFLDSP - To display the subfile format domain
4. SFLPAG - Usualluy but not always the # of records to be displayed on the
screen.
5. SFLSIZ
Q 509

List some other important keywords related to a subfile ?


1. SFLINZ - Allows to activate the # of records specified on the keyword
2. SFLRNA - record not active
3. SFLNXTCHG - To flag a subfile record as changed, and if the program displays it
again, not to lose the attribute.
4. SFLMODE - is 0 if not SFLDROP
is 1 if SFLDROP
5. SFLCSRPRG - Subfile cursor position
To control what field the cursor should be positioned to.
( To progress down a field )
6. SFLRCDNBR - To display the [page that contins the record having

specified sufile record number.(RRN)


7. SFLENTER - Makes the ENTER key act as rollup key.
SFLENTER (CF11) makes F11 key act as enter key.
8 SFLROLVAL - Subfile roll value . The ability to control the # of
records to be rolled. (Less than SFLPAG )
9 SFLCSRRRN - Subfile cursor relative record Number.
Returns the RRN of the subfile record on which
the cursor is positioned.
10. SFLLIN - gives the spce between records in case of a horizontal
subfile.
11. SFLFOLD - To define a horizontal subfile
12. SFLDROP To define a vertical subfile.
Q 510 What is the max. # of windows that can be activated at a time ?
Ans :
12

QRY AND SQL

Q 601 What are CORRELATION NAMES ?


SELECT EMPNO, LASTNAME, USER1/TDEPT.DEPTNO, DEPTNAME
FROM USER1/TEMPL X, USER1/TDEPT Y
WHERE JOBCODE>59
AND SEX = F
AND X.DEPTNO = Y.DEPTNO
Where X and Y are called correlation names.
Notes on View
The following restrictions apply for VIEWS
* Can not change, insert, or delete data in a view if it includes any of the following
-- A FROM clause that uses more than one table(a join)
-- The FROM clause that identifies a read-only view.
-- Any of the SQL column functions(SUM, MAX, MIN, AVG or COUNT)
-- Elimination of duplicate rows.
-- Grouping(GROUP BY) or HAVING
-- A subquery, such that the base object of the outer-most SELECT and a
table of a subquery are the same table.
In the above case, we can get data from views by means of SQL SELECT statement,
but statements such as INSERT, UPDATE or DELETE can not be used.
* You can not INSERT a row in a view if:
-- The table on which the view is based has a column for which there is no
default value, and that column is not in the view.
-- The view has a column resulting from an expression, a constant, or a
function, and the column has been specified in the INSERT column list.
* You can not update a column of a view that results from an expression, a constant,
or a function.
* You can not use the special register USER.
* You can not use UNION, UNION ALL, FOR UPDATE OF, or ORDER BY in the
definition of a view.
Q 602 What is an INDEX ?

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

what is C - level security?


(or )
What is Minimal security, Pass word security & resource security ?
(or)
What are the security levels supported by the AS/400 system ?

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.

Q 804 What are various types of data areas ?


General
Data Area

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

Five digit numeric field with zero decimal


positions , that contains status code.

*ROUTINE

Eight-position character field that contains


the name of the RPG/400 routine in
exception/error occured.

*PARMS

Three-digit numeric field that contains the


name of the program in which this

which the

program
specified.

status data structure is


*PROGRAM

9
Q901

Ten-position character field that contains the


name of the program in which this program
status data structure is specified.

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.

Q 902 What are COLLECTION ?


A collection consists of a library, a journal, a catalog and a datadictionary.
Tables, views, and system objects can be created, moved, or restored in an
SQL collection. SQL tables, views, and indexes can only be created in into
an SQL collection, moved into an SQL collection or restored into an SQL
collection. AS/400 logical files can not be placed in an SQL collection because
they cannot be described in the data dictionary.
Q 903 What are CATALOGS ?
Catalog views only contain information about objects in one collection. The
information in a catalog is about your SQL collection and its contents.
The catalog describes every table, view, index, and file in the collection and
includes column defenitions.
A catalog is automatically created when you create a collection. You cannot
drop or explicitly change the catalog.

10

APPLICATION PROGRAMMER INTERFACE

Q 1001 List some important APIs with essential parameters.


Ans :
Part I User space APIs
1) Create User Space QUSCRTUS
Parameters : Qualified User space name
Extended attribute
Initial size
Initial Value

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)

2) Change User Space QUSCUSAT


Parameters : Returned library name
Output
Qualified User space name Input
Attributes to change
Input
Error Code
I/O
3) Retrieve user space QUSRTVUS
Parameters : Qualified user space name
Input
Starting position
Input
Length of data
Input
Receiver variable
Output
Optional
Error code
I/O
4)

Delete user space QUSDLTUS


Parameters : Qualified user space name
Error Code

Input
I/O

Char (10)
Char (20)
Char ( * )
Char ( * )
Char (20)
Binary (4)
Binary (4)
Char ( * )
Char ( * )
Char (20)
Char ( * )

Part 2 User Queue APIs


User Queues are permanent objects with an object type *USRQ . They
provide a way for one or more processes to communicate
asynchronously.
1 Create User Queue QUSCRTUQ
Parameters : Qualified User queue name
Extended attribute
Queue type
Key length
Max. Message size
Initial # of messages
Additional # of messages
Public authority
Text description
Optional (A)
Replace
Error Code
Optional (B)
Domain
Pointers
2 Delete User queues QUSDLTUQ
Parameters : Qualified user queue name
Error Code

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)
* )

Part III Object APIs


1 List Objects API QUSLOBJ
It lets you generate a list of object names and
descriptiveinformation
based
on
specified
selection
parameters. The QUSLOBJ API places the list in the specified
user space . The generated list replaces any existing list in the
user space. You can usec this API to ,
a. List Objects in a library
b. List Objects of a type

c.

Provide a backup analysu\is based on when the object was


last saved or updated.
d. Provid source member and object analysis from source
member info. to verify that the current source was used to
create the specified object.
Parameters : Qualified User space object Input
Char (20)
Format name
Input
Char (8)
OBJL 0100 to
OBJL0700
Object & Library Name
Input
Char ( 20)
Object type
Input
Char (10)
Optional
Error code
I/O
Char ( * )
2 Change Object Description API QLICOBJD
It lets you change objrct information about the specified object.
Parameters : Returned lbrary name
Output
Char (10)
Object and library name
Input
Char (20)
Object type
Input
Char (10)
Changed Object information Input
Char ( * )
Error code
I/O
Char ( * )
3 Rename object API QLIRNMO
It renames an existing object to a new object name or a new library name or
both, and optionally replaces the object .
Parameters : From qualified object name Input
Char (20)
Object type
Input
Char (10)
To qualified object name
Input
Char (20)
Replace object
Input
Char (1)
( 0 no, 1 yes)
Error code
I/O
Char ( * )
4 Retrieve object description QUSROBJD
Information similar to DSPOBJD can be retrieved.
Parameters : Receiver variable
Output
Char ( * )
Length of receiver variable Input
Binary (4)
Format name
Input
Char (8)
OBJD01000 -Basic
OBJD0200 - PDM
OBJD0300 -Service info.
OBJD0400 - Full
Object and Library name Input
Char (20)
Object type
Input
Char (10)
Optional
Error Code
I/O
Char ( * )

Vous aimerez peut-être aussi