printed_as cl db dds rlu rpg

32
AS/400 SYSTEM Que : What is the Configuration of the AS/400 system on which you have worked? Ans : System E35(Model 9406), 24MB main memory, 3.2GB of HD and supports 49 terminals(7 Port). Que : How many terminals can be connected to a port ? Ans : 7 terminals Que : What do the terms CUA and SAA stand for? Ans : Common User Access Systems Application Architecture Que : What are the communication protocols supported by AS/400? Ans : APPC (Advanced Program to Program Communication) BSCEL(Binary Synchronous Link) ASYNCH(Asynchronous Communication) RETAIL TCP IP FINANCE SNUF SNA Upline facility INTRA Intrasystem communication. Que :What are the different ways of connecting a terminal to a system Ans : Twinnax, Workstation, ASCII and OS/2 Workstation. Que : Why is AS/400 called an Object Oriented Machine ? Ans : 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. Que : What is SAA ? Ans : 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. Que : What are the different AS/400 rack models supplied by IBM Ans : 9402, 9404 and 9406. Que : What are the different high-level languages available on AS/400 Ans : RPG/400, CL/400, BASIC, PL/1, C/400, PASCAL, FORTRAN/400 and RM/COBOL-85, COBOL/400 etc.. Que : What are all the IBM Mid range machines prior to AS/400? Ans : S/38, S/36, S/34, S/32 &S/3.

Upload: vijay-das

Post on 02-May-2017

234 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Printed_as Cl Db Dds Rlu Rpg

AS/400 SYSTEMQue : What is the Configuration of the AS/400 system on which you have

worked?Ans : System E35(Model 9406), 24MB main memory, 3.2GB of HD and

supports 49 terminals(7 Port).

Que : How many terminals can be connected to a port ?Ans : 7 terminals

Que : What do the terms CUA and SAA stand for?Ans : Common User Access Systems Application Architecture

Que : What are the communication protocols supported by AS/400? Ans : APPC (Advanced Program to Program Communication)

BSCEL(Binary Synchronous Link)ASYNCH(Asynchronous Communication)RETAILTCP IPFINANCESNUF SNA Upline facilityINTRA Intrasystem communication.

Que :What are the different ways of connecting a terminal to a system Ans : Twinnax, Workstation, ASCII and OS/2 Workstation.

Que : Why is AS/400 called an Object Oriented Machine ?Ans : 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.

Que : What is SAA ?Ans : Systems Application Architecture (SAA) is a collection ofselected software Interfaces, Conventions and Protocols that willprovide a consistent framework across the System/370, AS/400 and PS/2.Que : What are the different AS/400 rack models supplied by IBMAns : 9402, 9404 and 9406.

Que : What are the different high-level languages available on AS/400 Ans : RPG/400, CL/400, BASIC, PL/1, C/400, PASCAL, FORTRAN/400

and RM/COBOL-85, COBOL/400 etc..

Que : What are all the IBM Mid range machines prior to AS/400?Ans : S/38, S/36, S/34, S/32 &S/3.

Que : What is the Operating System on AS/400?Ans : OS/400.

Que : What are office tasks available on AS/400?Ans : Office Vision/400 & PC Support/400.

Que : What are the graphic utilities available on AS/400?Ans : BGU & GDDM.

Page 2: Printed_as Cl Db Dds Rlu Rpg

OS/400Que : What is the version of OS/400 that you have used?Ans : Ver 2.2

QUE : What is DDM ?Ans : 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.

QUE : What are the facilities available on AS/400 for self-learning ?Ans : on-line education, Q&A Database and Help. QUE : What is an Object ?Ans : An object is any thing that exist in and occupies space in

storage and on which operation can be performed.

QUE : What are the different types of Objects available in the AS/400 Ans : Libraries, Folders, Files, Programs, Combined definitions,

Queues, User Profiles.

QUE : How are the objects stored in AS/400 ?Ans : 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.

QUE : What is a library in AS/400 ?Ans : A library in AS/400 is an object that serves as a repository

for other objects.

QUE : Name few IBM supplied libraries ?Ans : QGPL, QTEMP, QUSRTOOL, QUE :YS, QRPG & QCBL.

QUE : What is a library list ?Ans : A list that indicates libraries used for the process and the

order in which it has to be searched. System identifies it in *LIBL.

QUE : How many libraries can be there in a library list ?Ans : Total 40 (15 system and 25 application).

QUE : Where is the system part of the library list stored ?Ans : In SYSVAL

QUE : What is a Folder ?Ans : A Folder is a named object that is used as a directory for

documents and other folders. Folders can be filed with inanother folder.

QUE : What are the different Application Development Tools available on AS/400 ?

Page 3: Printed_as Cl Db Dds Rlu Rpg

Ans : SEU, RLU, PDM, SDA, QUERY

QUE : What are the levels of security on AS/400 ?Ans : 10,20,30,40,50

QUE : What is error severity ?Ans : Error severity determines the level of severity that is

required to terminate the job.

QUE : What is a User Profile ? What are the various classes ?Ans : 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.

QUE : What is Group Profile ?Ans : It is similar to User Profile, but the attributes specified is

applicable to an entire group.

QUE : What are the different types of queues in AS/400 ?Ans : Job queue, Message queue, Output queue, Data queue.

Que : What are JobQ and PrintQ ?Ans : 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.

QUE : What is a Spool file ? Why is it required ?Ans : A file that holds output data to be processed, such as

information waiting to be printed.

Que : What is a Job ? What are the attributes Of a job ?Ans : A job is the basic unit of work on AS/400

The attributes are:Job Number: Unique system generated sequential numberJob Name : Any user defined name (Max. 10 char)User Name : Who initiated the job

QUE : What is job description ?A job description defines the environment in which a batch/interactive job is to be executed.

Que : 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.

Que : What is a Group Job ?A Group Job is attached to one workstation and a user. Thereshould be an initial group job and it can be branched to manyother group jobs. The group jobs can have different library

Page 4: Printed_as Cl Db Dds Rlu Rpg

lists and different output, message queues. Group Job is usefulin enhancing the programmers productivity. It is as thoughlogging into the same user-id many times.

Que : What are the two main attributes which govern the execution of a job ?Run time priority and Time slice.

Que : 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.

Que : What is a device file ?A device file contains the description of how data is to bepresented to a program from a device or Vice versa. Device filecan be Printer, Disk, Tape or Remote system.

QUE : What is an ICF file ?A device file that allows a program on the system tocommunicate with program in other system.

QUE : 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.

Que : What is a job log ?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

Que : 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.

QUE : How do you create files dynamically without DDS ?Through OPNQRY.

Que : What command must be executed before executing OPNQRYF command ?OVRDBF.

Que :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.

QUE : 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.

QUE : What is LDA ?

Page 5: Printed_as Cl Db Dds Rlu Rpg

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.

QUE : What is the type and length of an LDA ?*CHAR, 1024 bytes.

QUE : What is GDA ?The system creates a GDA when an interactive job becomes group jobs. Only one GDA can exists for a group.

QUE : How can you create a user defined data area ?Using CRTDTAARA command.

QUE : What are the different ways to input data into a data area ?CHGDTAARA (using CL)Using OUT opcode in RPG

QUE : How do you retrieve data from data area ?Using RTVDTAARA command in CL Using IN opcode in RPG.

QUE : What are the valid user defined data area types ?CHAR, NUMARIC and LOGICAL.

QUE : How can a data area be locked after being updated ?Using OUT *LOCK.

QUE : 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.

Que : How do you create data queues ?Using CRTDTAQ command.

QUE : What are the valid data types for a data queue ?Char, Numeric, and Logical.

QUE : What are the two types of read performed on data queues ?Read with lock, and read without lock.

QUE : How do you use DEBUG utility ?STRDBG program-name UPDPROD(*YES)

QUE : 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.

Que : How do you grant authority for an object?Using GRTOBJAUT command.

Que : What are the types of object authorities ?*USE, *CHANGE, *ALL, *EXCLUDE, *AUTL, *OBJEXIST, *OBJMGT, *OBJOPR, *ADD, *DLT, *READ, *UPD.

Que : How do you execute jobs in batch mode ?Ans : SBMJOB

Page 6: Printed_as Cl Db Dds Rlu Rpg

Que : What is the use of OVRDBF ?Ans : 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.

Que : What is the use of OVRPRTF ?Ans : 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.

Que : How do you change file attributes such as size, file wait time, record wait time etc., permanently ?

Ans : Using CHGPF command.

QUE : What is the purpose of CRTCMD ?Ans : To create user defined command.

QUE : What is class of service ?Ans : A set of link and node characteristics associated with a

session.

QUE : How to see active jobs of the system ?Ans : Using WRKACTJOB command.

QUE : How do you detect unused spool storage ?Ans : Using Reclaim Spool Storage.

QUE : What are the functions of Remote Job Entry (RJE) ?Ans :Allows user of AS/400 system to submit jobs and receive jobs

from a host system.

Que : What is the function of RJE Conversion Utility ?Ans : It converts compressed data written to an AS/400 database file

to decompressed data written to another AS/400 database, diskette,or device file.

QUE : What is the function of the SBMRJEJOB command ?Ans : Sends RJE input stream to host system.

Que : What is journalling and commitment control ?Ans : Journalling is a function which records the changes in a filein

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

QUE : What is the purpose of STRCMTCTL command ?Ans : Starts commitment control for files that are being journalled.

QUE : What are the system objects required for journalling ?Ans : Journal receiver, journal and PFs to be journalled.

Que : What is CPF ?Ans : Control Program Facility (CPF) is an operating system on S/38.

Page 7: Printed_as Cl Db Dds Rlu Rpg

Que : What is invocation stack ?Ans : List of programs maintained by the system as one program calls

another in a series of calls within a single task or job.

Que : What is time slice ?Ans : A finite amount of time in which a job is granted system

resources while other jobs are queued.

Que : What is IPL ?Ans : Initial Program Loading (IPL) is run by OS/400 when the system

is started.

Que : What does V2R2M0 mean ?Ans : Ver. 2, Release 2 & Modification level 0. This refers to the

version of OS/400.

Que : Name the commands used to duplicate a file ? Ans : CPYF - Copy File & CRTDUPOBJ - Create Duplicate Object.

Que : Name the command for changing the attributes of a spool file ?Ans : CHGSPLFA - Change Spool file Attributes.

Que : Name the command which gives the attributes of a job ?Ans : RTVJOBA - Retrieve Job Attributes.

Que : What is the function of PDM ?Ans : Productivity tool for copying, deleting, scanning, changing &

creating source files.

Que : What is the function of SEU ?A utility for editing programming language source code.

Page 8: Printed_as Cl Db Dds Rlu Rpg

DATABASE FILES

Que : What are the different definition levels in Data Description specifications ?

Ans : File level, Record level, Field level, Join level, Keyfieldlevel, Select/Omit level.

Que : What is difference between Source Physical File and Physical File ?

Ans : 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.

QUE : What is the difference between Physical and Logical files ?Ans : Physical file contains data, where as Logical file serves as a

access Path to database.

QUE : What is an access path ?Ans : The order in which the database fields are organized for processing in the program.

QUE : What are all the different types of access paths ?Ans : Arrival sequence access path,

Keyed sequence access path.

QUE : How many record formats can you have in a Physical file and in a Logical file ?

Ans : Physical file can contain only one record format, Logical file can contain more than one record format.

QUE : What is a field reference file ?Ans : 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.

Que : What is the default value for the number of increments for the physical file ?

Ans : Three.

QUE : When is the DFT keyword in PF used for?Ans : To specify the default value it a field.

QUE : What is Multi-format logical file ?Ans : Logical which uses fields from two or more physical files.

Que : What is dynamic select ?Ans : 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.

Que : What is the Select and Omit criteria in logical file ?Ans : This is used to specify rules for the Selection/Omission of

records from a Physical File.

Page 9: Printed_as Cl Db Dds Rlu Rpg

QUE : Can fields be concatenated at the logical file level ?Ans : Yes, by using CONCAT keyword.

QUE : When would the ALL keyword be used ?Ans : Use with Select or Omit, to select/omit records.

QUE : What is a Join Logical File, Can it be used for Update ?Ans : Logical file that combines more than one physical file.

Update is not possible through JLF.

Que : How many files can be joined at a time, What is the max. no. of files ?

Ans : 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.

Que : Is it possible to join the same file to itself ?Ans : Yes.

QUE : What is FCFO, FIFO, LIFO in Database environment ?Ans : These are file level keywords which are used to access

The records in the orderFCFO: First Changed First OutFIFO: First In First OutLIFO: Last In Fist Out

Que : If a file layout is changed, how do you generate new PF andretain data?

Ans : Copy the file and change the structure of Physical file, latercopy old file with drop option.

QUE : What is the overhead on logical file ? How can it be improved ?Ans : Maintaining access path and storage space. We can improve the

performance by using *DELAYED, *REBUILD keywords to enhance the speed.

QUE : How can the sign of a numeric be ignored when sequencing a logical file ?

Ans : By specifying the record level keyword UNSIGNED.

QUE : 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 ?Ans : Yes, by using DLTEDT keyword.

Que : What does the keyword UNIQUE mean ?Ans : Records with duplicate key values are not allowed.

Que : State three different methods of maintaining access paths ?Ans : Immediate, Rebuild & Delay.

Page 10: Printed_as Cl Db Dds Rlu Rpg

DISPLAY FILESQUE : What are the different types of keywords in display files ?Ans : File level, Record format level, Field level.

Que : What is the maximum number of records you can specify in a display file ?

Ans : 1024.

QUE : How can a screen field that has changed since the last output operation be detected ?

Ans : Attach the MDT attribute to the field, to detect whether field has been changed as a result of user input.

QUE : What would be the effect on the field where reverse image, underline and highlight display attributes are active ?

Ans : The result is same as if you had specified ND.

Que : What is the use of DSPATR(MDT) keyword ?Ans : 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.

Que : If DSPATR(PC) and CSRLOC were specified for a format, which keyword would have priority ?

Ans : CSRLOC gains priority.

QUE : Can error messages as a result of a COMP, RANGE or VALUES keyword be overridden ?

Ans : Yes, through CHKMSGID keyword.

Que : What is the purpose of OVRDTA and OVRATA keywords ?Ans : 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.

QUE : How can a message from a message file appear as a constant on the screen ?

Ans : By using MSGCON (message constant) keyword.

QUE : In conjunction with what other keyword must OVRDTA and OVRATAbe used ?

Ans : PUTOVR keyword must be used.

QUE : 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?

Ans : Using BLKFOLD keyword.

QUE : What is the purpose of the INDARA keyword ?Ans : This File-level keyword is used to remove option and response

Page 11: Printed_as Cl Db Dds Rlu Rpg

indicators from the buffer and places them in 99-byte separate indicator area.

Que : Explain the purpose of KEEP and ASSUME keywords ?Ans : 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.

QUE : Explain the use of DFRWRT display keyword ?Ans : No records will be displayed until there is an I/O operation.

QUE : What is the purpose of FRCDTA keyword ?Ans : Immediately display a record format without waiting for the

next I/O operation.

QUE : What keyword must be used with PROTECT keyword ?Ans : OVERLAY

QUE : Where is the variable for the SLNO(*VAR) keyword be defined ?Ans : At run time before displaying the record format.

QUE : Under what conditions would a field where the ERRMSG keywordwas active would not be displayed in reverse image ?

Ans :If it is an output-only field or input capable field withdisplay attributes UL, HI are active.

QUE : When will the message for field that has the ERRMSG keyword active not be displayed ?

Ans :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.

QUE : What is CHGINPDFT keyword, and what will be the effect if you define this keyword at file with out any parameter values ?

Ans : 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.

QUE : In what case control will be passed back to the program when the last character of the field is keyed ?

Ans : CHECK(ER) ER - End of Record.

Page 12: Printed_as Cl Db Dds Rlu Rpg

SUBFILES Que : What is a subfile ?Ans : Subfile is a group of records of same record format and can be

read from or write to the display in a single operation.

Que : What are the contents of subfile ?Subfile Record Format, Subfile Control Record Format, Relative Record Number, Subfile Record Number, Associated SubfileKeywords.

QUE : What are the two record formats that a subfile contains ? Subfile record format(SFL), and subfile control record format(SFLCTL).

Que : What is SFLPAG and SFLSIZ ?Ans :

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.

Que : What is the maximum number of subfiles that can specified in adisplay file ?

Ans : 512

Que :The maximum number of subfiles that can defined in a RPG program for one display file is ___ .

Ans : 24

Que : The maximum number of subfiles that can be active for a single file is ____ .

Ans : 12

Que : What are the different opcodes used for file operation on a subfile in a RPG Program ?

Ans : READ, READC, CHAIN, UPDAT and WRITE

QUE : Can more than one subfile record be displayed on one line? Ans : Yes, by using SFLLIN keyword.

QUE : How do you specify the number of records to roll in a subfile ?Ans : Use SFLROLVAL keyword in DDS along with the number, which

specifies the number of records to scroll at a time.

Que : How will you display a particular page in subfile ?Ans : Move a valid relative record number(RRN) in the field specified using SFLRCDNBR keyword in DDS.

QUE : How to pick up the changed records every time in a subfileAns : after the first change made ?

Seton SFLNXTCHG keyword indicator and update the subfile record.

Page 13: Printed_as Cl Db Dds Rlu Rpg

QUE : What is the use of the SFLEND keyword ?Ans : By specifying this keyword, the Bottom/More message could be

displayed at end of screen.

QUE : How do you toggle between single line and multi-line display of a particular record in a subfile ?

Ans : Using SFLDROP keyword.

QUE :Explain the difference between defining Subfile and Message- subfile ?Ans : 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.

QUE : How can a program be prevented from failing over when READC is performed on an empty subfile ?

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

Page 14: Printed_as Cl Db Dds Rlu Rpg

CONTROL LANGUAGE (CL/400)QUE : How to start a CL program ?

PGM.QUE :How many files can be declared in CL ?Ans : One.

QUE :Which precedes, the file declaration or variable declaration ?Ans : Variable declaration and then File declaration.

QUE : What are the different types of variables available in CL ?Ans : DEC, CHAR, LGL

QUE : In CL Program '&' precedes ____ .Ans : Variables.

QUE : How do you pass parameters in CL ?Ans : Using PARM keyword.

QUE :Can libraries be added to the library list through CL ?Ans : Yes, using ADDLIBL.

QUE :What is the difference between CAT, TCAT and BCAT ?Ans : 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.

QUE : How do you end a CL program ?Ans : ENDPGMQUE : What are the different types of messages in CL ?Ans : Immediate message, Break message, Program message,User message.

QUE : How can errors be trapped in a CL program?Ans : By using Monitor Message Command ( MONMSG )

QUE :What is the maximum length of a variable name in CL ?Ans : Maximum 11 characters (including '&')

QUE :What are the limitations of CL (compare to RPG) ?Ans : 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.

Page 15: Printed_as Cl Db Dds Rlu Rpg

RPG/400Que : What is RPG ?Ans : Report Program Generator.

Que : What are the positive points of RPG Language ?Ans : Contains opcodes which makes it flexible with OS/400

Can access the externally described file.

Explain RPG Program Logic Cycle ?

QUE : When is it efficient to make use of RPG Cycle ?Ans : When the file is arranged in sequence and output is based on control break.

QUE : Can you call a program in your RPG program, which is coded in some other language ?

Ans : Yes, Any program object available on AS/400.

Que : What are the different types of specification available in RPG/400 ?

Ans : Control Spec.( H )File Spec.( F )Extension Spec.( E )Line counter Spec.( L )Input Spec.( I )Calculation Spec.( C )Output Spec.( O )

Que : Is it necessary to define all formats ? Which are mandatory and which are Optional ?

Ans : No, all are Optional.

QUE : What is the use of H spec. in RPG ?

Page 16: Printed_as Cl Db Dds Rlu Rpg

Ans : It identifies by H in column 6, Provides information aboutgenerating and running programs.

QUE : When will DUMP and DEBUG opcodes be ignored ?Ans : If blank is specified in position 15 of H specs.

QUE : What are the valid file types ( position 15 ) in F specification Ans : I (Input file).

O (Output file).U (Update file).C (Combined (I/O) file).

Que : Specify different indicators used in RPG ?Ans : Overflow indicators.

Record Identifying Indicators.Field Indicators.Resulting Indicators.Control Level Indicators.

Que : What are Control level indicators ?Ans : 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.

QUE : What is the use of E specification in RPG ?Ans : Extension Specs describes all record address files, arrays and

tables.

QUE : What is the use of L specs in RPG ?Ans : Line counter specification can be used to describe printer file

to indicate the length of the form and number of lines per page.

QUE : In which specification can a report layout be defined ?Ans : O Specification.

Que : How many files can be defined in F specs ?Ans : A maximum of 50 files.

Que : How many printer files can be defined in F specs ?Ans : A maximum of 8 files.

QUE : Give three main purposes of File specification ?Ans : To define files, to describe the files, to assign the files to

specified devices.

QUE : How do you specify page overflow indicator for printer files in RPG ?

Ans : Specify an indicator in positions 33-34 of F specification.

QUE : What is a Primary File ?Ans : It is used in RPG Program Cycle to automatically read records

in a cycle.

Que : Can an indexed file be accessed in arrival sequence in RPGprogram ?

Page 17: Printed_as Cl Db Dds Rlu Rpg

Ans : Yes.

QUE : What is a program described file in RPG ?Ans : The field name and length of the fields are defined with

in the RPG program.

QUE : What is an externally described file ?Ans : All information about the fields is specified in DDS and the

RPG program can use them with in the program.

QUE : Can you specify a display file to be used in the following Ans : modes: Input, Output or Combined modes?

Yes.

QUE : What are match fields indicators?Ans : Matching record indicator is seton when all the matching

fields in the record of a secondary file matches with all thematching fields of a record in a primary file.

QUE : What is the length of a variable in RPG ?Ans : 6 Characters.

QUE : What are the different arithmetic Opcodes ?Ans : ADD, SUB, MULT, DIV, MVR, SQRT, XFOOT, Z-ADD, Z-SUB.

QUE : When is a TAG statement used in RPG ?Ans : It is used as a Label.

QUE : What are the different Opcodes available in RPG for Databaseaccess ?

Ans : READ, CHAIN, WRITE, UPDAT, DELET, SETLL, SETGT, READE, READP,REDPE, OPEN, CLOSE, FORCE, NEXT, UNLCK.

QUE : What is READP opcode ?Ans : Read previous record.

QUE : What is REDPE opcode ?ANS : Read Prior equal record.

QUE : How do you check if a division was whole division ?ANS : Check the EQ indicator be set to '1'

QUE : What opcode could be used to test an alphanumeric field for all numeric values? ANS : TESTN.

QUE : What opcode will be used to test the zone of a character field ANS : TESTZ.

QUE : How do you specify Half Adjust ?ANS : 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.

Page 18: Printed_as Cl Db Dds Rlu Rpg

QUE : Explain the difference between READ, CHAIN and SETLL ?ANS : READ operation reads the record currently pointed to, from a

full procedural file.CHAIN operation retrieves a record from a full Procedural file,sets a record identifying indicator ON and places the data inthe input fields.SETLL operation position a file at the next record that has akey or relative record number that is greater than or equal tothe search argument specified. The file must be fullyprocedural for all three opcodes.

Que : What does LO and EQ indicators signify in READ, WRITE and CHAIN operations ?

ANS : LO indicator specifies the error status on the above.EQ indicator specifies the EOF, Record not found.

QUE : How can database records be read without lock ?ANS : Put 'N' in position 53 of C specs.

Que : What is the difference between MOVE and MOVEL ?ANS : MOVE operation will transfer characters from the factor 2 to

the result field, the move starts from rightmostcharacter of factor 2.MOVEL operation will transfer characters from factor 2 to the result field, the move starts from leftmost character of factor 2.

QUE : How do you concatenate two string variables in RPG ?ANS : Using CAT opcode or with MOVE followed by MOVEL.

Que : What are the string operations possible in RPG/400 ?ANS : CHECK, CHEKR, SUBST, CAT, XLATE, SCAN.

QUE : What does SUBST do ?ANS : Extracts a specified character string from a base character string.

QUE : What does CHECK opcode do ?ANS : The check operation verifies that each character in the base

string (factor 2) is among the character indicated in thecomparator string(factor 1).

QUE :In conjunction with which statements can ORxx and ANDxx conditions be used ?ANS :DOUxx, DOWxx, IFxx, and WHxx.

QUE : What is the difference between DOU and DOW ?ANS : DOU checks after entering into the loop, it is performed atleast once. DOW check before entering into the loop.

QUE : What is ITER and LEAVE opcodes do ?ANS : ITER transfers control from within a DO group to the ENDDO

statement of the DO group. It causes the next iteration of theloop to be executed immediately

Page 19: Printed_as Cl Db Dds Rlu Rpg

LEAVE operation transfers control from within a DO group to the statement following the ENDDO operation.

QUE : Which instructions support structured programming in RPG ?ANS : ANDxx, CASxx, DO group, ELSE, ENDyy, IFxx, ITER, LEAVE,

ORxx, OTHER, SELEC, WHxx.

QUE : What does 'SR' in columns 7-8 of C specs mean ?ANS : Calculation operation is a part of RPG subroutine.

QUE : Explain CASxx, and CABxx statements ?ANS : CASxx operation allows you to conditionally select a subroutine

for processing. The condition is based on the relationshipbetween factor 1 and factor 2 as specified by xx.If therelationship is true the subroutine specified in the resultfield is processed.

CABxx operation compares factor 1 with factor 2 , if thecondition specified by xx is true, the program branches to theTAG operation associates with the label specified in the resultfield.

QUE : What is CLEAR and RESET ?ANS : 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 thefield type (numeric, character, indicator)

RESET operation sets the elements in a structure (recordformat, array/ table, data structure) or a variable (field,subfield or indicator) to its initial value.

QUE : What is SCAN and XLATE ?ANS : 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.

QUE : How do you use commitment control in RPG program ?ANS : Using COMIT operation.

Makes all changes to the files that have been specified inoutput operation since the previous COMIT or the beginning ofoperations under commitment control(if there has been noprevious COMIT or ROLBK operation).

QUE : How do you use exceptional write in C specs ?ANS : Using EXCPT opcode.

QUE : What does the opcode FREE do ?ANS : The FREE operation removes a program from the list of activated

Page 20: Printed_as Cl Db Dds Rlu Rpg

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.

QUE : What does opcode POST do?ANS : Puts information in INFDS.

QUE : What is the difference between WRITE and EXFMT of a display file ?

ANS : WRITE displays a record format on workstation,EXFMT displays and accepts from the workstation.

QUE : What is the difference between PLIST and KLIST ?AnS : 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 ofkey fields.

QUE : Can you have multiple key lists for a single file ?ANS : Yes.

QUE : What are the different types of arrays available in RPG ?ANS : Pre-run time array.

Compile time array.Run time array.

QUE : How do you specify data for a compile time array ?ANS : You can specify in E specs about the no of entries per record,

no of elements, length of each element with the correspondingdata entered at the end of the RPG program starting with **.

QUE : What is the maximum number of elements in an array ?ANS : 9999.

QUE : Can we define Multi-dimensional arrays in RPG ?ANS : No.

QUE : What is XFOOT opcode ?ANS : Adds all the elements in a numeric array, and places the sum in

the result field.

QUE : How can we sort an array ?ANS : By using SORTA opcode.

QUE : What is MOVEA opcode do ?ANS : Transfer character to numeric values from factor 2 to result

field.MOVEA can be possible to ARRAY-ARRAY, ARRAY-FIELD, or FIELD-ARRAY.

QUE : How to initialize an array ?ANS : CLEAR or MOVEA *blanks to array.

QUE : What is LOKUP opcode do ?

Page 21: Printed_as Cl Db Dds Rlu Rpg

ANS : LOKUP opcode search for a particular element in an array / table.

QUE : Can LOKUP operation be used for unsorted array ?ANS : Yes.

QUE : What is the difference between an array and a table ?ANS : An array elements can be refered by array name.

Elements in array can be accessed by their position relative toother elements.Table name does not refer to the entire set of table elements.Elements in a table can not be accessed by their positionrelative to the other elements.

Que : What is the maximum length of a table name ?ANS : 6 characters.

Que : What is the syntax of a table name ?ANS : Table name should start with TAB.

Que : How can the user implicitly open and close the files in RPGprogram ?

ANS : Enter UC in position 71-72 of F specs.Use OPEN and CLOSE opcodes in RPG program to open and closefiles.

Que : During input operation which indicator position is seton if there is a record lock?

ANS : LO indicator position is seton.

QUE : What is the significance of DEFN opcode on RPG ?ANS : To define fields based on the attributes of another field.

To define a field as a data area.

QUE : What are different ways by which you define working storage field ?

ANS : Explicitly define or use *Like DEFN.

Que : How many parameters can be defined in a RPG program?Ans : Max. 255.

Que : What are the different ways of ending an RPG program without a primary file ?

Ans : 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.

Que : Specify different ways by which RPG program can give error message to user?

Page 22: Printed_as Cl Db Dds Rlu Rpg

Ans : By calling the SUBR23R3 program as passing message id.By defining the error message in DSPF.

QUE : If you are trying to add a record in a file and an error is displayed, where do you look for error ?

ANS : Check whether you have opened the file in Update mode.Check whether you have specified 'A' in position 72 of F specs.

QUE : What is a File Information Data Structure ?ANS : 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.

QUE : What is Program Status Data Structure ?ANS : 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*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.

Que : What is the maximum no. of times multiple occurrence DS can occur in a program ?Ans : 9999.

QUE : What is the difference between *LIKE and *NAMVAR ?ANS : *LIKE defines the variables as in database.

*NAMVAR is used to define variables as data area.

QUE : How is embedded SQL used in RPG ?ANS : /EXEC SQL

+ SQL statements+ --------------------+ --------------------/END EXEC

Que : What are all the compiler directive statements ?Ans : /TITLE, /EJECT, /SPACE, /COPY.

Page 23: Printed_as Cl Db Dds Rlu Rpg

Que : How can RPG program send message to System Operator ?AnS : Use QCMDEXC as called program in the CALL statements, and use SNDPGMMSG to the operator.

Que : Where DBCS data will be used in RPG ?Ans :

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.

Que : Where will control be passed after the execution of the *PSSRsubroutine if the factor 2 of the ENDSR is blank ?

Ans : Control will return to the next sequential instruction.

Que : How can the CPF error-id be retrieved when a program error occurs ?

Ans : CPF error codes are placed in the subfield location *STATUS for the program status DS.

Que : How could indicators 50 to 99 be set to '0' in one instruction? Ans : Using 'MOVEA *ZEROS IN,50' .

QUE : What are the figurative constants ?ANS : *BLANK/*BLANKS, *ZERO/*ZEROS, *HIVAL, *LOVAL, *ALL 'X..' are

implied literals that can be supplied without a length, becausethe implied length and decimal positions of a figurativeconstant are The same as those of the associated field.

Que : What is the maximum error severity for which the compilation of RPG program stops ?Ans : 50, if LR is not seton.

Que : What are the earlier versions of RPG ?Ans : RPG II & RPG III.

Que : Name the different ways by which RPG source program can beentered ?

Ans : Interactively with SEU, In batch by using either OS/400 orSpooling functions.

Que : During input operation which indicator position is seton if the record is locked ?Ans : Position 56 - 57 (LO).

Que : What is the record lock status value ?Ans : Status value is 01218.

Page 24: Printed_as Cl Db Dds Rlu Rpg

MISCELLANEOUSQue : How do you combine two record formats in RLU ?Ans : Using CLC.

Que : How do you split record formats in RLU ?Ans : Using CLR.

Que : What is the use of SDA ?Ans : Screen Design Aid is used to create display files

interactively.

Que : How do you define overlapping fields in SDA ?Ans : They can be defined through condition indicators.

Que : Mention different ways of specifying user help.Ans : Through SDA and Panel Group.

Que : To which member type does help text for panel belong ?Ans : PNLGRP

QUE : Can Printer files be externally described or program described ANS : Yes.

QUE : What are the valid file operation codes for a PRINTER file ?ANS : WRITE, OPEN, CLOSE, FEDO.

QUE : If you use INDARA keyword for a program-described PRINTER file,what will be the result ?

ANS : You will get run-time error.

QUE : What is PRTCTL, and where will you define it ?ANS : The PRTCTL (Printer Control) option allows you to change forms

control information and to access the current line value withinthe program for a program-described PRINTER file. PRTCTL optionwill be specified on a F specifications continuation line forthe PRINTER file.

QUE : What is the function of RLU ?ANS : To design & prototype a report.

QUE : What are the three types of keywords associated with printer file ?ANS : File level, Record level & Field level.

QUE : What are the three line types in RLU ?ANS : Report line, Filler line & Sample line.

QUE : Which option number is used to invoke RLU ?ANS : Option 19.

QUE : What are the different commands used in RLU ?ANS : DR - Define Record, CLC - Change Line for Continuation, CLR -

Change Line for Record, SD - Create Sample Data, VF - View

Page 25: Printed_as Cl Db Dds Rlu Rpg

Fields, NP - New Page, DC - Define Constants, DF - Define Fields, CF - Centre Fields & SP - Space Fields evenly.

QUE : What is the command used to invoke RLU ?ANS : STRRLU.

Que : What are different record spacing keywords in RLU ?AnS : SKIPA, SKIPB, SPACEA & SPACEB.

QUE : What is job description ?ANS : 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.

QUE : Define a sub system?ANS : 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.

QUE : Open query file [OPNQRYF]?ANS : 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

QUE : Override database [OVRDBF] ?ANS : 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. Tocancel the override database command we shall have to give delete override databases DLTOVR.

Page 26: Printed_as Cl Db Dds Rlu Rpg

QUE : How do you pass numeric parameters for submitjob ?ANS : Convert numeric parameters to character and pass, or.pass in

hexadecimal format ( x’0nf’ if ‘n’ contains odd number ofdigits x’nf’ if ‘n’ contains even nunber of digits)

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/4003 - DATABASE FILES4 - DISPLAY FILES5 - CL/4006 - RPG/4007 - COBOL/4008 - MISCELLANEOUS

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 increasesfrom 1 - 5 )

nnn - These represent the numeric sequence.