Mainframe AS-400 Interview Questions Part 1

Q.What is the maximum number of records you can specify in a display file? A.1024

Q.How can a screen field that has changed since the last output operation be detected ? A.Attach the MDT (modified data tag) attribute to the field, to detect whether field has been changed as a result of user input.

Q.What would be the effect on the field where reverse image, underline and highlight display attributes were active? A.The result is same as if you had specified ND.

Q.What is the use of DSPATR(MDT) keyword? A.Sets on the modified Data Tag of the field. The Data Tag detect whether the field has been changed as a result of user input.

Q.If DSPATR(PC) and CSRLOC were specified for a format, which keyword would have priority? A.CSRLOC gains priority.

Q.Can error messages as a result of a COMP, RANGE or VALUES keyword be overridden? A.Yes, through CHKMSGID keyword.

Q.What the purpose of OVRDTA, OVRATA keywords? A. 1.OVRDTA keyword (field or record level) can be used to override the existing data contents of a field or record already on the display. 2.OVRATA keyword (field or record level) can be used to override the existing display attributes of a field or record already on the display.

Q.How can a message from a message file appear as a constant on the screen? A.By using MSGCON (message constant) keyword.

Q.In conjunction with what other keyword must OVRDTA and OVRATA be used? A.PUTOVR keyword must used.

Q.What is the purpose of the INDARA keyword? A.This File-level keyword is used to remove option and response indicators from the buffer and places them in 99byte separate indicator area.

Q.Explain the purpose of KEEP and ASSUME keywords? A.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. Q.Explain the use of DFTWRT display keyword? A.No records will be displayed until there is any I/O operation.

Q.What is the purpose of FRCDTA keyword ? A.Immediately display a record format without waiting for the next I/O operation.

Q.What keyword must be used with PROTECT keyword? A.OVERLAY

Q.What is Subfile? A.Subfile is group of records of same record format and can be read from or write to the display in a single operation.

Q.What are all the contents of subfile? A.Subfile Record Format, Subfile Control Record Format, Relative Record Number, Subfile Record Number, Associated Subfile Keywords.

Q.What are the two record formats a subfile contain ? A.Subfile record forma (SFL), and subfile control record forma (SFLCTL).

Q.What is SFLPAG and SFLSIZ ? A. 1.SFLPAG : it is an attribute which specifies the number of records that can be displayed in a screen. 2.SFLSIZ : it is an attribute which specifies the number of records can be stored in subfile.

Q.What is the maximum number of subfiles that can be specified in a display file, A.512

Q.Maximum number of subfiles that can Defined in a RPG program for one display file is A.24

Q.Maximum number of subfiles that can be active for a single file is? A.12

Q.Can more than one subfile record be displayed on one line? A.Yes, by using SFLLIN keyword.

Q.How do you specify the number of records to roll in a subfile? A.Use SFLROLVAL keyword in DDS along with number, which specifies the number of records to scroll at a time.

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

Q.How to pick up the changed records every time in a subfile after the first change made? A.Seton SFLNXTCHG keyword indicator and update the subfile record.

Q.What is the use of SFLEND keyword? A.By specifying this keyword, the Bottom/More message could be displayed at end of screen.

Q.How to toggle between single line and Multi - line display of a particular record in a subfile? A.Using SFLDROP keyword.

Q.Explain the difference between defining Subfile and Message-subfile? A.Subfile record is defined by SFL keyword, where as Message subfile is defined by SFLMSG keyword.

Q.What are the different types of variables available in CL? A.DEC, CHAR, LGL

Q.How do you pass parameters in CL? A.Using PARM keyword.

Q.What are the valid user defined data area types? A.CHAR, NUMERIC and LOGICAL

Q.What is Multi-format logical file? A.Logical which uses fields from two or more physical files.

Q.What is the Select and Omit criteria in logical file? A.This is used to specify rules for the Selection/Omission of records from a Physical File.

Q.Can fields be concatenated INa logical file level? A.Yes. by using CONCAT keyword

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

What are the different types of keywords in display files?

A.File level, Record format level, Field level

Q.What is difference between CAT, TCAT, BCAT? A. 1.CAT - Concatenate two variables or constants into one continuous string. 2.BCAT - Truncates all trailing blanks in the first character string, one blank is inserted, then the two character strings are concatenated. 3.TCAT - Truncates all trailing blanks in the first character string, the two character strings are concatenated.

Q.What are the different types of messages in CL? A.Immediate message, Break message, Program message, User message

Q.How to trap errors in CL? A.By using Monitor Message Command (MONMSG)

Q.What is the maximum length of a variable name in CL? A.Maximum 11 characters (including '&')

Q.What are the limitations of CL (compare to RPG) ? A. 1.You can not use CL program to ADD or UPDATE records in database files. 2.Use Printer or ICF files. 3.Use Program described files. 4.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. 5.Use subroutines. 6.You cannot declare more than one object (file) in a CL programme

Mainframe AS-400 Interview Questions Part 2

What is the difference between SFLCLR and SFLINZ? Ans:SFLCLR : It clears the subfile. SFLINZ : First it clears the subfile and initiliazing the numeric variables with zeros and alphanumeric variables with characters.

Define the purpose/use for SFLRNA? Ans:Using this, we can make specified subfile record format inactive.

b. READP To read the previous records d.What is the purpose of the following I UDS I 1 60ORDER# I 7 90LINE# Ans:The purpose is to define the variables in I-Spec and these are further used in C-spec. Define the purpose of the following code (If you know. The program sends output after setting the cursor location. READC To read the records from the workstation file (Subfile). READE To read the equal key records c. The letter "U" indicates that the defined data structure is a data area data structure. What is the purpose of the following? A CSRLOC (F1ROW F1COL) Ans:Using this record level keyword. you can specify cursor location on an output operation to the record format you are defining. Where as µU¶ indicates data area data structure? The above code is used to update the data area value through the program. READ To read the records sequentially. e. REDEP To read the equal key previous records. the purpose of the result field and the purpose of *IN66? HI LO EQ C CALL 'CVTDAT' DTPRM 66 Ans:The above statement causes. Define what the operation will do. Define each of the following operation codes a. how would this be written in RPG ILE) HI LO EQ C *IN66 DOUEQ *OFF C KEY1 CHAIN FILEA 90 66 C 66 CALL PGM1 PRM C ENDDO . call the program and pass the parameter.

34 columns in a printer file. When would you use or not use this approach? Ans:It is the most desirable method in building a real time applications. the program will ended abnormally. the control transfers after ENDDO statement. What is the difference between array and a multiple occurrence data structure? Ans:The values stored in array don¶t vary. We can use at all the times. when the same file of type " U" used in different programs. then only CALL statement will execute. Otherwise. If the specified indicator on LO position becomes *OFF. How can you execute a command from within an RPG program without calling a CLP program? Ans:By calling QCMDEXC application program interface we can execute a CL command with in an RPG program. we can get system defined message i. How can you detect overflow for a print program that prints multiple lines per cycle? Ans:You specify the indicators OA through OG and OV in 33 . It is a good place to code initializes the variables. Generally it will happen. it reads the records from the data base file based on indicator specified on HI position. . In the other hand. What is *INZSR used for? Ans:It is special type of RPG/400 subroutine.Ans:Whenever the indicator *IN66 becomes *OFF. Define a shared access path? Ans:To share the open data path by various programs in a same job. we can store the Different values in same variables at various stages. This indicator automatically set on whenever overflow occurs on a type of page. With the help of File Information Data Structure we can handle record lock situation. How do you set the keywords SFLSIZ and SFLPAG if you want the subfile to dynamically expand? Ans:SFLSIZ > SFLPAG. e. . How can you detect and handle a record lock situation? Ans:If you try to read the locked record. which is executed automatically at beginning of the program.

If you specify 'N' in 53rd position. BCAT . the record will not be locked if you try to read the locked record. What are the valid user defined data area types? Ans:CHAR. one blank is inserted.What is the purpose of the "N" in the following calculation specification? Ans:C KEY CHAIN FILE N 99. It is a way of avoiding the record lock. What are the different types of keywords in display files? Ans:File level. the two character strings are concatenated. Record format level. Can fields be concatenated INa logical file level? Ans:Yes. How do you pass parameters in CL? Ans:Using PARM keyword. then the two character strings are concatenated. TCAT .Truncates all trailing blanks in the first character string.Truncates all trailing blanks in the first character string. BCAT? Ans: CAT . NUMERIC and LOGICAL What is Multi-format logical file? Ans:Logical which uses fields from two or more physical files. 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. .Concatenate two variables or constants into one continuous string. Field level What is difference between CAT. by using CONCAT keyword When would the ALL keyword be used? Ans:Use with Select or Omit. to select/omit records. TCAT.

Specify different indicators used in RPG? Ans:Overflow indicators Record Identifying Indicators Field Indicators Resulting Indicators Control Level Indicators . When will DUMP and DEBUG opcodes be ignored? Ans:If blank is specified in position 15 of H specs. but a single output message subfile is a special type of subfile that is supported well in CL. provides informaion about generating and running programs.What are the different types of messages in CL? Ans:Immediate message. Use subroutines. Break message. Use Printer or ICF files. Program message. What is the use of Header Specification in RPG/400? Ans:It identifies by H in column 6. You cannot declare more than one object (file) in a CL programme. Use the concept of subfile (to display more than one record). Use Program described files. User message How to trap errors in CL? Ans:By using Monitor Message Command (MONMSG) What is the maximum length of a variable name in CL? Ans:Maximum 11 characters (including '&') What are the limitations of CL (compare to RPG) ? Ans:You can not use CL program to ADD or UPDATE records in database files.

In which specification the report layout can be defined? Ans:O Specification. SUBST & CAT DB2 is a type of Database? Ans:It is an Integrated RDBMS. SCAN. 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. *ROUTINE & *PROGRAM Which are the String Manipulation Opcodes? Ans:TESTN. CHECKR. CHECK. An access path may be in which sequence? Ans:It can be in Arrival & Keyed sequence . *PARM. arrays and tables. How many files can be defined in F specs? Ans:50 How many printer files can be defined in F specs ? Ans:8 Which are the four keywords supported by Program Status Data Structure? Ans:*STATUS.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. What is the use of E specification in RPG? Ans:Extension Specs describes all record address files.

Which type of object is used in DB2/400? Ans:*FILE What is SQL? Ans:SQL is an interface for programming language. File level entry for a PF can be? Ans:UNIQUE & FIFO What is the command to create FRF? Ans:CRTPF Join Logical File displays data from how many files? 2 or more PF¶s .To change constant field defined on RLU screen which field level keyword should be used? Ans:DFT (Default) Space & Skip are which level keywords? Ans:Field & Record A Join Logical File has how many Record formats? Ans:1 A Multiple format Logical File is also known as? Ans:Union File How does Union file maintains Record formats? Ans:1 Record format for each PF Records can be Read/Update/Deleted with which file? Ans:Simple Logical File & Physical File.

the function key to be pressed is? Ans:F9 A query can be run in which mode? Ans:Batch & Interactive What is the values SQLCOD when there is an error in fetching the records specified in the select statement? Ans:-ve value A file cannot have more than 1 unique key? Ans:False DLCOBJ command is mandatory for removing lock on any object? Ans:False What is a Journal? Ans:A Journal is an object used primarily to record changes to data in a PF.A Query can be displayed without saving it? Ans:True Which are the Query selection criteria. . Referential Integrity Embedded SQL & Object/Record Locks.What is the Function of PDM? A. Mainframe AS-400 Interview Questions Part 3 Q. which can be given in a Query? Ans:LIST To add a file to the µFile Selection¶ option of a Query. Which are the DB2 tools to protect Integrity of the database? Ans:Journaling & Commitment Control. scanning. changing & creating source files. deleting.Productivity tool for copying.

255 Q.What is the use of SDA ? A. The logic flow is controlled by the opcodes in RPG program. The RPG routine in which the exception/error occurred. The last operation being processed when the exception/error occurred.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.What is difference between fully procedural file and primary file? A.When will you use OPEN and CLOSE opcodes in RPG program? A.The field definitions and descriptions are defined out side of the program in a externally described file. In fully procedural file the records will be read and processed in any order. Q.If you specify the letter "U" at columns 73 .What is the purpose of RTVMBRD command? .What is the function of SEU ? A.Enter UC in position 71-72 of F specs.Q. Q.74 in a file description specification indicating that user control on a file. Q.More than one secondary files are allowed in a program. Use OPEN and CLOSE opcodes in RPG program to open and close files. ? A.What is the difference between externally described file and program described file? A. Q. Q.Only one primary file is allowed in program.How many primary files allowed in a program? A.Screen Design Aid is used to create display files interactively. Q. Q.A utility for editing programming language source code.What is File Information Data Structure? A. The field definitions and descriptions are defined in side the program in a program described file.How can the user implicitly open and close the files in RPG program ? A.How many secondary files allowed in a program? A. Q.The status code.How many parameters can be defined in a RPG program. Hence we have to explicitly open and close the file in a program. the record being processed when the exception/error occurred or the record that caused the exception/error.In primary file the records will be read and processed from begining to end. Q. This order is not changed.

2: If the data area object not found.Define an Interactive Job? A.The sub system QINTER takes the job from the job queue and starts processing. 1. If the data area object found. 2.A user requests a job. we can find existence of object on the system. without waiting for the next input or output/input operation.What is the purpose of SFLFOLD and SFLDROP keywords? A.+ data extracted') ENDDO RTVDTAARA DTAARA(JBA001DT *ALL) RTNVAR (&FROMDATE) The execution of above steps is listed below: steps 1: First it checks the data area object on the system.The output generated by the interactive job is placed on the output queue 6. job attributes are assigned. With the help of CHKOBJ clp command.Job is placed on a job queue. Q.Use this record-level keyword to immediately display a record format.What is the function of DSPATR (display attributes) keyword? .What is the purpose of FRCDTA (Force Data) keyword? A.The spool sub system QSPL prints the output. Q. 5. 3.Job is created and job name. 4. Q. The usage of command in clp is as follows: CHKOBJ OBJ(JBA001DT) OBJTYPE(*DTAARA) MONMSG MSGID(CPF9801) EXEC(DO) CRTDTAARA DTAARA(QGPL/JBA001DT) TYPE(*CHAR) LEN(6) + VALUE('010196') TEXT('The last day that had job acct.How can you check the existence of object in a system? A.A. Q. It is always good CLP programming approach to check the object before you rename.SFLFOLD: To fold the second line of multiple line subfile. 2. 3. next we can dynamically create the data area. we can RTVMBRD command. the MONMSG command executes with the help of message identifier. delete the objects on the system. Q.In order to access the information related to member.SFLDROP: To drop the second line of multiple line subfile. 1. control transfers to statement below ENDDO.

You can specify the DSPATR keyword more than once for the same field. Q.CS Column separator .C KEY CHAIN FILE N 99. which is executed automatically at beginning of the program.HI High Intensity .What is *INZSR used for? A.What is the difference between array and a multiple occurrence data structure? A.To share the open data path by various programs in a same job.The values stored in array don t vary.0? A. Q.It is a good place to code initializes the variables. Q.By calling QCMDEXC application program interface we can execute a CL command with in an RPG program. C MOVE *ZEROS FLDA C Z-ADD *ZEROS FLDA C Z-ADD 0 FLDA C MOVE *ALL'0' FLDA C SUB FLDA FLDA C MOVE '0000' FLDA .What is the purpose of the "N" in the following calculation specification? A.RI Reverse Image . the record will not be locked if you try to read the locked record. It is a way of avoiding the record lock.ND Non Display PC Position cursor .A.UL Underline For Input-Capable Fields Only PR Protect contents of field from input keying MDT Set modified data tag when displayed OID Operator identification SP Select by light pen.It is special type of RPG/400 subroutine. In the other hand. and you can specify more than one attribute for the same keyword.If you specify 'N' in 53rd position.How can you execute a command from within an RPG program without calling a CLP program? A. The following are valid attributes: For All Fields Display .Attribute Meaning BL Blinking field . we can store the different values in same variables at various stages.Which of the following operations does NOT zero the field FLDA defined as 4.Define a shared access path? A.Use this field level keyword in display file to specify one or more display attributes for the field you are defining. Q. Q. Q.

With the help of File Information Data Structure. LIFO. . FCFO: The duplicate key records will retrieved in first changed first out order. we can check existence of records in a physical file. Through join logical file we can't made changes in physical file. Join logical file contains only one record format. Record format name in join logical file should be different.How can you check for a records existence without causing and I/O (CHAIN/READ)? A. Through logical file we can made changes in physical file. Q. LIFO: The duplicate key records will retrieved in last in first out order. The code is described below: In File description continuation line (IPFK).C CLEAR FLDA C MOVE *BLANKS FLDA The last instruction does NOT zero the field FLDA. Logical file contains more than one record format. KINFDS RCDS IRCDS DS I *RECORD #RCDS with the above code we can check the existence of records in a file without causing I/O operation. Distinguish between logical file and physical file? Ans:Physical file contains only one record format. Mainframe AS-400 Interview Questions Part 4 What the purpose of the keywords FIFO. Record format name in regular logical file should be same based on the physical file. What is the difference between regular logical file and join logical file? Ans:Regular logical file contains more than one record format. The purpose of each one is described below: FIFO: The duplicate key records will retrieved in first in first out order. FCFO? Ans:These keywords are used at file level.

which contains field definitions and descriptions. OPNQRYF creates temporary access path. the internal indicator MDT (modified data tag) is automatically set off by the system. Physical contains data derived by the field reference file. What is the necessary keyword used in a physical file to refer field definitions from the field reference file? Ans:REF which is a file level keyword is necessary to define at file level in a physical file. If you again perform read on the same records. Because internal indicator MDT would be off. What is field reference file? Ans:Field reference file is a file. What is the purpose of SFLNXTCHG keyword in a subfile? Ans:Which is a subfile record format keyword. Because access path maintenance performed on the file. * If the factor 1 is *NAMVAR then DEFN opcodes defines the field as a data area. But access path occurs before the file is read (but not necessarily). .Physical file contains actual data. The syntax is as follows: REF(library name/name of the field reference file) What is purpose of declarative statement DEFN? Ans:Depends on the factor 1 value it will do two things: * If the factor1is *LIKE then DEFN opcode defines the new field based on the attributes old field. What is the difference between access path and Dynamic select? Ans:Dynamic select occurs whenever the program reads file. Why would you prefer OPNQRYF than logical file? Ans:The main difference is : Logical file creates permanent object on the system. and it doesn't have member. If you perform read on the subfile. Logical file doesn't contains data but it provides view from the physical file. Hence you should be explicitly set on the MDT by SFLNXTCHG keyword. records won't be read.

What are the different types of access paths maintained on the file? Ans: Immediate: All the access paths (open and close) associated with a file will be updated whenever changes made to a file. Table: Table can be searched consecutively. Attributes like * Maximum number of members * Member size * Level check enforced * Open data path is shared How can you identify End of file in CLP program? Ans:With the help of MONMSG MSGID(CPF0864) we can identify end of file in clp program. What is the purpose of reorganizing the physical file i. Rebuild takes place whenever remaining access paths will be open. Table: Table is stored at the begining of the input records. Array: Array can be searched randomly. Array: We can access all the elements in array by specifying the array name. Rebuild. RGZPFM? Ans:Even if you delete the records in a physical file through the program. still the space used by the deleted records not used by the other purpose.only open access paths will update whenever changes made to the file. Delay : Rebuild will not takes place. . What is the purpose of CHGPF (Change physical file) command? Ans:CHGPF command is used to change the attributes of a physical file. Table: Only one table element can be accessed at a time. Hence using RGZPFM command we can compress the deleted records space.What is the difference between Array and Table? Ans: Array: Array is stored any where in the body of the input records. e. What is the difference between production library and test library ? .

In the other hand.How would you join 3 separate fields. Sale = 10% . the *INZSR will not execute again. The source code in CLP is given below: PGM DCL VAR(&VAR1) LENGTH(6) TYPE(*CHAR) VALUE('YYMMDD') DCL VAR(&RCVD) LENGTH(6) TYPE(*CHAR) DCL VAR(&VAR2) LENGTH(4) TYPE(*CHAR) DCL VAR(&VAR3) LENGTH(2) TYPE(*CHAR) CHGVAR VAR(&VAR2) VALUE(%SST(&VAR1 3 4)) CHGVAR VAR(&VAR3) VALUE(%SST(&VAR1 1 2)) CHGVAR VAR(&RCVD) VALUE(&VAR2 *CAT &VAR3) SNDMSG MSG(&RCVD) TOUSR(*USRPRF) ENDPGM Q. a first name.When PGMA calls PGMB for the first time PGMB executes the *INZSR. 00 b.OVRDBF with SHARE (*YES) 2.If you specify RETRN in called program.Ans:In debug mode.How would you design the process for a nightly. we can select the records from the data base file. middle initial and last name together as 1 field with proper spacing? A.DLTOVR 5.OPNQRYF 3.With the help of OPNQRYF Clp command. Q. PGMB uses the RETRN operation to return to PGMA. MarkUp= 05% d.Show 2 ways to convert a date from YYMMDD to MMDDYY (MULT operation not acceptable) A.CALL the program 4.You can describe in either RPG and/or RPG ILE (Integrated Language Environment) MOVE 'Dr. Tax = 20% c.Determine the value of the result field a. Cost = $110. Nov 13 2009 Mainframe AS-400 Interview Questions Part 5 Posted by admin in Untagged Q. the files exists in test library allowed to update. the files exists in production library not allowed to update. CVTDAT DATE() RTNVAR( ) FROMFMT( ) TOFMT( ) Source code is required to convert from one date format to another date format. high volume check producing process that needs to select only records that are flagged to be processed? A. The process involves following steps: Steps: 1. When PGMA call PGMB the second time is the *INZSR executed? A. ' FNAME 3 MOVE 'JOHN' MNAME 4 MOVE 'WATSON' LNAME 6 FNAME CAT MNAME: 1 VAR1 8 VAR1 CAT LNAME:1 VAR2 15 DSPLY VAR2 MOVE *ON *INLR Q.CLOF Q.

Query/400 is a licensed program that uses a query to analyze and select the information contained in the data base files and create a query report.The SETLL operation positions a file at the next record with a key or relative record number that is greater than or equal to key or relative record number specified in factor1.Output generated by the batch job is placed on an output queue.Describe about Query/400? A. Define the purpose of Factor 1 the Operation Code and *IN15 in following code HI LO EQ C *YMD Test(D) yymmddDate 15 If the factor 1 value matches with factor2 value.The job is placed on a job queue 4. QBASE. Q.The sub system QBATCH takes the job from job queue and starts it. QINTER. 1. 6.The job is created (job name is assigned.Job queues are queues of batch jobs waiting to be processed. A query report can be: 1. 5.stored in another database file.What is the function of CRTDUPOBJ command? A.The SETGT operation positions a file at the next record with a key or relative record number that is greater than key or relative record number specified in factor 1. Q. Q.What is the purpose of Level Check parameter in a Physical file? A.Define Subsystem? A. Q.Describe the function of SETLL operation in RPG language? A.What are different types of Substems? A. the indicator specified in EQ comes *ON. QCMN.displayed on a workstation (screen) 2.Subsystem is nothing but it provides specialized environment to complete the execution of jobs. Q. QSPL. Q.Define a Output Queue? A. Q.To copy the data from the one file to another.Define a Batch Job? A. Q. Q. 2.QBATCH.C Eval TotalCost = ((Cost * MarkUp) * Tax)) .Define a Job Queue? A.Describe the function of SETGT operation in RPG language? A. job attributes are allocated) 3.Sale = 1. Q.What is the function of CPYF command? A.A user request the job.A.printed 3. 0$ 40.What is the CLP command to access a Query/400? .The spool sub system prints the output on the output queue. Q.To create the replica from the original object. Q.Output queues are queues of jobs waiting to be printed.What is the function of CPYSPLF command? A. Q. QCTL.Specifies whether the level identifiers of the record formats in the physical file are checked when the file is opened by the program.It copies the spooled file to the data base file.

1. *PROGRAM. In fully procedural file the records will be read and processed in any order.The name of the file for which the error occurred b. Q. In the data area data structure. *OPCODE. *RECORD.WRKQRY Q. .Define an area of storage in more than one format 5. This order is not changed. Overrides gives you the flexibility to use existing model files and dynamically change their attributes. keywords including *FILE. Specifically.Data area data structure:When the data area is defined in an RPG/400 program as a data area data structure. Q. This type of data structure contains pre defined sub fields that identify a.The operation being processed when the error occurred d.File information data structure :A file information data structure provides exception/error information that may be occurred when processing a file during program execution. So you don't have to create permanent files for every combination of attributes your application might need. letter "U" must be entered to define the data structure as a data area data structure.The RPG/400 routine in which the error occurred. What is difference between fully procedural file and primary file? Ans:In primary file the records will be read and processed from begining to end.Program status data structure Program status data structure however identity exception/errors that are generated in the program by RPG/400 operations and not by a file.The record processed when the error occurred c.A.The status code number e. 1. Four keywords . 2. Hence we have to explicitly open and close the file in a program.The basic purpose of Overrides is to temporarily change the attributes of a file. Q. When will you use OPEN and CLOSE opcodes in RPG program? Ans:If you specify the letter "U" at columns 73 .Change the format of a field 3. *ROUTINE provide the previously named information. Exception errors may be controlled by testing for an error code in the *STATUS field which is included in a file information data structure. 3. Note that any code greater than 00099 is flagged as an exception/error. *ROUTINE.Define Multiple occurrences of data structures.Purpose of Overrides? A.What is the purpose of Data structure? A.Group non-contiguous data in a contiguous format 4. *STATUS. its data is implicitly retrieved for processing and written back at the end of the program.List and explain the different type of data structures? A.74 in a file description specification indicating that user control on a file. *PARMS are supported by a program status data structure.Define Data Structure? A.Data structures are specified in the Input specifications of an RPG/400 program to define an area in storage and layouts of related sub fields.Divide a field in to sub fields 2. The logic flow is controlled by the opcodes in RPG program.*STATUS.

How many secondary files allowed in a program? Ans:More than one secondary files are allowed in a program. * Job is placed on a job queue.What is the difference between externally described file and program described file? Ans:The field definitions and descriptions are defined out side of the program in a externally described file. we can find existence of object on the system. The field definitions and descriptions are defined in side the program in a program described file. What is the purpose of RTVMBRD command? Ans:In order to access the information related to member. How can you check the existence of object in a system? Ans: With the help of CHKOBJ clp command.+ data extracted') ENDDO RTVDTAARA DTAARA(JBA001DT *ALL) RTNVAR (&FROMDATE) . The usage of command in clp is as follows: CHKOBJ OBJ(JBA001DT) OBJTYPE(*DTAARA) MONMSG MSGID(CPF9801) EXEC(DO) CRTDTAARA DTAARA(QGPL/JBA001DT) TYPE(*CHAR) LEN(6) + VALUE('010196') TEXT('The last day that had job acct. * Job is created and job name. we can RTVMBRD command. * The sub system QINTER takes the job from the job queue and starts processing. * The output generated by the interactive job is placed on the output queue * The spool sub system QSPL prints the output. job attributes are assigned. How many primary files allowed in a program? Ans:Only one primary file is allowed in program. Define an Interactive Job? Ans:* A user requests a job.

Attribute Meaning BL Blinking field . What is the function of DSPATR (display attributes) keyword? Ans:Use this field level keyword in display file to specify one or more display attributes for the field you are defining. next we can dynamically create the data area. If the data area object found. and you can specify more than one attribute for the same keyword. You can specify the DSPATR keyword more than once for the same field.The execution of above steps is listed below: steps 1: First it checks the data area object on the system.CS Column separator . What is the purpose of FRCDTA (Force Data) keyword? Ans:Use this record-level keyword to immediately display a record format. 2: If the data area object not found. delete the objects on the system.HI High Intensity .ND Non Display PC Position cursor . It is always good CLP programming approach to check the object before you rename.RI Reverse Image . without waiting for the next input or output/input operation. What is the purpose of SFLFOLD and SFLDROP keywords? Ans: SFLFOLD: To fold the second line of multiple line subfile. 3. The following are valid attributes: For All Fields Display . control transfers to statement below ENDDO. the MONMSG command executes with the help of message identifier. SFLDROP: To drop the second line of multiple line subfile.UL Underline For Input-Capable Fields Only .

. 2. 3. Physical contains data derived by the field reference file. Q. creating and using a logical file will allow an application to perform faster than using an open query file.Record format name in regular logical file should be same based on the physical file.Regular logical file contains more than one record format. it selects the records from the specified file.Record format name in join logical file should be different. Q. Q. 5. If you specify this in a file level.Dynamic select occurs whenever the program reads file.PR Protect contents of field from input keying MDT Set modified data tag when displayed OID Operator identification SP Select by light pen Nov 13 2009 Mainframe AS-400 Interview Questions Part 6 Posted by admin in Untagged aQ. 6.FCFO: The duplicate key records will retrieved in first changed first out order.Logical file doesn't contains data but it provides view from the physical file. FCFO? A. Q. OPNQRYF creates temporary access path.What is field reference file? A. the system doesn't perform record selection until the program reads file. Q. Since access paths created by open query files are temporary.Field reference file is a file. Q. 4.Join logical file contains only one record format. Q.What is the difference between regular logical file and join logical file? A. 2.Physical file contains only one record format.Distinguish between logical file and physical file? A.When would you prefer logical file than OPNQRYF? A.The physical file you are working with very large. Then on the Select/Omit criteria. 1. which contains field definitions and descriptions.This is a file level keyword used in a logical file. But access path occurs before the file is read (but not necessarily).Physical file contains actual data.What the purpose of the keywords FIFO.What is the difference between access path and Dynamic select? A. 3. and it doesn't have member.LIFO: The duplicate key records will retrieved in last in first out order.FIFO: The duplicate key records will retrieved in first in first out order. since the access path will not have to be rebuilt every time the file is open.Through join logical file we can't made changes in physical file. The purpose of each one is described below: 1.Why would you prefer OPNQRYF than logical file? A. applications that use an access path frequently will be more efficient using a logical file. 1.Logical file contains more than one record format. 2. Because access path maintenance performed on the file.Through logical file we can made changes in physical file.These keywords are used at file level.The main difference is : Logical file creates permanent object on the system. LIFO.What is the purpose of DYNSLT keyword? A.

Table: Table can be searched consecutively.REF which is a file level keyword is necessary to define at file level in a physical file.With the help of MONMSG MSGID(CPF0864) we can identify end of file in clp program.If the factor1is *LIKE then DEFN opcode defines the new field based on the attributes old field.Message subfile is special file contains multiple messages taken from program message queue and placed in message sub file for display on the screen. . If you perform read on the subfile. Q.If the factor 1 is *NAMVAR then DEFN opcodes defines the field as a data area. Array: Array can be searched randomly. Q.Immediate: All the access paths (open and close) associated with a file will be updated whenever changes made to a file. Attributes like 1. Hence using RGZPFM command we can compress the deleted records space. Q. SFLMSGKEY.Which is a subfile record format keyword. e. records won't be read.How can you identify End of file in CLP program? A.What is the difference between production library and test library ? A. Because internal indicator MDT would be off. Q. RGZPFM? A. 3. 1.CHGPF command is used to change the attributes of a physical file. Rebuild takes place whenever remaining access paths will be open. If you again perform read on the same records.only open access paths will update whenever changes made to the file.Member size 3. Q. Hence you should be explicitly set on the MDT by SFLNXTCHG keyword. SFLPGMQ Q.Maximum number of members 2. The syntax is as follows: REF(library name/name of the field reference file) Q. the internal indicator MDT (modified data tag) is automatically set off by the system.Even if you delete the records in a physical file through the program.What is the purpose of SFLNXTCHG keyword in a subfile? A. Table: Only one table element can be accessed at a time.Delay : Rebuild will not takes place.What is the purpose of reorganizing the physical file i. still the space used by the deleted records not used by the other purpose. 1.What is the necessary keyword used in a physical file to refer field definitions from the field reference file? A.What are necessary keywords to code message subfile? A.What is purpose of declarative statement DEFN? A. Q.SFLMSGRCD.Open data path is shared Q.Q. Array: We can access all the elements in array by specifying the array name.What is the purpose of CHGPF (Change physical file) command? A.Depends on the factor 1 value it will do two things: 1.In the other hand.What are the different types of access paths maintained on the file? A. the files exists in test library allowed to update. Q.What is message subfile? A.What is the difference between SETON LR and RETRN? . 2. Q.Array: Array is stored any where in the body of the input records. 2.Rebuild. the files exists in production library not allowed to update.Level check enforced 4.What is the difference between Array and Table? A. Table: Table is stored at the begining of the input records.In debug mode.

Q. Q.A user requests a job. next we can dynamically create the data area.Only one primary file is allowed in program. 3.If you specify the letter "U" at columns 73 . The logic flow is controlled by the opcodes in RPG program. The field definitions and descriptions are defined in side the program in a program described file. 3. The usage of command in clp is as follows: CHKOBJ OBJ(JBA001DT) OBJTYPE(*DTAARA) MONMSG MSGID(CPF9801) EXEC(DO) CRTDTAARA DTAARA(QGPL/JBA001DT) TYPE(*CHAR) LEN(6) + VALUE('010196') TEXT('The last day that had job acct.The field definitions and descriptions are defined out side of the program in a externally described file.What is difference between fully procedural file and primary file? In primary file the records will be read and processed from begining to end.How can you check the existence of object in a system? A.+ data extracted') ENDDO RTVDTAARA DTAARA(JBA001DT *ALL) RTNVAR (&FROMDATE) The execution of above steps is listed below: steps 1:First it checks the data area object on the system. control transfers to statement below ENDDO. 2:If the data area object not found. Q. Q. all the files used in program will be closed.When will you use OPEN and CLOSE opcodes in RPG program? A. 5.How many primary files allowed in a program? A.Define an Interactive Job? A. job attributes are assigned. Mainframe AS-400 Interview Questions Part 7 . Hence we have to explicitly open and close the file in a program.In order to access the information related to member.With the help of CHKOBJ clp command.More than one secondary files are allowed in a program.In fully procedural file the records will be read and processed in any order. we can RTVMBRD command. Q. If the data area object found.The output generated by the interactive job is placed on the output queue 6.How many secondary files allowed in a program? A.Job is placed on a job queue. 4. Q.Job is created and job name. Q. delete the objects on the system. we can find existence of object on the system. It is always good CLP programming approach to check the object before you rename. Q.What is the purpose of RTVMBRD command? A.74 in a file description specification indicating that user control on a file. This order is not changed.If you specify SETON LR. 2.A. 1.The sub system QINTER takes the job from the job queue and starts processing. all the files used in program will remain open.If you specify RETRN.The spool sub system QSPL prints the output. the MONMSG command executes with the help of message identifier.What is the difference between externally described file and program described file? A.

1024 (One thousand and twenty four) Q.What is the maximum number of parameters allowed in RPG? A.43 (Forty three) Q.What is a Non-join logical file? A.What is Join Logical file? A.SFLDROP: To drop the second line of multiple line subfile. This is also called as regular logical file.It is nothing but a logical view provided by the physical file.Join logical file joins more than one file.Use this record-level keyword to permit the override of either display file attributes or data contents of specific fields within a record displayed on the work station device.What is the purpose of FRCDTA (Force Data) keyword? A. JREF.What is the maximum number of parameters allowed in CLP? A. Q. 1. JFILE. The maximum of number of files allowed to join is 32 (thirty two).Use this field level keyword with PUTOVR keyword to override the existing the data contents of a field already on the display. 2.What is the maximum number of record formats in DSPF? A.It only provides logical view based on the physical file. Q.What is the purpose of SFLFOLD and SFLDROP keywords? A.What is the maximum number of subroutines allowed in RPG? A.What is a Logical file? A.JDFTVAL.Q.255 (Two hundred and fifty five) Q.What are the necessary keywords for the Join Logical file? A.254 (Two hundred and fifty four) Q.What is the maximum number of fields under a record format of physical file? A.8000 (eight thousand) Q. . without waiting for the next input or output/input operation.Use this record-level keyword to immediately display a record format. JOIN. Q. Q.What is the purpose of OVRDTA (Override Data) keyword? A. Q. JFLD. Q.SFLFOLD: To fold the second line of multiple line subfile. Q.What is the purpose of PUTOVR (Put with explicit override) keyword? A.

It only shows a data from table while Index has a Indexing Data for a sequence on which Index is created.Simple / Serial Cursor a.View will not any data. Constraints like PRIMARY KEY.Scrollable Cursor which is defined with SCROLL key word.Rows of cursor can be fetched many times c.Yes.Difference between View and Index ? A.By adding Referential Integrity Constraints to a Physical file or Logical file.Cursor defined with SCROLL key word b.FLD1 IN (SELECT FILE2.How many levels are there in a Physical file? Four levels. NEXT. Key field level.What is the sequence when using CURSOR? A.How do you achieve referential integrity? A.Close Cursor Q.Different type of Cursor? A.For serial cursor each row is fetched only once per OPEN c. RELATIVE) Q.Fetch record 5. the cursor is positioned to the row of the table that is specified by the POSITION option. Record level. ETC.Can we have records (with fields from more than one file) from multiple files and Nested / sub query in SQL ? A. d..Q. . a. They are File level. d. DELETE RULE. we can have record from multiple file with join condition and we also can have nested query or subquery like SELECT * FROM FILE1 WHERE FILE1.When it is opened it is positioned before the first row in the table.PFILE (which is record level keyword) Q. PREV. Q. (FIRST.What is the necessary keyword for Non-join logical file? A.To use serial cursor we have to re-issue OPEN 2. LAST. FOREGIN KEY.When the FETCH is issued .FLD1 FROM FILE2) Q.Declare Cursor 3. 1.Two types of Cursor 1.Define Cursor 2.Open Cursor 4. Q. View is similar to Logical file without having Key and Index is similar to Logical File having Key (as keyed logical file has access path data) Table is similar to PF. Field level.A serial cursor is one defined without SCROLL key word b.When it is opened it is positioned before the first row in the table.Processing 6. UPDATE RULE.

A referential constraint is being added 2.A stored procedure is a program that can be called to perform operations that can include both host language statements and SQL statements.If we want to have a look where the stored procedure. Type of Update rule (UPDRULE) 1.Commands are ADDPFCST for Physical file and ADDLFCST for Logical file.Deleting a record in a parent file is permitted if data for a non-null parent key does not match data for a foreign key. Stored procedures can be used in both distributed and non-distributed applicaitons. A.PRIKEY .RESTRICT ± a. a common piece of code need only be written and maintained once and can be called from several programs. 3.It is defined using DECLARE PROCEDURE statement. b. we can have a look through SQL.REFCST .Deleting a record in a parent file is restricted if data for a non-null parent key matches data for a foreign key. Q. b. That is.NOACTION ± a.A unique constraint is being added. Procedures in SQL provide the same benefits as procedures in a hot language. 3.Updating a record in a parent file is permitted if data for a non-null parent key does not match data for a foreign key.What is the stored procedure and how do you define a stored procedure. Q.Deleting a record in a parent file is restricted (does not occur) if data for a non-null parent key matches data for a foreign key. syntax is as below« EXEC SQL DELCARE P1 PROCEDURE .NOACTION ± No Action 2. 2. A.RESTRICT ± a. Deleting a record in a parent file causes matching records in the dependent file to be deleted when data for a non-null parent key matches data for a foreign key.A primary key constraint is being added 4. b.CHKCST .A check constraint is being added Type of Delete rule (DLTRULE) 1.Type of constraints 1.UNQCST .Deleting a record in parent file is permitted (not restricted) if data for a non-null parent key does not match data for a foreign key.Updating a record in a parent file is restricted if data for a non-null parent key matches data for a foreign key.CASCADE ± The cascade delete rule is used.Where Stored procedure lies in the system.

Procedure Prototype In this section we specify the name of the procedure along with PR. D PROC1 PR Procedure Interface It is section where we define all the parameter which are receiving or returning some values. What is Procedure Prototype and Procedure Interface. D PROC1 PR Then define Procedure with Begin/End Procedure Name Begin/End P PROC1 B Export Then define Procedure Interface along with parameter and PI D PROC1 PI 5 0 D PARMA 5 0 D PARMB 5 0 Define all the parameters as a variable to the procedure D PARMA S 5 0 D PARMB S 5 0 In not returnable procedure.FLD1 = FILE2.What is Procedure ? A.How to define a procedure ? A.FLD1 Using Nested Select statement SELECT * FROM FILE1 WHERE FILE1.First we have define Procedure Prototype along with all parameter.(:PARM1 INOUT CHAR(10)) (EXTERNAL NAME MYLIB/PROC1 LANGUAGE RPGLE SIMPLE CALL WITH NULLS). Using Single statement. . Language can be RPGLE.A procedure is the set of self contained high level language statements that can perform a particular task and then returns to a caller. etc. Q.FLD1 EQ (SELECT FILE2. MYLIB/PROC1 this PROC1 is a program written and compiled separately and it is of language which you are specifying in section LANGUAGE. FILE2 WHERE FILE1. END-SQL We can have parameters as IN . INOUT type. CL.FLD1 FROM FILE2).. Mainframe AS-400 Interview Questions Part 8 Q. A. C. And PR. it should end with C RETURN PARMA + PARMB 671. Q. OUT .Writing an SQL statement from selecting records from TWO files using single statement and Nested select statement. the procedure should end with C PROC1 E In returnable procedure. SELECT * FROM FILE1.

Q.How to validate input values in Display file ? A.It allows a record format to be displayed on screen retaining the previous displayed record formats.System defined message is displayed which may not be user friendly. In many respects it is similar to a subroutine library and procedure library.It does not contain a program entry procedure. we have to reset it. RANGE. This means that you cannot call a service program using the CALL operation.To overcome above disadvantage validations is done within program and user Q.2.How to avoid using indicators in ILE ? A.What is OVERLAY? A. 5.2. 1.If invalid values are entered.We can not trace out at which point the value of variable is changed. EDTCDE cannot be applied to Character filed.%EOF. NOT %BOF etc. While command function key passes indicator status as well as a data from screen to program.RSTDSP is a parameter to be specified at compile time for display file. And a Program Queue.What are the important factors in Error message subfile ? A. EDTCDE(Z) for suppressing the leading zero Y for date field. Q. Q. Q. And EDTCDE has some Codes pre-defined for example. NOT %EOF.If we tried to move year part of *ISO date into a field of length 3.How to define Global Parameter in ILE ? A.A Service Program is a collection of runnable procedures and available data items easily accessible by other ILE programs.We must define error message record format (SFLMSG).Keyboard is locked.What is EDTCDE and EDTWRD ? A.What key word is used when screen is re-display? A.What are the disadvantage of using Validity Check keyword? How to overcome these disadvantages ? A. 2. Q.Declare a variable with key word EXPORT and while using this variable in anther program declare with IMPORT keyword.YYYY-MM-DD for other formats refer to IBM manual or ERIS document. 3.The option filed is displayed in reverse image.with the help of Validity check key words VALUE.Program crashes. what will happen ? A.A service program is bound into a program or other service programs using binding by reference. .What is Service Program? A. EDTCDE & EDTWRD are key words used for formatting purpose. Q.Display / Printer File Q.What is the disadvantage of using Global variable? A. Q.EDTWRD can be used to define user defined formatting for a fields. 2. (PGMQ) and Record format is associated to a line number.Command Attention key and Command Function Key ? A.With the help of Command attention key we can pass only the indicator status to program not the data from screen.What is *ISO date format? A. Q.By using the standard Built In Expressions like %FOUND. 4. Q.A service program differs from a program in two ways: 1. COMP Q.D PROC1 PI 5 0 D PARMA 5 0 D PARMB 5 0 Q. as in case of *ISO format it required fields of 4. %BOF.

*PSSR BEGSR .What is the values SQLCOD when there is an error in fetching the records specified in the select statement? A. Q. ENDSR .Journaling & Commitment Control.Which CL command is used to trap error messages during program execution? A.What do we can do with the Embedded SQL statements? A.Which of the CL command can be used to determine which logical files are dependent on a specific file? A.5 1 .We can Insert/Update/Delete records. record already locked.e. here we need to define a field to get row and column.8 Character *FILE The first 8 characters of the file 9 .10 Character End of file (1 = end of file) 11 .A program variable coded in an Embedded SQL statement is referred to as? A. 16 .With the help of RTNCSRLOC keyword.Which CL command can be used at program execution to redirect the file named in an RPG program? A.15 Zoned dec *STATUS Status code.Q.37 Character RPG IV source listing line number Q.How to determine if the record is in used by another user ? A.9 Character Open indication (1 = open). Q.21 Character *OPCODE Operation code The first five posi 22 .It just similar to any other subroutine.Default 32 & for Decimal 15.OVRDBF Q.DSPDBR Q.How to write *PSSR ? A.Which are the DB2 tools to protect Integrity of the database? A. Referential Integrity Embedded SQL & Object/Record Locks. Q.0 fixed We can specify *FILED for filed *REC for Record on which a key is pressed. fetch values from records into variables.We can determine weather a record is in use bye another user with the help of status code (*STATUS).What is a Journal? A.MONMSG Q.A file cannot have more than 1 unique key? A.False Q. 10 .Host Variable Q.How to define to define a Hidden filed in DSPF ? A.How To get the cursor position? A. Q. fetch records. If *STATUS = 01218 i.29 Character *ROUTINE First 8 characters of the procedure 30 .(H) Q.What is the length of the variable in the given example? DCL VAR (&Name) TYPE (*Char)? A. Length of variable should be 5.Define a filed in a DSPF of use HIDDEN.-ve value Q.DLCOBJ command is mandatory for removing lock on any object? A. Q.False Q.A Journal is an object used primarily to record changes to data in a PF.

SD .NP . An MDT is set ON. 8.VF .A service program is bound into a program or other service programs using binding by reference .Nov 13 2009 Mainframe AS-400 Interview Questions Part 9 Posted by admin in Untagged Q.SKIPA.A service program differs from a program in two ways: 1.What is procedure? A.SFLRCDNBR will give the RRN of the First record displayed on the screen at a given time. SFLCTL. If an indicator is associated with SLFNXTCHG and it is SETON then READC will read only the changed record. 1. And if the indicator is not associated and it is seton it READC reads all the records from sub-file Q. 4.Is module executable A. 3.CLC .DC .DSPFD Q. Whenever a record is changed on display file. 2. 7.View Fields.Change Line for Record.Mandatory keywords of sub file A.STRRLU. SPACEA & SPACEB. 6.Difference between SFLRCDNBR and SFLNXTCHG A. SFLPAG are the mandatory key words Q.Space Fields evenly.What are the different commands used in RLU ? A. This means that you cannot call a service program using the CALL operation.CLR . Q. 5.SP .No You need to create an RPG prog to run the module Q.Define Fields 9.DSPDBR Q.New Page.Define Constants. Q.DF .Change Line for Continuation.How can u check no of records in a file A.How can see logical file based on which physical file and vice versa A.How do u compile RPGLE program A.Either thru 15 or crtrpgmod Q.What is service program? A Service Program is a collection of runnable procedures and available data items easily accessible by other ILE programs. SKIPB.Define Record. SFLDSP.What are different record spacing keywords in RLU ? A. SFLSIZ.A procedure is the set of self-contained high level language statements that can perform a particular task and then returns to a caller Q.Create Sample Data.CF .What is the command used to invoke RLU ? A. 2.It does not contain a program entry procedure. Q.Centre Fields 10.SFL. In many respects it is similar to a subroutine library and procedure library.DR .

It is also used to monitor user message. printer files you can describe in a RPG A. Command associated with OPNQRYF is CPYFRMQRYF to save the output permanently. Q.50 files and 8 printers Q. Q.It is file which contain messages created by the user through which a user can display own message while validating.Q.SUBFILE DISPLAY (SFLDSP) SUBFILE DISPLAY CONTROL (SFLDSPCTL) SUBFILE CLEAR (SFLCLR) SUBFILE SIZE (SFLSIZE) SUBFILE PAGE (SFLPAGE).It is Dynamically creation of access path.What is LOKUP opcode? Look s for a particular element of an array Q. Q.by using FNDSTRPDM.What is OPNQRYF.What does DEFN do? A.What is ELASTIC and NON ELASTIC SUBRILE? A. Q. Q.When subfile size is greater then subfile page size it is called elastic subfile and when subfile size is equal to subfile page size it is called non-elastic subfile.How will you find a string using PDM? A.How will you add a field to physical file already containing data? A.What are DDS required for SUBFILE? A.What are the different types of arrays? A.Compile time gets populated at the time of compilation. Q. Distinguish between terminating a program through SETON LR and RETURN? A.*PSSR defining it in F spec Q.It is a CL command to monitor and error/exception message so that in case of an error a dump is avoided and the control is in program.By defining UC in file condition and to opening the file mention OPEN opcode and closing the file by mentioning CLOSE in opcode of C spec. . if the expression is A = B + C then B and C are from the file while A is defined in OPNQRYF.SETGT.LR closes all the files used in the program and RETURN is used to return the control to the parent program.How will I explicitly open a file in an RPG program? A. Q. Q.How will you search an array? A.It is used to define a field based on the value specified in FACTOR 1.Preruntime gets populated at the time input.LOKUP Q. FACTOR2 and RESULT field for the RPG operation code PARM? A.What is message file? A.How do you set pointers to values 55 or next higher or greater? A.SUBFILE RECORD FORMAT and SUBFILE CONTROL RECORD FORMAT.How many files.How do handle file exception/error A.It is add value of FACTOR1 to FACTOR2 or compare the value of FACTOR 2 with FACTOR1.With CPYF command and *NOCHK & *DROP Q. Q. and it can have resultant fields i. We can divert the output of command to an OUTFILE. MONMSG commands A.What are two types of record are used in subfile? A. Runtime gets populated at the time execution.What are the uses of FACTOR1.*INFDS . Q.e. Q.

By using keyword SFLRCDNBR. Nov 13 2009 Mainframe AS-400 Interview Questions Part 10 Posted by admin in Untagged Q. Q.Why do we use READC? A.Q.It is used to execute a single CL command within the RPG program.By using opcode XLATE. Q.40 . Q. Q.What is SFLINZ and SFLRNA? A. SFLRNA stands for subfile record not active (It means records are there in the subfile but active). Q.How you will find an error which is not in the first page of the subfile without using ROLLDOWN key? A. Q.Yes by using the keyword SFLINZ and SFLRNA.How many maximum parameters can be passed from on RPG program to another CL program? A.9999.SFLINZ stands for subfile initialize. Q.255 Q.What is QCMDEXC? A.By using the keyword SFLCUSRRN (Subfile cursor relative record number).How you will know whether you are in SFLDROP or SFLFOLD mode? A.How do you read changed records backward in subfile? A. It initialized all the character field as blanks and numeric fields as zeros.By using this keyword you can tell system to roll on of records when the user presses ROLLDOWN key (For this you define a hidden of 4 byte).By using the keyword SFLMODE.What are the maximum parameters can be passed from one RPG program to another RPG program? A. Q. Q. Q.There are 10 to 50 level of security on AS/400.How to translate field values form lower case to Upper case? A.What is maximum size of data area? A. If you validate a record in subfile on some condition all the invalid records can display in reverse image.How you get the relative record in a subfile in which cursor is located? A.SBMJOB.Can you display a empty subfile? A. Q.What is SFLROLVAL? A. Q.NOT POSSIBLE.What is SFLNXTCHG? READC is to read those records which have changed in the subfile. The records have read even it has not been changed due to SFLNXTCHG.How to fire a JOB? A. The first which have changed and made valid and released still displaying in reverse image.How many levels of security are there on AS/400? A.

Q. and Deleting the existing records). Q. Q.What are the three levels of SDA? A. Adding new record.How do you monitor message in CL? A.How many maximum arrays can be used in a single RPG program? A. SNDRCVF. Q.8 Q.What is the full for of CA and CF? A.What is maximum size of a subfile? A.Can you add a record to a physical file through CL? A. Field level.We can write a Physical File from O spec.9999.How many maximum loops can be used in a single RPG program? A.Why do we define MOVE *ON *INLR? A.How do you write and read a value (similarly as EXFMT of RPG) using a display file in CL? A.100 Q.Difference between WRKUSRJOB and WRKACTJOB? A. Q.Can you update a file in CL? A.NO Q.Monitor the message ID (CPF0864).Q. Q. Q. Q.All the jobs in WRKUSRJOB are seen including Active jobs where as in WRKACTJOB only active jobs are seen.What opcode is used for submit job? Why it is used? A.By using monitor message ID: (MONMSG MSGID (CPF0000) Q.SBMJOB opcode is used and it is used for background processing. All the fields and parameters in the memory will become blank. Q.What is *PSSR? A.What is a subfile? A.What is the maximum length of an OCCUR? A.How do you display a screen in CL? A.Except report design what else can be done by O spec? A.How many maximum printer files can be used in a single RPG program? A. Q. Q.200.Command Attention and Command Function. Q. Modifying the existing record.It frees the memory.Subfile is a group of records which can be used for (Displaying.File level.NO. Q. Q.How to check end of file in CL? A.It is a system subroutine which is executed by default when any error occurs in a program.SNDF. Record level.9999. .

Data Description Specification. PFILE. . Q. Q.WRKACTJOB or WRKSYSSTS. Logical file can contain more than one record format.Some more pending jobs might be there in Job Queue.What is the use of SDA ? A. deleting. 1.reading input (READ) 2. an RPG/400 program automatically follows a sequence of operations for each record that is processed.Screen Design Aid is used to create display files interactively. 2. How many record formats can you have in a Physical file and in a Logical file ? A. etc. CLP.Library list that indicates libraries used for the process and the order in which it has to be searched. Q.A utility for editing programming language source code. scanning.Source Physical File contains the source for the various objects created.Physical file can contain only one record format.What is a library list ? A.Productivity tool for copying. Q. QUSRTOOL. 1. QRPG & QCBL.GPL. REFFLD Q.Q. Q. QSYS. Q.What is the function of SEU ? A.Change the priority or change the job queue name. Q.writing output (WRITE) Q. Q.How to see the CPU usage? A. This file has a specific structure.If your workstation does not show login screen what might be the problem? A. where as Logical file serves as a access path to database. A-spec UNIQUE.PWRDWNSYS. Q.How many libraries can be there in a library list ? A.processing calculations (PROCESS) 3. Q.Library in AS/400 is an object that serves as a repository for other objects.What is a library in AS/400 ? A. System identifies it in *LIBL. DSPF. QTEMP.Explain the sequence of execution of an RPG/400 program? A. RPG.You have given a job for printing and you are not getting the printout what might be the reason? A. Q.Name few IBM supplied libraries ? A.DDS .Total 40 (15 system and 25 application).Records with duplicate key values are not allowed. The built-in program cycle includes the following logical steps.How do you shutdown your IBM server? A. Q.During execution. changing & creating source files. PRTF.There are multiple jobs for printing in job queue and you want to print a important document then what will you do? A.What is the Function of PDM? A.Physical file contains data.Problem with some subsystem. Q.What is the difference between Physical and Logical files ? A.What does the keyword UNIQUE mean ? A.

What is a trigger? A.'+'. Q.How do you place or remove locks on the objects? A. Data Queue. .6 (max) Q. Q.What are the 2 types of lines on O Specs? A. *DATE.Some of the object types on which locks can be allocated? Data Area.What is the symbol used for copying & moving new field in SDA? A.Copying : '-' & '=='.Screen Design Aid.What is the symbol used for shifting fields in SDA? A.How can we know the triggers associated with the PF? A. Q. File. It provides the interface between output queue s Spooled files & the printer.Does the SETLL & SETGT retrieve the record? A. Moving : '-' & '='.DSPFD with parameter TYPE (*TRG) Q.What is the symbol used to get name & length of a field in SDA? A.What does print writer do? A.Record Identification Line & Field Identification Line. *TIME.They are the holding areas that store printed output generated from Batch programs or Interactive applications.It is a system job that selects files from the output queue & prints Them on a printer. Q. Library. Q.How many triggers can be associated with a single PF? A.No.What is the opcode to release all the locks on a particular PF? A.A trigger is an action that automatically occurs whenever a change Is made to a physical file.Can a Subroutine contain another Subroutine? A.What is an Output Queue? A.What is the symbol used for defining a new field in SDA? A.UNLCK Q. Q.'?' .Q.*AACOBJ & *DLCOBJ Q. Message Queue. Q. Q. Menu &Program. Q.ADDPFTRG & RMVPFTRG Q.How can we add & remove trigger to a PF? A.''. they simply position to the record. 2009 Mainframe AS-400 Interview Questions Part 12 Posted by admin in Untagged Q.No. Q.What does SDA stands for ? A.

Q.WRKSPLF .The LF is associated with how many PF s? A. Q. Q.TABMT 1 12 2 A Where 1 = Number of entries per record 12 = Total number of entries 2 = Length of each entry A = Ascending Sequence.Spool Files.A table is collection of data elements in one column.Compile Time Table.What is the command to create PF? A. Q. Q.The command to display a list of spooled files? A. Q.What is a table? A. it is placed into an? A.At least one PF at a time.F6 Q.The Member type for an RPG & CL program which SEU supports is? A.Data from a separate disk file is loaded into a table each time the Program runs.The members in LF contain? A.Access Path.The Qualified name for an object ORDPF residing in a library TRAINING is? A. Q.The members in a Source Physical File contain? A. the data elements must be of same Length and same type. Q.What is an Array? A.What is a Compile Time Table? A. The members in a PF contain data? True/False) A.We can hard code data within the program is said to be Compile Time Table.True Q.What is Alternate Table? A.OUTQUEUE Q.RAINING/ORDPF Q.DSPLIBL Q.When a spooled file is created. Q. Q. Q.CRTPF Q. To store information in multiple columns.Printed output items placed in an output queue are known as? A. it uses the concept of Alternate Table. Q. data elements Must be of same type and same length.Give the Table definition? A.What is the command to view the library list? A.Source statements for a program.RPG tables stores information in 1 column.Array is a collection of data.If the data is likely to change over a period of time & Moreover data is large than which type of table is preferred? A.What is a Run Time Table? A.The function key to start SEU session through program development manager is? A.RPG & CLP Q.

While designing the report using RLU user wants to add record level keywords which function key is pressed? A.Q.F10. which function key should be pressed to get the field from the FRF? A.A PF can have how many record formats? A.False Q.Add.Only one Q. Which function key should be pressed to define hidden field while you are working with SDA? A.From WRKMBRPDM screen you have to modify existing member-using SDA which option do you select? A.F14 Q. Current library Q. Library QGPL.DSPCURLIB Q.Member Type Q.Both are same.Using DFU user can do which operation? A. Update & Select fields Q.Which one of the following has the highest priority Library on top of the library list.F11 Q. only difference is DFU program allows you to add & update selected fields.If user wants to center the company name on his report then which command will be used? A.CF (Center Field) Q. Q. Q.SEU shows prompt/syntax checking according to? A.While designing screen F3 function key is kept common for all record formats on which level should it be defined? A.Which function key should be pressed to watch all string defined on SDA screen? A.Using Query it is possible to create level break report? A.While designing the screen using SDA. Library on the bottom of the library list & Current library? A.If user wants to add one field on the report then which function key is pressed? A.Write system defined function used to place system name on the screen? A.Change in the externally described file does not require recompilation of the program? (True/False) A.YES Q.What is the difference between UPDDTA to PF & updating using DFU? A.It is possible to run Query using RUNQRY command? A.While designing the screen user wants to add file level keywords then which function key is pressed? A.File level .*SYSNAME Q.F4 Q.Command to display current library is? A.F18 Q. Q.17.F20 Q.YES Q.

RLU: If user wants to define new numeric field on record format then which line command will be used? A.Maximum report length is 132.F10 Q.17 Q. F3 function key is kept common for all record formats. user wants to add record level keyword then which function key should be pressed? A.F14.Which function key should be pressed to watch all strings defined on the SDA screen? A. which function key should be pressed to get the field from the field reference file? A. Q. then which function key should be pressed? A.From work with member using PDM screen you have to modify existing member using SDA. which option do you select? A.If user wants to change the length of the numeric field defined in the report then which combination of the keys will be used? A.F18. Q.VF Q.F23 & F10 Q. Q.SKIPB (2) skips 1 page & on the next page after skipping 2 lines space print next while SPACEB (2) skips 2 lines space before printing. .FALSE (Maximum is 378) Q.F4 Q.File Level Q. if user is designing a report using RLU? A.While designing the screen user wants to add file level keywords.F20 Q.F11.If user wants to add one field on the report then which function key should be pressed? A.DFT (Default)s Mainframe AS-400 Interview Questions Part 13 Q. On which level should it be defined? A.To change constant field defined on RLU screen which field level keyword should be used? A.Q.What is the difference between SKIPB (2) & SPACEB (2)? A.While designing the report using RLU.Which Function key should be pressed to define hidden field while you are working with SDA? A.While designing the screen using SDA.While designing the screen.

If user wants to change the length of the numeric field defined in report then which combination of keys will be used? A.RLU: Which field level keyword should be used to change any numeric field of length 8 to 99. Q. .What¶s the use of STRPDM? A.What is Library? A.There are 3 types of libraries on As/400 they are System (*sys).What is the difference between normal UPDDTA to PF and updating using DFU program? A.Difference between Source Physical File & Physical File? A. Q.99.*PF/SRC Physical File: . User (*test) & Product (*prod).A job¶s library list defines the path of libraries that the job follows when trying to locate programs.DFT Q.What is Library List? A. . Q.F23 & F10.A library is a system object that serves as a directory to other objects or collection of object Q.VF. Q. µ) Q.RLU: If user wants to define new numeric field on record format then which line command will be used? A.CF.Both are same only difference is DFU allows you to add or change selected fields.Types of Libraries on As/400? A.Source File: .To work with Libraries.To change constant field defined on RLU screen which field level keyword should be used? A. Q.Q.Maximum report length is 132. Q. if user is designing a report using RLU? A.EDTWRD (µ . Members & User Options. which contain data. Objects.Type of Source File & Physical File? A.If user wants to center the company name on his report then which line command will be used? A. Q. Q.FALSE (378 Max).9999 format? A. files or other As/400 objects.*PF/DTA Q.Source Physical File contains members who contain source statements & Physical File contains members.

Verb Object Qualifier Verb: . Q.Writing header information.*File Q.Can a Join Logical File be updated? A.DSPFD (F4) *ACCPTH(Access Path). Q.What is externally described file? A. which purpose is H Specs used? A.What is the size of the filename in RPG? A.By defining the unique key. Q. Q. Q. U (Update) & C (Combine).A file.No. . Q. LF.What is the command to know key fields of file? A.ASPDBR (Display Database Relationship) Q. currency symbol etc. Q. date separator. is called as external described file. which is created externally & described in the program.Which path a good programmer should use? A.8 Characters (Max. Q.What is the command to know how many LF are related to a PF? A.In which Specs can PF be made internally? A.In I Specs.For.What is the format of As/400 Commands? A.What is the object type of PF.How can you specify no duplicate key? A.I (Input). Q.There are 2 types of files on As/400 they are Databases files & Device files.Unqualified path. O (Output).What is Qualified & Unqualified path? A.on which action is performed Qualifier: identifies your job Q.action Object: .Which are the different File Types in RPG? A. Printer file & Display file? A.How many types of files are available on As/400? A.Q.) Q.Qualified path means mentioning object name along with library name while Unqualified path means directly writing the object name.

Q.What is a composite key? A. even the primary file record does not match with secondary file record. We have to define it in a file level.s120 Q. The purpose Select/Omit logic is depends on the criteria (condition) given at the key field level (At function entry) it selects and omits the records. Q. Q.What are the different File Designation Types in RPG? A. the join takes place.What is the difference between Packed decimal and Zoned decimal? A. O are to defined at key field level.What is acronym of RPG? A.What is default data type for the fields(sub fields) defined in data structures in RPG? A.O are defined and what they will do? A. Q.S.Packed decimal Q.What is arrival sequence? A.What is the maximum number of key fields allowed defining in a physical file? A.What is a Keyed physical file? A. Q.Is it possible to create a physical file without DDS? A.Q.Zoned decimal : One digit occupies 2 bytes.P (Primary) & F (Fully Procedural) Q. Q.It will avoid to enter duplicate key values. With the help of CRTPF we can achieve this.At what level S. Q. Q.Packed decimal : One digit occupies 1 byte.What is the use of UNIQUE keyword and what level it is defined? A.Defining a field as a key in physical file.What is the use of JDFTVAL in join logical file? A.The records will be accessed the way in which records are added to physical file.What is default data type (if you define decimals '0') in Physical file? A. But we have to give record length. 2.Zoned decimal Q. The S/O is allowed in Logical file only.If you specify JDFTVAL at file level.Report Program Generator Mainframe AS-400 Interview Questions Part 14 .Defining more than one key as a key field in physical file. 1.Yes. Hence we can access records through the key field.

How does the RUNQRY show the output? A.When you are defining a flat file in your program in F Specs which format will you specify? A. CF: . *HIVAL. Q. E. L.EXSR is a conditional branching while a GOTO is an unconditional branching. F.How many types of display are available on As/400 for user interaction? A. *BLANKS. Q.It does not retains the value into the buffer memory.Which are the figurative constants used in RPG? A. Q.Difference between GOTO & EXSR? A.RUNQRY shows the output always in RRN (Relative Record Number) & not in keyed sequence. Information & List Display.EQ (Equal to) Q.The 4 Types they are Entry.Which indicator is used for Read? A. Q. *ZEROS. Q. *LOVAL. Menu.*BLANK.It overrides the PF temporarily for a job.In which Specs Arrays. Q. Q.*ZERO.8 because of the overflow indicators OA-OG & OV. Q.What is the syntax for PLIST? *ENTRY PLIST PARM . C & O.E (Externally Described) Q.What are the different methods to access SEU? Use the Start Source Entry Utility command (STRSEU) Option 8 from STRPGMMNU Through Program Development Manager (PDM) Q. Q.How many Specs are there in RPG & Which are they? A. Tables & Constants are defined? A.CA: . LF. of lines moving to the next page while Space before leaves the specified no. Q. Q.Source Entry Utility (SEU). PF. Q. PRTF & DSPF.F (Fixed Length) Other File: .It retains the value into the buffer memory.Printed output items placed in an output queue are known as spooled files. Q.Write & Read.How many printer files maximum can be used in single RPG program? A.In I Specs. Q. CL.Skip before leaves the specified no.Difference between CA & CF? A. Q.What is a Spool File? A. *OFF.What does EXFMT does? A.There are 7 Specs in RPG they are H. *ON & *ALL.What are the basic features of SEU? Prompt depending upon type.Q. of lines on that page.Which is the Primary Editor of As/400? A. I.What does the OVRDBF command do? A.Flat File: .Which are the member types which SEU supports? RPG.Difference between skip before & space before? A. shows right hand side date & left hand side the line number.

Q.What is I Specs for? A. runs & continues to execute instructions without human intervention or control while Interactive job are user driven. Q. A logic the compiler supplies is called RPG Fixed Logic Cycle. Q. READPE CHAIN.What is RPG Fixed Logic Cycle? A. Q.GT.Whenever there is any type error in the program the control straight away passes onto this subroutine.In O Specs what is the opcode for write? A.What are indicators? A.File Access Opcodes? A. Q. Q. Q.No.EXCPT. divide fields into sub fields & to form a group of fields.Which are the Relational Operators in RPG? A.READ.To describe the records within Program described file.What does LOKUP does in Tables & Arrays? A. EXCPT & WRITE. SETGT. The label specified must appear as the Factor1 of a TAG operation somewhere in the program.Difference between Interactive & Batch Job? A.What is the use of *PSSR in the program? A. constants.SBMJOB Command.There are 2 types of tables in RPG they are: . KFLD.What is Subroutine in RPG? A. Q.F (Fixed Length) & E (Externally Described) Q.Batch job begins.To tell length of page & number of lines to be printed on a page.Indicators are inbuilt class of variables for RPG.The LOKUP opcode searches the Factor1 entry in table or array. LE & EQ. Q. GE.Difference between CALL & SBMJOB? .Q. it is a system-defined subroutine it is executed automatically.What is L Specs for? A. READE. SETLL.What is the use of File Format in RPG? A.A subroutine is a group of statements in a program that can be processed several times in that program. control is transferred to label designated in the result field. Q. Q.Do we have to Execute the *INZSR compulsory? A.What is CAB? A.It tells to the program that the records are within the program (F) or outside the program (E).It compares Factor1 with Factor2 & if condition is true.Compile Time Tables Pre-Runtime Tables Q. Q.What are the types of Tables in RPG? A.What s the use of File Designation in RPG? A. READP. Q. Q.It refers to the way program will access or retrieve the data from the file.How can we run a Batch Job? A.What are the different File Format Types in RPG? A. fields. Q. LT. KLIST. Q.

What is the use of Data Structures? A.3 Q.Simple Logical File & Physical File.Valid Command Key.CALL performs interactively job while SBMJOB performs batch job. 4. SUBST & CAT Q.DB2 is a type of Database? A. CHECK.It can be in Arrival & Keyed sequence Q. Q.Dividing a field into sub fields.Members are separate entities within a database file & they are components of As/400 object.Grouping non-contiguous data in a contiguous format.Changing the format of a field. Q.A.A Join Logical File has how many Record formats? A.Union File Q.What is the error if we don t get login screen? A.Defining an area of storage in more than 1 format.L1 L9. 1.Change the priority or rename the job.Field & Record Q. Q.A Multiple format Logical File is also known as? A.*FILE Q. Q.1 Q.How does Union file maintains Record formats? A.1 Record format for each PF Q. 2. 3.What does VLDCMDKEY means? A.What is full form for DDS? A. Q.How to run other job when one job is active? A.What are members? A.It is an Integrated RDBMS.Data Description Specification Q. Space & Skip are which level keywords? A. Q. SCAN. Q.Records can be Read/Update/Deleted with which file? A.Which are Control Break Logic indicators? A. Q.TESTN.true .An access path may be in which sequence? A.How many maximum spaces could be given in O Specs? A.There is some problem with subsystem. Q.A Query can be displayed without saving it? A. CHECKR.Which are the String Manipulation Opcodes? A.Which type of object is used in DB2/400? A.

To add a file to the File Selection option of a Query.A Query can be run in which mode? A.LIST Q.F9 Q. the function key to be pressed is? A.Q.Which are the Query selection criteria. which can be given in a Query? A.Batch & Interactive .

Master your semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master your semester with Scribd & The New York Times

Cancel anytime.