70+ TOP AS400 Interview Questions and Answers [UPDATED]

If you’re preparing for AS400 job interview and whether you’re experienced or fresher & don’t know what kind of questions will be asked in AS400 interview, then go through the below 70+ Top AS400 Interview Questions and Answers to crack your job interview.

AS400 Interview Questions and Answers

  • Question: How Are The Objects Stored On As/400?

    Answer :

    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.

  • Question: Can Fields Be Concatenated Ina Logical File Level?

    Answer :

    Yes. by using CONCAT keyword

  • Question: Can Level Check Error Occur If We Do Chgpf?

    Answer :

    It depends on the value that we have set for LVLCHK (Record format level check) attribute. If its value is *YES then the record format level identifier is checked when the file is opened and if it doesn’t match it throws the error. If its value is *NO, then the record format level identifier is not checked, hence no error.

  • Question: Define A Batch Job?

    Answer :

    • A user request the job.
    • The job is created (job name is assigned, job attributes are allocated)
    • The job is placed on a job queue
    • The sub system QBATCH takes the job from job queue and starts it.
    • Output generated by the batch job is placed on an output queue.
    • The spool sub system prints the output on the output queue.
  • Question: Define A Job Queue?

    Answer :

    Job queues are queues of batch jobs waiting to be processed.

  • Question: Describe About Query/400?

    Answer :

    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.
  • Question: Describe The Function Of Setgt Operation In Rpg Language?

    Answer :

    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.

  • Question: Describe The Function Of Setll Operation In Rpg Language?

    Answer :

    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.

  • Question: How Can We Arrange Duplicate Records In A File?

    Answer :

    For this we will use file level keywords FIFO/LIFO/FCFO in the physical file.
    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.

  • Question: How Can We Create Subsystem In As400?

    Answer :

    Steps of creating the subsystem :
    Create Subsystem description (CRTSBSD) :
     First of all we create subsystem description as below:
    CRTSBSD   SBSD (AMINEM/MYSBSD) POOLS ((2 *BASE)) MAXJOBS(2)  TEXT(‘My  subsystem description’)
    Here, the subsystem job will run in pool 2 and will use *BASE for main memory storage. There can maximum of 2 jobs inside the subsystem at a time.
    Create Job queue (CRTJOBQ) : Then we create a job queue as below:
    CRTJOBQ   JOBQ (AMINEM/MYJOBQ) TEXT(‘My job queue’) 
    Add Job Queue Entry (ADDJOBQE) : Once the job queue is created, then we attach the (ADDJOBQE) command, as follows:
    ADDJOBQE SBSD (AMINEM/MYSBSD) JOBQ (AMINEM/MYJOBQ) MAXACT (1)
    MAXACT denotes the number of the jobs that can be process at the same time.
    Create Class (CRTCLS)
    Class defines the run time attribute e.g. Run priority, Time slice, Default wait time, Maximum temporary storage etc.
    CRTCLS    CLS(AMINEM/MYCLS) RUNPTY(40)
    Add Routing Entry (ADDRTGE)
    ADDRTGE SBSD(AMINEM/MYSBSD) SEQNBR(9999) CMPVAL(*ANY) PGM(SYS/QCMD) CLS(AMINEM/MYCLS)
    Start Subsystem (STRSBS)
    STRSBS SBSD(AMINEM/MYSBSD)
    Once the subsystem is started it can be used to submit the job.

  • Question: How Many Libraries Can Be There In Library List?

    Answer :

    Total 40 (15 system and 25 application).

  • Question: How To See All Members Of A File?

    Answer :

    By using the command shown below:
    DSPFD FILE(IROBO1/QRPGLESRC) TYPE(*MBRLIST)

  • Question: How To See All Record Formats Used In A File?

    Answer :

    By using the command shown below:
    DSPFD FILE(IROBO1/QRPGLESRC) TYPE(*RCDFMT)

  • Question: How To Trap Errors In Cl?

    Answer :

    By using Monitor Message Command (MONMSG)

  • Question: Is Qgpl A User Library Or System Library?

    Answer :

    It’s a user library.

  • Question: Specify Different Indicators Used In Rpg?

    Answer :

    • Overflow indicators
    • Record Identifying Indicators
    • Field Indicators
    • Resulting Indicators
    • Control Level Indicators
  • Question: What Are Control Level Indicators?

    Answer :

    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.

  • Question: What Are The Different Types Of Keywords In Display Files?

    Answer :

    File level, Record format level, Field level

  • Question: What Are The Different Types Of Messages In Cl?

    Answer :

    Immediate message, Break message, Program message, User message

  • Question: What Are The Record Format Field Mapping Options In Cpyf?

    Answer :

    Record format field mapping (FMT):

    MAP :   Fields with the same name in the from-file and to-file record formats are copied, and any fields in the to-file that do not exist in the from-file format are set to the default value specified on the DFT keyword for the data description specification (DDS) of the to-file or zero for numeric fields, blanks for character fields, current date/time for date/time fields, or null value for null-capable fields.
    If *MAP is specified, *DROP can also be specified.
    DROP : This value must be specified for field-level mapping if any of the field names in the from-file record format do not exist in the to-file format. If *DROP is specified, *MAP can also be specified. When *DROP is specified, all the field names that exist in both record formats must have the same attributes and relative positions in the from-file and to-file record formats, or *MAP must also be specified. Null values are copied.
    NOCHK :  If the record formats of the database files are different, the copy operation continues despite the differences. Record data is copied directly (left to right) from one file to the other. FMTOPT (*NOCHK) is required when copying all record formats from a logical file with multiple formats (when RCDFMT (*ALL) is specified) to a physical file that is of the same type (source or data) as the from-file.
    CVTSRC : This value is used to copy between database files, from a source file to a data file, or from a data file to a source file. It is valid only when the from-file and to-file are different types (source and data).

  • Question: What Are The Types Of Data Structure In As400?

    Answer :

    Below are the types of data structures in as/400:

    •  PROGRAM DESCRIBED DATA STRUCTURE
    •  EXTERNALLY DESCRIBED DATASTRUCTURE
    •  MULTIPLE OCCURENCE DATASTRUCTURE
    •  INDICATOR DATA STRUCTURE
    •  DATA AREA DATA STRUCTURE (SPECIFIED IN ‘U’)
    •  PROGRAMME STATUS DATASTRUCTURE (SPECIFIED IN ‘S’)
    •  FILE INFORMATION DATASTRUCTURE
  • Question: What Are The Valid User Defined Data Area Types?

    Answer :

    CHAR, NUMERIC and LOGICAL

  • Question: What Is A Library In As/400?

    Answer :

    A library in AS/400 is an object that serve(acts) as a repository for other objects.

  • Question: What Is Access Path In As400?

    Answer :

    Access path

    •  Access path describes the order in which records are to be read.
    •  Access paths can be kept on the system permanently (such as physical or logical file) or temporarily.
    •  OPNQRYF command may create a temporary access path for use one time, and then discard the access path.
  • Question: What Is Array In As400? What Are The Types Of Array?

    Answer :

    Array is collection of elements of same data type.
    Types of Array

    1. Compile time array
    2. Pre-runtime array
    3. Run time array
  • Question: What Is Compiler Directive In As400? Give Example Of Compiler Directive.?

    Answer :

    Compiler directive : Compiler directive is an instruction (directive) given to the compiler, to perform some specific task during compilation or to generate customize compiler listing report after compilation.
    Compiler directive serve many purposes like it is used to control the heading information in compiler listing, to control the spacing of the compiler listing, to include source statement from other source member, to do a free form calculation in our rpgle program, to control the source records selection/omission based on some condition etc.
    Compiler directives are:

    1. /FREE… /END-FREE
    2. /TITLE
    3. /EJECT
    4. /SPACE
    5. /COPY or /INCLUDE
    6. /IF……/ELSEIF…. /ELSE…… /ENDIF
    7. /EOF
  • Question: What Is Data Structure In As400? What Is The Use Of Data Structure?

    Answer :

    DATA STRUCTURE :

    •  Data structure in general means a structure of different data type.
    •  Data structure is specified in the Input Specification of an RPG 3 Program whereas in RPG 1V we specify it in ‘D’ specification.

    Data Structure is used:-

    1. To break fields into subfields
    2. To Group fields
    3. To change the format of the field
    4. To Group non-contiguous data into contiguous format
    5. To convert data.
  • Question: What Is Difference Between Cat, Tcat, Bcat?

    Answer :

    CAT – Concatenate two variables or constants into one continuous string.
    BCAT – Truncates all trailing blanks in the first character string, one blank is inserted, then the two character strings are concatenated.
    TCAT – Truncates all trailing blanks in the first character string, the two character strings are concatenated.

  • Question: What Is Dynslt?

    Answer :

    DYNSLT: Use this file-level keyword to indicate that the selection and omission tests specified in the file (using select/omit specifications) are done at processing time. This keyword specifies dynamic select/omit rather than access path select/omit.
        Only a Physical file contains data. Logical files just contain pointers for processing the data in a specific sequence and/or subset of data.
        When a record is added/changed/deleted in a physical file, the system has to put a lock on it and then go out to check and update any logical files before it can release the lock. While the amount of time to do this is hardly measurable, it can be significant if massive batch updates are done to a file. 
        If you are using the Select/Omit option in your DDS and using DYNSLT, the above process does not need to be done at record update time. 
        Where this is beneficial is when your selection process includes almost all the records in the file. Now when you process using DYNSLT, it will read all the records in the file, but do the selection of which records to process at that time rather than having done all the maintenance ahead of time.

  • Question: What Is File Information Data Structure(infds) In As400?

    Answer :

    A file information data structure (INFDS) can be defined for each file to make file exception/error and file feedback information available to the program.

  • Question: What Is Library Is As400? What Are The Types Of Library?

    Answer :

    When we execute a command or call a program, the AS/400 must know where to find the command or program and the answer is library. A Library is a collection of objects. QSYS is the only library that contains other library. QSYS is the root library where the entire user defined/ system defined library is created. System supplied libraries begin with the letter “Q” or “#”.
    Library list types:
    System library: All IBM supplied library e.g. QSYS, QHLPSYS, QUSRSYS…
    Product Library: Whenever Ibm product is used it is added to the library automatically and is removed itself when the job completes.
    Current Library: Current library is the working library i.e. all the work done by you is stored in current library.
    User Library: Non-IBM supplied i.e. created by the user.

  • Question: What Is Library List?

    Answer :

    A list that indicates libraries used for the process and the order in which it has to be searched System identifies it in *LIBL.

  • Question: What Is Logical File In As400? What Are The Types Of Logical File?

    Answer :

    Logical file : 

    • Logical file does not occupy any memory.
    • One or more logical file can be derived from a single physical file.
    • It simply contains the record selection definition and when accessed retrieves the records from the physical file to which it refers.
    • A logical file can contain up to 32 record formats.
    • It selects records dynamically. It cannot exist without a physical file.
    • We can filter the data with criteria by using select and omit command.
    • A logical file does not contain any data but provides the ‘VIEWS’ of the data to satisfy end-user’s needs.

    Types of Logical file :  There are two types.

    1. Non-join logical file
    2. Join logical file
  • Question: What Is Multi­format Logical File?

    Answer :

    Logical which uses fields from two or more physical files.

  • Question: What Is Program Status Data Structure(psds) In As400?

    Answer :

    A program status data structure (PSDS) can be defined to make program exception/error information available to the program so that the necessary action can be taken for the unhandled exception. The exception /errors can beDivide by zero, array index out-of-bound, Invalid Date, Time or Timestamp value. The PSDS must be defined in the main source section; therefore, there is only one PSDS per module.

  • Question: What Is Source Physical File?

    Answer :

    Source physical file is a file which contains the sources of different types of objects. There can be up to 32768 members. Source physical file is an object. But the source member is not an object. When we compile the member, the object is created for that source. Command used is CRTSRCPF.
    CRTSRCPF FILE(IROBO1/QRPGSRC) RCDLEN(112) TEXT(‘SOURCE PHYSICAL FILE’)

  • Question: What Is The Default Access Path Of A File?

    Answer :

    If you do not specify the type of maintenance for a file, the default is immediate maintenance.

  • Question: What Is The Difference Between Access Path And Dynamic Select?

    Answer :

    Dynamic select occurs whenever the program reads file. But access path occurs before the file is read (but  not necessarily).

  • Question: What Is The Difference Between Crtdupobj And Copyf?

    Answer :

    In CRTDUPOBJ for a logical file the created duplicate file will be also logical file and for a physical file the created file will also be a physical file. Even the record format identifier will also be the same. While in case of COPYF, if we are copying a logical file then the created file be a physical file not a logical file.

  • Question: What Is The Difference Between Non-join Logical Files And Join Logical Files?

    Answer :

    Non join logical file:

    • We can insert or delete or update records using non-logical file.
    • DFU can be used to display non-join logical file.
    • 1-32 record format is specified
    • Commitment control is used

    Join logical file:

    • Insertion, updating or deletion of records is not possible in join logical files.
    • DFU is not available
    • Only one record format can be specified
    • Commitment control cannot be used.
  • Question: What Is The Difference Between Physical File And Logical File?

    Answer :

    Physical file

    • Occupies the portion of memory. It’s containing data. 
    • A physical file contains one record format
    • Can be exist even without LF
    • If you delete a LF, the PF can’t be deleted
    • CRTPF command is used to create such object

    Logical file

    • Does not occupy any memory space. Does not contain any data.
    • A logical file can contain up to 32 record formats.
    • Can’t exist without PF
    • If you delete a LF, the PF can’t be deleted
    • CRTLF command is used to create such type object
  • Question: What Is The Maximum Length Of A Variable Name In Cl?

    Answer :

    Maximum 11 characters (including ‘&’)

  • Question: What Is The Purpose Of Level Check Parameter In A Physical File?

    Answer :

    Specifies whether the level identifiers of the record formats in the physical file are checked when the file is opened by the program.

  • Question: What Is The Select And Omit Criteria In Logical File?

    Answer :

    This is used to specify rules for the Selection/Omission of records from a Physical File.

  • Question: What Is The Use Of E Specification In Rpg?

    Answer :

    Extension Specs describes all record address files, arrays and tables.

  • Question: What Is The Use Of Header Specification In Rpg/400?

    Answer :

    It identifies by H in column 6, provides informaion about generating and running programs.

  • Question: What Is The Use Of Jdftval In As400?

    Answer :

    • When this file-level keyword is used the system provides default values for all for fields when a join to a secondary file does not produce any records.
    • If this keyword is not specified a record in the primary file for which there is no corresponding record in the secondary file is skipped.
  • Question: What Is The Use Of L Specs In Rpg?

    Answer :

    Line counter specification can be used to describe printer file to indicate the length of the form and number of lines per page.

  • Question: When Will Dump And Debug Opcodes Be Ignored?

    Answer :

    If blank is specified in position 15 of H specs.

  • Question: When Would The All Keyword Be Used?

    Answer :

    Use with Select or Omit, to select/omit records.