top of page

Basics Of As400

Interview Q&A

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            : Runs all interactive jobs

            QBATCH           : Runs all batch jobs     

            QCTL               : Only used by system operator, controls the system

            QSPL               : Runs all print jobs

            QCMN              : Runs all communication jobs.

 

RPG / ILERPG / SQLRPG

 

 

Q 201               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 filecan 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               What are the three different types of arrays used in RPG?

                        /* ref.-RPG/400 reference 403 */

 

Ans                                 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               How many Record Address Files can be specified in a RPG program?

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

 

Ans                    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 theexclusive allow read   (*EXCLRD) lock state established by the IN operation.        

 

Q 206               List some important OPCODES in RPG .

 

Ans                 

    OPCODE                FUNCTION

CASxx                       Conditionally evokes a subroutine

CHECK                      Checks if each character in the source string is among the valid characters indicated in Factor 1

CHECKR                    Checks the above condition from right

*LIKE                         Defines a field based upon the attributes of another field

                                 Factor 2 - Name of the field being referenced

                                 Result    - Name of the field

FEOD                         Forced end of data

FORCE                       Only for primary and secondary files.

                                 Factor 2 contains the name of the file from which the next record is to be retrieved.

FREE                         Deactivates a program

*NAMVAR, IN            Retrieves data area

LOKUP                      To search an array

MOVEA                     Move an array

MVR                          Move remainder to result field

OCCUR                      Retrieve Data structure ( Multiple occurrence)

OUT                          Write to data area and exit

POST                         Returns information in INFDS data structure

RESET                        Sets elements in a structure ( Record format, DS, array, Table etc., ) to its initial value.

SHTDN                      Informs the user if the system operator has given a Shutdown.

SORTA                      Sort an array ( Ascending / Descending)

SQRT                        Square root

SUBST                       Substring of a field is picked up

TAG                          Defines Label  Comes with GO TO and CABxx

TESTB                       Test Bit . Identifies the FAC 2 with the corresponding bits in field name as result field.

TESTN                       Test Numeric

TESTZ                       Tests if a field is a character field.

UNLCK                      Unlocks a data area or releases a record.

XFOOT                      Gives the sum of the elements in an array

XLATE                       Factor 2 is translated as per the Table name in factor 1  

 

Q 207     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.

 

  1.       Consistent processing of the same commands and logic.

 

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

 

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

 

  1.       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.   

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                     Meaning                                             Applicable To

       R                                                   Specifies a Record Format name          ALL

       Blank                                             Specifies a Field Name                        ALL

       K                                                   Specifies a  Key Field                           PF & LF

       S                                                    Select Feld                                          LF

       O                                                   Omit Field                                           LF

       J                                                     Join                                                    Join LF

       H                                                    Help spec                                           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            Meaning

A                 Character

P                  Packed Decimal

S                  Zoned Decimal

B                  Binary

F                  Floating point

H                 Hexadecimal

L                  Date

T                  Time

Z                  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 sequene 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 doesn’t allow duplication of even blanks.

whereas *EXCNULL doesn’t 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.

Q 417     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) relationa database language.

                c  OS/ 400 Control Language ; You can use CL command CRTPF or CRTLF or CRTSRCPF.

 

 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                                                                             REBUILD                                                              DELAYED

Fast open because the access path is current                          Slow open as the access path must be rebuild   Moderately fast. Access path need not                                                                                                                                                                             be build but must be changed.

Slower update/ Output operations as the sys. must maintain

the access path immediately during these operations.

                                                                                               Faster  Update / Output operations             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     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 reading  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

 

Q 501   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.

 

SYSTEM ADMINISTRATION

 

Q 701    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

WORK MANAGEMENT

 

Q 801    What is the difference between  Command Attention (CAnn)  and Command Function  (CFnn) keys?                                                                                                                           

Ans                  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 thexistence of programs or files. Typical uses of data areas are:

 

  •             To provide an area (perhaps within each job’s 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 an 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      User                                System                          System                         System

Size                Variable(1 - 2000)           Fixed(1024 )                  Fixed(512 )                  Fixed(2000 )

Type               Char/ Dec/ Logical          Char                              Char                            Char

No. Per job     Variable                            One                               One                             One

Referred as                                            *LDA                              *GDA

 

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 is 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           OF        E                      K          DISK                KINFDS    FILDS1

            F                                                                                              KINFSR    ERRRTN

            FMSTFIL           UF        E                      K          DISK                KINFDS    FILDS2        

            F                                                                                              KINFSR    MSTERR      

            FAUDITFIL        OF        E                      K          DISK               

 

                        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                        DS

            I                                                                                   *FILE                FIL1

            I                                                                                   *RECORD         REC1

            I                                                                                   *OPCODE         OP1

            I                                                                                   *STATUS          STS1

            I                                                                                   *ROUTINE         RTN1

            IFILDS2                        DS

            I                                                                                   *FILE                FIL2

            I                                                                                   *RECORD         REC2

            I                                                                                   *OPCODE         OP2

            I                                                                                   *STATUS          STS2

            I                                                                                   *ROUTINE         RN2

 

 

                        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.

 

  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, you 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 which the exception/error occured.                                         

               *PARMS           Three-digit numeric field that contains the name of the program in which this program                                                                                            status data structure is specified.          

 

           *PROGRAM      Ten-position character field that contains the name of the program in which this program status data structure is specified.

 

JOURNALLING

 

 

Q901    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.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

           

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

     

bottom of page