You are on page 1of 33

AS/400

QUESTION BANK

TABLE OF CONTENTS
AS/400 SYSTEM.................................................................................................................1 OS/400 ...................................................................................................................................3 DATABASE FILES .............................................................................................................11 DISPLAY FILES .................................................................................................................14 SUBFILES : ..............................................................................................................17 CONTROL LANGUAGE (CL/400)......................................................................................19 RPG/400 ................................................................................................................................21 MISCELLANEOUS ............................................................................................................33 APPENDIX - A.....................................................................................................................35

AS/400 Question Bank

AS/400 SYSTEM
QS30001 AS30001 What is the Configuration of the AS/400 system on which you have worked? System E35(Model 9406), 24MB main memory, 3.2GB of HD and supports 49 terminals(7 Port). How many terminals can be connected to a port ? 7 terminals What do the terms CUA and SAA stand for? Common User Access Systems Application Architecture What are the communication protocols supported by AS/400 ? APPC (Advanced Program to Program Communication) BSCEL(Binary Synchronous Link) ASYNCH(Asynchronous Communication) RETAIL TCP IP FINANCE SNUF SNA Upline facility INTRA Intrasystem communication. What are the different ways of connecting a terminal to a system ? Twinnax, Workstation, ASCII and OS/2 Workstation. Why is AS/400 called an Object Oriented Machine ? Everything on the AS/400 system that can be stored or retrieved is contained in an Object. Object exist to make users independent of the implementation techniques used in the machine. What is SAA ? Systems Application Architecture (SAA) is a collection of selected software Interfaces, Conventions and Protocols that will provide a consistent framework across the System/370, AS/400 and PS/2. What are the different AS/400 rack models supplied by IBM ? 9402, 9404 and 9406.

QO20002 AO20002 QS20003 AS20003

QL40004 AL40004

QS30005 AS30005 QL30006 AL30006

QS30007 AS30007

QS30008 AS30008

QL10009

What are the different high-level languages available on AS/400 ?

AS/400 Question Bank

Page 1

AL10009

RPG/400, CL/400, BASIC, PL/1, C/400, PASCAL, FORTRAN/400 and RM/COBOL-85, COBOL/400 etc.. What are all the IBM Mid range machines prior to AS/400? S/38, S/36, S/34, S/32 &S/3. What is the Operating System on AS/400? OS/400. What are office tasks available on AS/400? Office Vision/400 & PC Support/400. What are the graphic utilities available on AS/400? BGU & GDDM.

Q1S2001 A1S2001 Q1O2002 A1O2002 Q1S2003 A1S2003 Q1S2004 A1S2004

AS/400 Question Bank

Page 2

OS/400
QO20010 AO20010 QS40011 AS40011 What is the version of OS/400 that you have used? Ver 2.2 What is DDM ? Distributed Data Management is a function of the OS/400 that allows an application program or user on one system to use database files stored on remote system. What are the facilities available on AS/400 for self-learning ? on-line education, Q&A Database and Help. What is an Object ? An object is any thing that exist in and occupies space in storage and on which operation can be performed. What are the different types of Objects available in the AS/400 ? Libraries, Folders, Files, Programs, Combined definitions, Queues, User Profiles. How are the objects stored in AS/400 ? 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 into a physical address whether it is a auxiliary storage or main memory. What is a library in AS/400 ? A library in AS/400 is an object that serves as a repository for other objects. Name few IBM supplied libraries ? QGPL, QTEMP, QUSRTOOL, QSYS, QRPG & QCBL. What is a library list ? A list that indicates libraries used for the process and the order in which it has to be searched. System identifies it in *LIBL. How many libraries can be there in a library list ? Total 40 (15 system and 25 application).

QS30012 AS30012 QS20013 AS20013

QS20014 AS20014

QL50015 AL50015

QS30016 AS30016

QS20017 AS20017 QS10018 AS10018

QO30019 AO30019

AS/400 Question Bank

Page 3

QO30020 AO30020 QS40021 AS40021

Where is the system part of the library list stored ? In SYSVAL What is a Folder ? A Folder is a named object that is used as a directory for documents and other folders. Folders can be filed with in another folder. What are the different Application Development Tools available on AS/400 ? SEU, RLU, PDM, SDA, QUERY What are the levels of security on AS/400 ? 10,20,30,40,50 What is error severity ? Error severity determines the level of severity that is required to terminate the job. What is a User Profile ? What are the various classes ? User profile is an object which identifies a user to the system. It contains user name, Password, Owned objects, Authorized objects, Scheduling priority, Special authority, Initial program, Job description. Security officer, Programmer, Workstation, System operator, Programmer services Rep & Customer engineer. What is Group Profile ? It is similar to User Profile, but the attributes specified is applicable to an entire group. What are the different types of queues in AS/400 ? Job queue, Message queue, Output queue, Data queue. What are JobQ and PrintQ ? JobQ : An object that contains a list of batch jobs waiting to be processed by the system. PrintQ : An object that contains a list of spool files to be written to a printer device. What is a Spool file ? Why is it required ? A file that holds output data to be processed, such as information waiting to be printed. What is a Job ? What are the attributes Of a job ? A job is the basic unit of work on AS/400

QS20022 AS20022 QO30023 AO30023 QS30024 AS30024

QL50025 AL50025

QS40026 AS40026

QS20027 AS20027 QL20028 AL20028

QL20029 AL20029

QL30030 AL30030

AS/400 Question Bank

Page 4

The attributes are : Job Number : Unique system generated sequential number Job Name : Any user defined name (Max. 10 char) User Name : Who initiated the job QS20031 AS20031 What is job description ? A job description defines the environment in which a batch/interactive job is to be executed. What is the difference between Interactive & Batch job ? Interactive Job : Job started for a person who signon to a workstation. Batch Job : A predefined group of processing actions submitted to the system to be performed. What is a Group Job ? A Group Job is attached to one workstation and a user. There should be an initial group job and it can be branched to many other group jobs. The group jobs can have different library lists and different output, message queues. Group Job is useful in enhancing the programmers productivity. It is as though logging into the same user-id many times. What are the two main attributes which govern the execution of a job ? Run time priority and Time slice. What is a sub-system ? Sub-Systems are specific user defined partitions of the CPU where various jobs may be executed. One subsystem can have more than one active job at a time. What is a device file ? A device file contains the description of how data is to be presented to a program from a device or Vice versa. Device file can be Printer, Disk, Tape or Remote system. What is an ICF file ? A device file that allows a program on the system to communicate with program in other system. What is a message file ? It is a file which contains the messages of an application. For example all RPG/400 messages are stored in a file, all COBOL/400 messages are stored in a file. What is a job log ?

QL20032 AL20032

QL30033 AL30033

QO20034 AO20034 QL20035 AL20035

QL20036 AL20036

QS30037 AS30037

QS30038 AS30038

QL30039

AS/400 Question Bank

Page 5

AL30039

A record of request submitted to system be a job. The message related to the requests, and the action performed by the system on the log. It is maintained by the system program What is the purpose of OPNQRYF (Open Query File) ? OPNQRYF is used to select certain records of the database file based on the QRYSLT (Query select) condition. How do you create files dynamically without DDS ? Through OPNQRY. What command must be executed before executing OPNQRYF command ? OVRDBF. What is a data area ? A data area is an object used to hold data for access by any job running on the system. A data area can be locked to a single user, thus preventing other users from processing at the same time. What are the types of data areas ? User defined Data Area, Local Data Area (LDA), Group Data Area (GDA), Program Initialization Parameter (PIP) Data Area. What is LDA ? An LDA is created by the system for each job in the system, including autostart jobs, jobs started on the system by a reader, and subsystem monitor jobs. What is the type and length of an LDA ? *CHAR, 1024 bytes. What is GDA ? The system creates a GDA when an interactive job becomes group jobs. Only one GDA can exists for a group. How can you create a user defined data area ? Using CRTDTAARA command. What are the different ways to input data into a data area ? CHGDTAARA (using CL) Using OUT opcode in RPG How do you retrieve data from data area ?

QL20040 AL20040

QS10041 AS10041 QO10042 AO10042 QL30043 AL30043

QS20044 AS20044

QS20045 AS20045

QS10046 AS10046 QS20047 AS20047

QS10048 AS10048 QS10049 AS10049

QS10050

AS/400 Question Bank

Page 6

AS10050

Using RTVDTAARA command in CL Using IN opcode in RPG. What are the valid user defined data area types ? CHAR, NUMARIC and LOGICAL. How can a data area be locked after being updated ? Using OUT *LOCK. What is the use of data queues ? Data queue is a type of system object that you can create. Data queues are used in program to program communication. How do you create data queues ? Using CRTDTAQ command. What are the valid data types for a data queue ? Char, Numeric, and Logical. What are the two types of read performed on data queues ? Read with lock, and read without lock. How do you use DEBUG utility ? STRDBG program-name UPDPROD(*YES) What is an authorization list ? A list of two or more user Ids & their authorities for system resources. The system identifies it as an object type *AUTL. How do you grant authority for an object? Using GRTOBJAUT command. What are the types of object authorities ? *USE, *CHANGE, *ALL, *EXCLUDE, *AUTL, *OBJEXIST, *OBJMGT, *OBJOPR, *ADD, *DLT, *READ, *UPD. How do you execute jobs in batch mode ? SBMJOB What is the use of OVRDBF ? You can use the Override with Database file (OVRDBF) command to replace the database file named in a CL program or to change certain parameters of the existing database file. What is the use of OVRPRTF ?

QS10051 AS10051 QS20052 AS20052 QS20053 AS20053

QO10054 AO10054 QS10055 AS10055 QS20056 AS20056 QS20057 AS20057 QS30058 AS30058

QO10059 AO10059 QL30060 AL30060

QO20061 AO20061 QL40062 AL40062

QL30063

AS/400 Question Bank

Page 7

AL30063

Override with Printer file (OVRPRTF) command is used to override certain parameters of the printer files used in the program or to replace the printer file. How do you change file attributes such as size, file wait time, record wait time etc., permanently ? Using CHGPF command. What is the purpose of CRTCMD ? To create user defined command. What is class of service ? A set of link and node characteristics associated with a session. How to see active jobs of the system ? Using WRKACTJOB command. How do you detect unused spool storage ? Using Reclaim Spool Storage. What are the functions of Remote Job Entry (RJE) ? Allows user of AS/400 system to submit jobs and receive jobs from a host system. What is the function of RJE Conversion Utility ? It converts compressed data written to an AS/400 database file to decompressed data written to another AS/400 database, diskette, or device file. What is the function of the SBMRJEJOB command ? Sends RJE input stream to host system. What is journalling and commitment control ? Journalling is a function which records the changes in a file in a journal.These record images are used to recover the changes in the file should the system ends abnormally. Commitment control is a function that allows you to define and process a no. of changes to database files as a single unit(transaction). What is the purpose of STRCMTCTL command ? Starts commitment control for files that are being journalled. What are the system objects required for journalling ? Journal receiver, journal and PFs to be journalled.

QO30064 AO30064 QO10065 AO10065 QS30066 AS30066 QO10067 AO10067 QS30068 AS30068 QS50069 AS50069

QL50070 AL50070

QS40071 AS40071 QL40072 AL40072

QS30073 AS30073 QS40074 AS40074

AS/400 Question Bank

Page 8

Q2S4001 A2S4001 Q2S4002 A2S4002

What is CPF ? Control Program Facility (CPF) is an operating system on S/38. What is invocation stack ? List of programs maintained by the system as one program calls another in a series of calls within a single task or job. What is time slice ? A finite amount of time in which a job is granted system resources while other jobs are queued. What is IPL ? Initial Program Loading (IPL) is run by OS/400 when the system is started. What does V2R2M0 mean ? Ver. 2, Release 2 & Modification level 0. This refers to the version of OS/400. Name the commands used to duplicate a file ? CPYF - Copy File & CRTDUPOBJ - Create Duplicate Object. Name the command for changing the attributes of a spool file ? CHGSPLFA - Change Spool file Attributes. Name the command which gives the attributes of a job ? RTVJOBA - Retrieve Job Attributes. What is the function of PDM ? Productivity tool for copying, deleting, scanning, changing & creating source files. What is the function of SEU ? A utility for editing programming language source code.

Q2S3003 A2S3003

Q2S4004 A2S4004

Q2S3005 A2S3005

Q2S3006 A2S3006 Q2AS3007 A2S3007 Q2S3008 A2S3008 Q2S2009 A2S2009

Q2S2010 A2S2010

DATABASE FILES
QL30075 AL30075 What are the different definition levels in Data Description specifications ? File level, Record level, Field level, Join level, Keyfield level, Select/Omit level.

AS/400 Question Bank

Page 9

QL30076 AL30076

What is difference between Source Physical File and Physical File ? A Source Physical File contains the source for the various objects created. This file has a specific structure. A Physical File contains data, and the record format can be different for different physical files. What is the difference between Physical and Logical files ? Physical file contains data, where as Logical file serves as a access Path to database. What is an access path ? The order in which the database fields are organized for processing in the program. What are all the different types of access paths ? Arrival sequence access path, Keyed sequence access path. How many record formats can you have in a Physical file and in a Logical file ? Physical file can contain only one record format, Logical file can contain more than one record format. What is a field reference file ? A field reference file is a physical file which contains no data, contains field description. this is used as a reference file by other physical files. What is the default value for the number of increments for the physical file ? Three. When is the DFT keyword in PF used for? To specify the default value it a field. What is Multi-format logical file ? Logical which uses fields from two or more physical files. What is dynamic select ? Selection and omission of LF records performed during processing, instead of access path is maintained. This can be used when key access path does not exist. What is the Select and Omit criteria in logical file ?

QS20077 AS20077

QS20078 AS20078

QS30079 AS30079

QS30080 AS30080

QS20081 AS20081

QO20082 AO20082 QS10083 AS10083 QS20084 AS20084 QL30085 AL30085

QL20086

AS/400 Question Bank

Page 10

AL20086

This is used to specify rules for the Selection/Omission of records from a Physical File. Can fields be concatenated at the logical file level ? Yes, by using CONCAT keyword. When would the ALL keyword be used ? Use with Select or Omit, to select/omit records. What is a Join Logical File, Can it be used for Update ? Logical file that combines more than one physical file. Update is not possible through JLF. How many files can be joined at a time, What is the max. no. of files ? At a time you can join two files. The max. no. of files is 32. Only one primary file and the remaining are secondary files, The primary file and atleast one secondary file must be physical files. Is it possible to join the same file to itself ? Yes. What is FCFO, FIFO, LIFO in Database environment ? These are file level keywords which are used to access the records in the order FCFO: First Changed First Out FIFO: First In First Out LIFO: Last In Fist Out If a file layout is changed, how do you generate new PF and retain data? Copy the file and change the structure of Physical file, later copy old file with drop option. What is the overhead on logical file ? How can it be improved ? Maintaining access path and storage space. We can improve the performance by using *DELAYED, *REBUILD keywords to enhance the speed. How can the sign of a numeric be ignored when sequencing a logical file ? By specifying the record level keyword UNSIGNED. If a field references a field that has an EDTCDE or an EDTWRD keyword specified, can the EDTCDE or EDTWRD from the Referenced field ignored ?

QS20087 AS20087 QS30088 AS30088 QS30089 AS30089

QL30090 AL30090

QO20091 AO20091 QS10092 AS10092

QL40093 AL40093

QS50094 AS50094

QS40095 AS40095 QS40096

AS/400 Question Bank

Page 11

AS40096 Q3S2001 A3S2001 Q3S4002 A3S4002

Yes, by using DLTEDT keyword. What does the keyword UNIQUE mean ? Records with duplicate key values are not allowed. State three different methods of maintaining access paths ? Immediate, Rebuild & Delay.

DISPLAY FILES
QS20097 AS20097 QO30098 AO30098 QS40099 AS40099 What are the different types of keywords in display files ? File level, Record format level, Field level. What is the maximum number of records you can specify in a display file ? 1024. How can a screen field that has changed since the last output operation be detected ? Attach the MDT attribute to the field, to detect whether field has been changed as a result of user input. What would be the effect on the field where reverse image, underline and highlight display attributes are active ? The result is same as if you had specified ND. What is the use of DSPATR(MDT) keyword ? Sets on the modified Data Tag of the field. This Data Tag detects whether the field has been changed as a result of user input. If DSPATR(PC) and CSRLOC were specified for a format, which keyword would have priority ? CSRLOC gains priority. Can error messages as a result of a COMP, RANGE or VALUES keyword be overridden ? Yes, through CHKMSGID keyword. What is the purpose of OVRDTA and OVRATA keywords ? OVRDTA keyword (field or record level) can be used to override the existing data contents of a field or record already on the display. OVRATA keyword (field or record level) can be used to override the existing display attributes of a field or record already on the display.

QS50100 AS50100 QL40101 AL40101

QO30102 A030102 QS40103 AS40103 QL40104 AL40104

AS/400 Question Bank

Page 12

QS30105 AS30105 QS30106 AS30106 QS50107

How can a message from a message file appear as a constant on the screen ? By using MSGCON (message constant) keyword. In conjunction with what other keyword must OVRDTA and OVRATA be used ? PUTOVR keyword must be used. How can a field that is larger than what could fit onto one line be truncated from the last blank rather than from the last character position? Using BLKFOLD keyword. What is the purpose of the INDARA keyword ? This File-level keyword is used to remove option and response indicators from the buffer and places them in 99-byte separate indicator area. Explain the purpose of KEEP and ASSUME keywords ? KEEP : Keep the display from being deleted when the display file is closed. ASSUME : It is used to specify that the OS/400 program is to assume that this record is already shown on the display when this file is opened. Explain the use of DFRWRT display keyword ? No records will be displayed until there is an I/O operation. What is the purpose of FRCDTA keyword ? Immediately display a record format without waiting for the next I/O operation. What keyword must be used with PROTECT keyword ? OVERLAY Where is the variable for the SLNO(*VAR) keyword be defined ? At run time before displaying the record format. Under what conditions would a field where the ERRMSG keyword was active would not be displayed in reverse image ? If it is an output-only field or input capable field with display attributes UL, HI are active.

AS50107 QS40108 AS40108

QL40109 AL40109

QS30110 AS30110 QS30111 AS30111

QS10112 AS10112 QS30113 AS30113 QS50114 AS50114

AS/400 Question Bank

Page 13

QS50115 AS50115

When will the message for field that has the ERRMSG keyword active not be displayed ? If more than one ERRMSG keywords are active then the first will be active, because only one error message will be displayed at a time. What is CHGINPDFT keyword, and what will be the effect if you define this keyword at file with out any parameter values ? This file, record or field level keyword is used to change one or more input defaults for input capable fields. If you define this keyword at file level without any parameter then the underline will be suppressed. In what case control will be passed back to the program when the last character of the field is keyed ? CHECK(ER) ER - End of Record.

QL50116

AL50116

QS30117 AS30117

SUBFILES :
QL10118 AL10118 What is a subfile ? Subfile is a group of records of same record format and can be read from or write to the display in a single operation. What are the contents of subfile ? Subfile Record Format, Subfile Control Record Format, Relative Record Number, Subfile Record Number, Associated Subfile Keywords. What are the two record formats that a subfile contains ? Subfile record format(SFL), and subfile control record format(SFLCTL). What is SFLPAG and SFLSIZ ? SFLPAG : it is an attribute which specifies the number of records that can be displayed in a screen. SFLSIZ : it is an attribute which specifies the number of records can be stored in the subfile. What is the maximum number of subfiles that can specified in a display file ? 512

QL30119 AL30119

QS20120 AS20120

QL30121 AL30121

QO30122 AO30122

AS/400 Question Bank

Page 14

QO30123 AO30123 QO30124 AO30124 QL20125 AL20125 QS30126 AS30126 QS30127 AS30127

The maximum number of subfiles that can defined in a RPG program for one display file is ___ . 24 The maximum number of subfiles that can be active for a single file is ____ . 12 What are the different opcodes used for file operation on a subfile in a RPG Program ? READ, READC, CHAIN, UPDAT and WRITE Can more than one subfile record be displayed on one line ? Yes, by using SFLLIN keyword. How do you specify the number of records to roll in a subfile ? Use SFLROLVAL keyword in DDS along with the number, which specifies the number of records to scroll at a time. How will you display a particular page in subfile ? Move a valid relative record number(RRN) in the field specified using SFLRCDNBR keyword in DDS. How to pick up the changed records every time in a subfile after the first change made ? Seton SFLNXTCHG keyword indicator and update the subfile record. What is the use of the SFLEND keyword ? By specifying this keyword, the Bottom/More message could be displayed at end of screen. How do you toggle between single line and multi-line display of a particular record in a subfile ? Using SFLDROP keyword. Explain the difference between defining Subfile and Message-subfile ? A subfile record is defined by SFL keyword, whereas a message Subfile is defined by SFLMSG keyword. Can a single screen format occupy a screen area above and below a subfile format ? Not possible. How can a program be prevented from failing over when READC is performed on an empty subfile ?

QL30128 AL30128

QS30129 AS30129 QS30130 AS30130

QS30131 AS30131 QL40132 AL40132

QO30133 AO30133 QS50134

AS/400 Question Bank

Page 15

AS50134

Check indicator placed in position LO, which will be seton if EOF reached.

CONTROL LANGUAGE (CL/400)
QO10135 AO10135 QO20136 AO20136 QO30137 AO30137 QS10138 AS10138 QO10139 AO10139 QO10140 AO10140 QO20141 AO20141 QL50142 AL50142 How to start a CL program ? PGM. How many files can be declared in CL ? One. Which precedes, the file declaration or variable declaration ? Variable declaration and then File declaration. What are the different types of variables available in CL ? DEC, CHAR, LGL In CL Program '&' precedes ____ . Variables. How do you pass parameters in CL ? Using PARM keyword. Can libraries be added to the library list through CL ? Yes, using ADDLIBL. What is the difference between CAT, TCAT and BCAT ? 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. How do you end a CL program ? ENDPGM What are the different types of messages in CL ? Immediate message, Break message, Program message, User message. How can errors be trapped in a CL program? By using Monitor Message Command ( MONMSG )

QO10143 AO10143 QS30144 AS30144

QS30145 AS30145

AS/400 Question Bank

Page 16

QO30146 AO30146 QL50147 AL50147

What is the maximum length of a variable name in CL ? Maximum 11 characters (including '&') What are the limitations of CL (compare to RPG) ? You cannot use CL program to : ADD or UPDATE records in database files Use Printer or ICF files Use Program described files Use the concept of subfile (to display more than one record), but a single output message subfile is a special type of subfile that is supported well in CL Use subroutines. You cannot declare more than one object (file) in a CL programme.

RPG/400
QS10148 AS10148 QL30149 AL30149 What is RPG ? Report Program Generator. What are the positive points of RPG Language ? Contains opcodes which makes it flexible with OS/400 Can access the externally described file. Explain RPG Program Logic Cycle ?

QL50150 AL50150

START

Perform detail calculation

Perform header, detail output Read a record Set ON LR if EOF If change in control field, set ON control level indicators.

Move data from selected record into processing area

Perform total calculations Perform total output If LR is ON then END program

AS/400 Question Bank

Page 17

QS30151 AS30151

When is it efficient to make use of RPG Cycle ? When the file is arranged in sequence and output is based on control break. Can you call a program in your RPG program, which is coded in some other language ? Yes, Any program object available on AS/400. What are the different types of specification available in RPG/400 ? Control Spec.( H ) File Spec.( F ) Extension Spec.( E ) Line counter Spec.( L ) Input Spec.( I ) Calculation Spec.( C ) Output Spec.( O ) Is it necessary to define all formats ? Which are mandatory and which are Optional ? No, all are Optional. What is the use of H spec. in RPG ? It identifies by H in column 6, Provides information about generating and running programs. When will DUMP and DEBUG opcodes be ignored ? If blank is specified in position 15 of H specs. What are the valid file types ( position 15 ) in F specification ? I (Input file). O (Output file). U (Update file). C (Combined (I/O) file). Specify different indicators used in RPG ? Overflow indicators. Record Identifying Indicators. Field Indicators. Resulting Indicators. Control Level Indicators. What are Control level indicators ?

QS20152 AS20152 QL20153 AL20153

QO40154 AO40154 QS20155 AS20155

QS50156 AS50156 QS20157 AS20157

QL40158 AL40158

QL40159

AS/400 Question Bank

Page 18

AL40159

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. What is the use of E specification in RPG ? Extension Specs describes all record address files, arrays and tables. What is the use of L specs in RPG ? Line counter specification can be used to describe printer file to indicate the length of the form and number of lines per page. In which specification can a report layout be defined ? O Specification. How many files can be defined in F specs ? A maximum of 50 files. How many printer files can be defined in F specs ? A maximum of 8 files. Give three main purposes of File specification ? To define files, to describe the files, to assign the files to specified devices. How do you specify page overflow indicator for printer files in RPG ? Specify an indicator in positions 33-34 of F specification. What is a Primary File ? It is used in RPG Program Cycle to automatically read records in a cycle. Can an indexed file be accessed in arrival sequence in RPG program ? Yes. What is a program described file in RPG ? The field name and length of the fields are defined with in the RPG program. What is an externally described file ? All information about the fields is specified in DDS and the RPG program can use them with in the program. Can you specify a display file to be used in the following modes: Input, Output or Combined modes? Yes.

QS20160 AS20160 QS30161 AS30161

QS10162 AS10162 QO30163 AO30163 QO30164 AO30164 QS20165 AS20165

QS20166 AS20166 QS20167 AS20167

QO30168 AO30168 QS20169 AS20169

QS20170 AS20170

QO30171 AO30171

AS/400 Question Bank

Page 19

QL40172 AL40172

What are match fields indicators? Matching record indicator is seton when all the matching fields in the record of a secondary file matches with all the matching fields of a record in a primary file. What is the length of a variable in RPG ? 6 Characters. What are the different arithmetic Opcodes ? ADD, SUB, MULT, DIV, MVR, SQRT, XFOOT, Z-ADD, Z-SUB. When is a TAG statement used in RPG ? It is used as a Label. What are the different Opcodes available in RPG for Database access ? READ, CHAIN, WRITE, UPDAT, DELET, SETLL, SETGT, READE, READP, REDPE, OPEN, CLOSE, FORCE, NEXT, UNLCK. What is READP opcode ? Read previous record. What is REDPE opcode ? Read Prior equal record. How do you check if a division was whole division ? Check the EQ indicator be set to '1' What opcode could be used to test an alphanumeric field for all numeric values? TESTN. What opcode will be used to test the zone of a character field ? TESTZ. How do you specify Half Adjust ? It should be specified in the column 53 of C specs as 'H' to indicate half adjust. It will be effective only if the resultant value is having more decimals than the result field. Explain the difference between READ, CHAIN and SETLL ? READ operation reads the record currently pointed to, from a full procedural file.

QO20173 AO20173 QS10174 AS10174 QS10175 AS10175 QL30176 AL30176

QS10177 AS10177 QS10178 AS10178 QO30179 AO30179 QO30180 AO30180 QO30181 AO30181 QS40182 AS40182

QL30183 AL30183

AS/400 Question Bank

Page 20

CHAIN operation retrieves a record from a full Procedural file, sets a record identifying indicator ON and places the data in the input fields. SETLL operation position a file at the next record that has a key or relative record number that is greater than or equal to the search argument specified. The file must be fully procedural for all three opcodes. QL30184 AL30184 What does LO and EQ indicators signify in READ, WRITE and CHAIN operations ? LO indicator specifies the error status on the above operations. EQ indicator specifies the EOF, Record not found. How can database records be read without lock ? Put 'N' in position 53 of C specs. What is the difference between MOVE and MOVEL ? MOVE operation will transfer characters from the factor 2 to the result field, the move starts from rightmost character of factor 2. MOVEL operation will transfer characters from factor 2 to the result field, the move starts from leftmost character of factor 2. How do you concatenate two string variables in RPG ? Using CAT opcode or with MOVE followed by MOVEL. What are the string operations possible in RPG/400 ? CHECK, CHEKR, SUBST, CAT, XLATE, SCAN. What does SUBST do ? Extracts a specified character string from a base character string. What does CHECK opcode do ? The check operation verifies that each character in the base string (factor 2) is among the character indicated in the comparator string(factor 1). In conjunction with which statements can ORxx and ANDxx conditions be used ? DOUxx, DOWxx, IFxx, and WHxx. What is the difference between DOU and DOW ? DOU checks after entering into the loop, it is performed atleast once. DOW check before entering into the loop. What is ITER and LEAVE opcodes do ?

QS30185 AS30185 QL20186 AL20186

QS20187 AS20187 QL30188 AL30188 QS10189 AS10189 QS20190 AS20190

QS10191 AS10191 QS10192 AS10192

QL20193

AS/400 Question Bank

Page 21

AL20193

ITER transfers control from within a DO group to the ENDDO statement of the DO group. It causes the next iteration of the loop to be executed immediately LEAVE operation transfers control from within a DO group to the statement following the ENDDO operation. Which instructions support structured programming in RPG ? ANDxx, CASxx, DO group, ELSE, ENDyy, IFxx, ITER, LEAVE, ORxx, OTHER, SELEC, WHxx. What does 'SR' in columns 7-8 of C specs mean ? Calculation operation is a part of RPG subroutine. Explain CASxx, and CABxx statements ? CASxx operation allows you to conditionally select a subroutine for processing. The condition is based on the relationship between factor 1 and factor 2 as specified by xx.If the relationship is true the subroutine specified in the result field is processed. CABxx operation compares factor 1 with factor 2 , if the condition specified by xx is true, the program branches to the TAG operation associates with the label specified in the result field.

QL20194 AL20194

QS10195 AS10195 QL20196 AL20196

QL30197 AL30197

What is CLEAR and RESET ? CLEAR operation sets the elements in a structure (record format, array/table, data structure) or a variable (field, subfield or indicator) to zero , blank or '0' depending on the field type (numeric, character, indicator) RESET operation sets the elements in a structure (record format, array/ table, data structure) or a variable (field, subfield or indicator) to its initial value. What is SCAN and XLATE ? SCAN operation scans a character string (base string) contained in factor 2 for a substring (compare string) contained in factor 1. XLATE operation translates characters in source string (factor 2) to the from and to strings(factor 1) and put into the result field. How do you use commitment control in RPG program ? Using COMIT operation. Makes all changes to the files that have been specified in output operation since the previous COMIT or the beginning of operations under commitment control(if there has been no previous COMIT or ROLBK operation).

QL40198 AL40198

QL40199 AL40199

AS/400 Question Bank

Page 22

QS30200 AS30200 QL30201 AL30201

How do you use exceptional write in C specs ? Using EXCPT opcode. What does the opcode FREE do ? The FREE operation removes a program from the list of activated programs, frees static storage and ensures program initialization (first cycle processing) the next time program is called. It does not close file or unlock data area. What does opcode POST do? Puts information in INFDS. What is the difference between WRITE and EXFMT of a display file ? WRITE displays a record format on workstation, EXFMT displays and accepts from the workstation. What is the difference between PLIST and KLIST ? PLIST operation defines a unique symbolic name for a parameter list to be specified in a CALL operation. KLIST is a declarative operation that gives a name to a list of key fields. Can you have multiple key lists for a single file ? Yes. What are the different types of arrays available in RPG ? Pre-run time array. Compile time array. Run time array. How do you specify data for a compile time array ? You can specify in E specs about the no of entries per record, no of elements, length of each element with the corresponding data entered at the end of the RPG program starting with **. What is the maximum number of elements in an array ? 9999. Can we define Multi-dimensional arrays in RPG ? No. What is XFOOT opcode ? Adds all the elements in a numeric array, and places the sum in the result field.

QS30202 AS30202 QS20203 AS20203

QS20204 AS20204

QO30205 AO30205 QS40206 AS40206

QL40207 AL40207

QO30208 AO30208 QO30209 AO30209 QS20210 AS20210

AS/400 Question Bank

Page 23

QS20211 AS20211 QS20212 AS20212

How can we sort an array ? By using SORTA opcode. What is MOVEA opcode do ? Transfer character to numeric values from factor 2 to result field. MOVEA can be possible to ARRAY-ARRAY, ARRAY-FIELD, or FIELD-ARRAY. How to initialize an array ? CLEAR or MOVEA *blanks to array. What is LOKUP opcode do ? LOKUP opcode search for a particular element in an array / table. Can LOKUP operation be used for unsorted array ? Yes. What is the difference between an array and a table ? An array elements can be refered by array name. Elements in array can be accessed by their position relative to other elements. Table name does not refer to the entire set of table elements. Elements in a table can not be accessed by their position relative to the other elements. What is the maximum length of a table name ? 6 characters. What is the syntax of a table name ? Table name should start with TAB. How can the user implicitly open and close the files in RPG program ? Enter UC in position 71-72 of F specs. Use OPEN and CLOSE opcodes in RPG program to open and close files. During input operation which indicator position is seton if there is a record lock? LO indicator position is seton. What is the significance of DEFN opcode on RPG ? To define fields based on the attributes of another field. To define a field as a data area. What are different ways by which you define working storage field ?

QS20213 AS20213 QS20214 AS20214 QS20215 AS20215 QL20216 AL20216

QO30217 AO30217 QO20218 AO20218 QS30219 AS30219

QO20220 AO20220 QS20221 AS20221

QS20222

AS/400 Question Bank

Page 24

AS20222 QO30223 AO30223 QL40224 AL40224

Explicitly define or use *Like DEFN. How many parameters can be defined in a RPG program? Max. 255. What are the different ways of ending an RPG program without a primary file ? SETON LR. SETON H1 to H9 (halt indicators). SETON RT. RETRN. By allowing an exception / error to end the program if . No exception / error subroutine is specified . No return point is specified on an exception or error subroutine . The user's response is to cancel the program. Specify different ways by which RPG program can give error message to user? By calling the SUBR23R3 program as passing message id. By defining the error message in DSPF. If you are trying to add a record in a file and an error is displayed, where do you look for error ? Check whether you have opened the file in Update mode. Check whether you have specified 'A' in position 72 of F specs. What is a File Information Data Structure ? File Information Data structure (INFDS) can be defined for each file to make file exception/error information available to the program. A file information data structure contains predefined subfields that identify: . The name of the file for which the exception/error occurred . The record being processed when the exception/error occurred or the record that caused the exception/error . The last operation being processed when the exception/error occurred . The status code . The RPG routine in which the exception/error occurred. What is Program Status Data Structure ? A program status DS can defined to make program exception/error information available to an RPG program. DS is defined as a program status DS by an S in position 18 of the DS statement. *STATUS contains status code

QL40225 AL40225

QL50226 AL50226

QL50227 AL50227

QL50228 AL50228

AS/400 Question Bank

Page 25

*ROUTINE contains name of routine in which the exception/error occurred. *PARMS contains the number parameters passed to this program from the calling program. Specify heading information/TITLE. Specify to begin on a fresh page/EJECT. To control line spacing/SPACE. Records to be inserted from other files at the point where it is specified/COPY. QO30229 in AO30229 QL30230 AL30230 What is the maximum no. of times multiple occurrence DS can occur a program ? 9999. What is the difference between *LIKE and *NAMVAR ? *LIKE defines the variables as in database. *NAMVAR is used to define variables as data area.

QL30231 AL30231

How is embedded SQL used in RPG ? /EXEC SQL + SQL statements + -------------------+ -------------------/END EXEC What are all the compiler directive statements ? /TITLE, /EJECT, /SPACE, /COPY. How can RPG program send message to System Operator ? Use QCMDEXC as called program in the CALL statements, and use SNDPGMMSG to the operator. Where DBCS data will be used in RPG ? In any comment statement In comment field of E and C Specs In literals and constants As data in any character field, subfield, array or table.

QS30232 AS30232 QS40233 AS40233

QL50234 AL50234

AS/400 Question Bank

Page 26

QS40235 AS40235 QS40236 AS40236

Where will control be passed after the execution of the *PSSR subroutine if the factor 2 of the ENDSR is blank ? Control will return to the next sequential instruction. How can the CPF error-id be retrieved when a program error occurs ? CPF error codes are placed in the subfield location *STATUS for the program status DS. How could indicators 50 to 99 be set to '0' in one instruction ? Using 'MOVEA *ZEROS IN,50' . What are the figurative constants ? *BLANK/*BLANKS, *ZERO/*ZEROS, *HIVAL, *LOVAL, *ALL 'X..' are implied literals that can be supplied without a length, because the implied length and decimal positions of a figurative constant are The same as those of the associated field. What is the maximum error severity for which the compilation of RPG program stops ? 50, if LR is not seton. What are the earlier versions of RPG ? RPG II & RPG III. Name the different ways by which RPG source program can be entered ? Interactively with SEU, In batch by using either OS/400 or Spooling functions. During input operation which indicator position is seton if the record is locked ? Position 56 - 57 (LO). What is the record lock status value ? Status value is 01218.

QS30237 AS30237 QL30238 AL30238

QO30239 AO30239 Q6S2001 A6AS2001 Q6L4002 A6L4002

Q6O3003 A6O3003 Q6O5004 A6O5004

MISCELLANEOUS
QO30240 AO30240 QO30241 AO30241 QO20242 How do you combine two record formats in RLU ? Using CLC. How do you split record formats in RLU ? Using CLR. What is the use of SDA ?

AS/400 Question Bank

Page 27

AO20242 QO40243 AO40243 QS40244 AS40244 QS30245 AS30245 QO20246 AO20246 QS20247 AS20247 QS50248 AS50248 QL50249 AL50249

Screen Design Aid is used to create display files interactively. How do you define overlapping fields in SDA ? They can be defined through condition indicators. Mention different ways of specifying user help. Through SDA and Panel Group. To which member type does help text for panel belong ? PNLGRP Can Printer files be externally described or program described ? Yes. What are the valid file operation codes for a PRINTER file ? WRITE, OPEN, CLOSE, FEDO. If you use INDARA keyword for a program-described PRINTER file, what will be the result ? You will get run-time error. What is PRTCTL, and where will you define it ? The PRTCTL (Printer Control) option allows you to change forms control information and to access the current line value within the program for a program-described PRINTER file. PRTCTL option will be specified on a F specifications continuation line for the PRINTER file. What is the function of RLU ? To design & prototype a report. What are the three types of keywords associated with printer file ? File level, Record level & Field level. What are the three line types in RLU ? Report line, Filler line & Sample line. Which option number is used to invoke RLU ? Option 19. What are the different commands used in RLU ? DR - Define Record, CLC - Change Line for Continuation, CLR Change Line for Record, SD - Create Sample Data, VF - View Fields, NP - New Page, DC - Define Constants, DF - Define Fields, CF Centre Fields & SP - Space Fields evenly.

Q8S2001 A8S2001 Q8S2002 A8S2002 Q8S2003 A8S2003 Q8O1004 A8O1004 Q8L4005 A8L4005

AS/400 Question Bank

Page 28

Q8O1006 A8O1006 Q8S1007 A8S1007 Q8L4008 A8L4008

What is the command used to invoke RLU ? STRRLU. What are different record spacing keywords in RLU ? SKIPA, SKIPB, SPACEA & SPACEB. What is job description ? A job is an unit of work on the AS/400. Jobs run in a subsystem using system resources viz. memory, disk, etc. A job can be either interactive or batch. For interactive jobs JOD in User profile is used and for batch jobs JOBD along with SBMJOB is submitted with an object type of job description is *JOBD. Job description is a set of characteristics that define how the system handles a job. It contains: Job queue (only for batch), job priority, printer to be used, OUTQ & its priority, time slice & run priority. If none of the above is specified the system used the default job description. Define a sub system? Sub system is an operating environment, defined by a sub system description. All user jobs are processed in the sub system. Eg.QBASE, QBATCH, QCTL, QINTER, etc. Sub system description defines the characteristics of a sub system. ROUTING ENTRY: Specifies the program to be called to control a routing step. WORK ENTRY: Source from which jobs can be accepted. WORK STATION ENTRY: Display stations from which users can log into the sub system. Open query file [OPNQRYF]? Open query file (OPNQRYF) selection can be on: * Dynamic record selection * Dynamic keyed sequence * Dynamic join * Unique key processing * Group processing * Final total processing * Improve performance Query access path will be implemented through the following objects * CL program containing an OPNQRYF to open access path at runtime * OS/400 physical file used to compile programs [dummy PF] used at runtime * OS/400 logical file defines the key to OPNQRYF command

Q8L4009 A8L4009

Q8L4010 A8L4010

AS/400 Question Bank

Page 29

Q8L4011 A8L4011

Override database [OVRDBF] ? Override database [OVRDBF] lets to override the filenames or attributes of file selected when we compile/run program. Overrides can be used to change most of the attributes. To cancel the override database command we shall have to give delete override databases DLTOVR. How do you pass numeric parameters for submitjob ? Convert numeric parameters to character and pass, or.pass in hexadecimal format ( x’0nf’ if ‘n’ contains odd number of digits x’nf’ if ‘n’ contains even nunber of digits)

Q8L4011 A8L4011

APPENDIX - A
The coding methodology to be followed to code questions & answers that are to be added to this question bank is described below. CODE STRUCTURE : ABCDnnn.

A - A indicates whether the code is a question or an answer. The possible values are : Q - Question. A - Answer.

B - B indicates the topic under which the question/answer falls. The possible values are : 1 - AS/400 SYSTEM. 2 - OS/400 3 - DATABASE FILES 4 - DISPLAY FILES 5 - CL/400 6 - RPG/400 7 - COBOL/400 8 - MISCELLANEOUS

AS/400 Question Bank

Page 30

C - C indicates the question/answer type. The possible values are : O - Objective type. S - Short answers. L - Long answers.

D - D indicates the complexity level of the question/answer. The possible values are : Complexity levels 1/2/3/4/5 ( Where complexity level increases from 1 - 5 ) nnn - These represent the numeric sequence.

AS/400 Question Bank

Page 31