Frequently asked Questions in AS/400

1. Define a shared access path? To share the open data path by various programs in a same job. 2. What is the difference between array and a multiple occurrence data structure? The values stored in array don’t vary. In the other hand, we can store the Different values in same variables at various stages. 3. What is *INZSR used for? It is special type of RPG/400 subroutine, which is executed automatically at beginning of the program. It is a good place to code initializes the variables. 4. How can you execute a command from within an RPG program without calling a CLP program? By calling QCMDEXC application program interface we can execute a CL command with in an RPG program. 5. What is the purpose of the "N" in the following calculation specification? C KEY CHAIN FILE N 99 If you specify 'N' in 53rd position, the record will not be locked if you try to read the locked record. It is a way of avoiding the record lock. 6. Which of the following operations does NOT zero the field FLDA defined as 4,0? C C C C C C C C MOVE Z-ADD Z-ADD MOVE SUB MOVE CLEAR MOVE *ZEROS *ZEROS 0 *ALL'0' FLDA '0000' FLDA *BLANKS FLDA FLDA FLDA FLDA FLDA FLDA FLDA

The last instruction does NOT zero the field FLDA. 7. How can you check for a records existence without causing and I/O (CHAIN/READ)? With the help of File Information Data Structure, we can check existence of records in a physical file. The code is described below: In File description continuation line (IPFK), 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. 8. Define what a data area is along with a brief example of what it may be used for? Data area is a storage area to store limited information.

Frequently Asked Questions in AS/400

Page 1

Example: a new and unique customer number is generated whenever a new customer is added to customer master file. Data area keeps track of last record added and add 1 to it. Through program we can access new customer number. 9. Define what a data queue is along with a brief example of what it may be used for? Data queues provides communication between programs by calling API's QSNDDTAQ and QRCVDTAQ along with parameters like data queue name, library in which data queue exists, variable to store the number of characters to be sent, variable to store the information to be sent. We can send the same data queue to the many programs. 10.What is the purpose of the following? I I 'CLOSED' 'OPEN' C C STAT01 STAT02

It is a type of initializing the variables in I-spec. and these are further used in C-spec. 11.What is the difference between UDATE and the system date? UDATE supports two-digit year. The format is *MDY (MMDDYY). *DATE (system date) supports four digit year. The format is *MDYY (MMDDYYYY). 12.List some of the commonly used commands for debugging STRDBG(for batch jobs), STRISDB. 13.Define the RCVF command? RCVF command used to receive the records either from the data base file or device file. 14.Define the purpose of the %SST function? To extract the information from the specified string. 15.Define the purpose of the *CAT function? To concatenate the two strings into a one string. 16.Define the purpose of the *BCAT function? To concatenate the two strings by placing a single blank in a resultant. 17.Describe the difference between the DOWxx and DOUxx operations? DOWxx : If the condition becomes true, then only the group of instructions allowed executing. DOUxx : Irrespective of condition, it will execute at least one time. 18.Define the purpose of the LEAVE operation? If you specify LEAVE, the control transfers to the statement below the ENDDO. 19.Define the purpose of the ITER operation? If you specify the ITER, the groups of statements are allowed to execute repeatedly.

Frequently Asked Questions in AS/400

Page 2

20.List the steps/commands necessary to accomplish the following: a. b. c. d. Commands: Copy data from the file ORDHDR into file ORDHIST The file ORDHIST may or may not exist If the file ORDHDR does exist, it may or may not contain data The file ORDHIST may or may not contain data, if the file does contain data the old data should be erased a. b. c. d. CPYF CPYF CPYF CPYF FILE(ORDHDR) FILE (ORDHDR) FILE (ORDHDR) FILE (ORDHDR) TOFILE(ORDHIST) TOFILE (ORDHIST) TOFILE (ORDHIST) TOFILE (ORDHIST)

CRTFILE (*YES) *ADD *REPLACE

21.What is the purpose of the following? FORDHDR1 IF E ORDHDRF K DISK KRENAMEORDHDRF1

In order to rename the record format of a data base file in a program, we can use the above steps. Purpose of renaming is: If the record format name is similar in two files and if both are used in a same program, the program will not compile. Hence we have to rename either of the file. 22.What is the purpose of the following C/COPY QRPGSRC,ORDERR is copied into the

During the compilation the source code of ORDERR copy book existing program. Where as /COPY is compiler directive statement. 23.What is the purpose of the following FORDHDR1 CF E WORKSTN $2SFN SFILE FMT2

The above line indicates that, $2SFN is a relative record number and FMT2 is name subfile record format. 24.What is the purpose of the following I I I UDS 1 7 60ORDER# 90LINE#

of

the

The purpose is to define the varibles in I-Spec and these are further used in C-spec. Where as ‘U’ indicates data area data structure? The above code is used to update the data area value through the program. The letter "U" indicates that the defined data structure is a data area data structure. 25.What is the purpose of the following? A CSRLOC (F1ROW F1COL)

Using this record level keyword, you can specify cursor location on an output operation to the record format you are defining. The program sends output after setting the cursor location. Frequently Asked Questions in AS/400 Page 3

26.What is the difference between SFLCLR and SFLINZ? SFLCLR : It clears the subfile. SFLINZ : First it clears the subfile and initiliazing the numeric variables with zeros and alphanumeric variables with characters. 27.Define the purpose/use for SFLRNA? Using this, we can make specified subfile record format inactive. 28.Define what the operation will do, the purpose of the result field and the purpose of *IN66? HI LO EQ C CALL 'CVTDAT' DTPRM 66 The above statement causes, call the program and pass the parameter. 29.Define each of the following operation codes a. b. c. d. e. READ To read the records sequentially. READE To read the equal key records READP To read the previous records READC To read the records from the workstation file (Subfile). REDEP To read the equal key previous records.

30.Define the purpose of the following code (If you know, 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 Whenever the indicator *IN66 becomes *OFF, the control transfers after ENDDO statement. Otherwise, it reads the records from the data base file based on indicator specified on HI position. If the specified indicator on LO position becomes *OFF, then only CALL statement will execute. 31.How do you set the keywords SFLSIZ and SFLPAG if you want the subfile to dynamically expand? SFLSIZ > SFLPAG. 32.When would you use or not use this approach? It is the most desirable method in building a real time times. 33.How can you detect and handle a record lock situation? If you try to read the locked record, we can get system defined message i. e. , the program will ended abnormally. With the help of File Information Data Structure we can handle record applications. We can use at all the

Frequently Asked Questions in AS/400

Page 4

lock situation. programs.

Generally it will happen, when the same file

of type " U" used in different

34.How can you detect overflow for a print program that prints multiple lines per cycle? You specify the indicators OA through OG and OV in 33 - 34 columns in a printer file. indicator automatically set on whenever overflow occurs on a type of page. This

35.How would you design the process for a nightly, high volume check producing process that needs to select only records that are flagged to be processed? With the help of OPNQRYF Clp command, we can select the records from the data base file. process involves following steps: Steps: 1. 2. 3. 4. 5. OVRDBF with SHARE (*YES) OPNQRYF CALL the program DLTOVR CLOF The

36.How would you join 3 separate fields, a first name, middle initial and last name together as 1 field with proper spacing? You can describe in either RPG and/or RPG ILE (Integrated Language Environment) MOVE 'Dr. ' MOVE 'JOHN' MOVE 'WATSON' LNAME CAT MNAME: 1 CAT LNAME:1 DSPLY VAR2 MOVE *ON FNAME 3 MNAME 4 6 VAR1 VAR2 *INLR

FNAME VAR1

8 15

37. When PGMA calls PGMB for the first time PGMB executes the *INZSR. PGMB uses the RETRN operation to return to PGMA. When PGMA call PGMB the second time is the *INZSR executed? If you specify RETRN in called program, the *INZSR will not execute again. 38. Show 2 ways to convert a date from YYMMDD to MMDDYY (MULT operation not acceptable) 1) CVTDAT DATE() RTNVAR( ) FROMFMT( ) TOFMT( ) Source code is required to convert from one date format to another date format. The source code in CLP is given below: PGM DCL DCL DCL DCL CHGVAR CHGVAR CHGVAR SNDMSG ENDPGM VAR(&VAR1) VAR(&RCVD) VAR(&VAR2) VAR(&VAR3) VAR(&VAR2) VAR(&VAR3) VAR(&RCVD) MSG(&RCVD) LENGTH(6) TYPE(*CHAR) VALUE('YYMMDD') LENGTH(6) TYPE(*CHAR) LENGTH(4) TYPE(*CHAR) LENGTH(2) TYPE(*CHAR) VALUE(%SST(&VAR1 3 4)) VALUE(%SST(&VAR1 1 2)) VALUE(&VAR2 *CAT &VAR3) TOUSR(*USRPRF)

Frequently Asked Questions in AS/400

Page 5

Define a Output Queue? Output queues are queues of jobs waiting to be printed. QBASE. Define Subsystem? Subsystem is nothing but it provides specialized environment to complete the execution of jobs. What is the function of CPYF command? To copy the data from the one file to another. QSPL. 45. 41. Describe the function of SETGT operation in RPG language? 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.Sale = 1. What are different types of Substems? QBATCH. C Cost = $110. What is the purpose of Level Check parameter in a Physical file? Specifies whether the level identifiers of when the file is opened by the program. QCMN. Define a Job Queue? Job queues are queues of batch jobs waiting to be processed. 00 Tax = 20% MarkUp= 05% Sale = 10% Eval TotalCost = ((Cost * MarkUp) * Tax)) . the indicator specified in EQ comes *ON. the record formats in the physical file are checked 44. 0$ 40. Determine the value of the result field a. Describe the function of SETLL operation in RPG language? 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. 49.39. 48. QCTL. b. 47. What is the function of CRTDUPOBJ command? To create the replica from the original object. What is the function of CPYSPLF command? It copies the spooled file to the data base file. Frequently Asked Questions in AS/400 Page 6 . 42. 43. 50. c. d. QINTER. 46. 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 spool sub system prints the output on the output queue. Describe about Query/400? 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. Define Data Structure? 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. 53. List and explain the different type of data structures? * Data area data structure When the data area is defined in an RPG/400 program as a data area data structure. letter "U" must be entered to define the data structure as a data area data structure. * File information data structure A file information data structure provides exception/error information that may be occurred when processing a file during program execution. 55. This type of data structure contains pre defined sub fields that identify * The name of the file for which the error occurred * The record processed when the error occurred * The operation being processed when the error occurred * The status code number Frequently Asked Questions in AS/400 Page 7 . What is the CLP command to access a Query/400? WRKQRY 54. 56. A query report can be: * displayed on a workstation (screen) * printed * stored in another database file. 52. Purpose of Overrides? The basic purpose of Overrides is to temporarily change the attributes of a file. job attributes are allocated) * The job is placed on a job queue * The sub system QBATCH takes the job from job queue and starts it. Define a Batch Job? * A user request the job. * Output generated by the batch job is placed on an output queue.51. So you don't have to create permanent files for every combination of attributes your application might need. What is the purpose of Data structure? * Divide a field in to sub fields * Change the format of a field * Group non-contiguous data in a contiguous format * Define an area of storage in more than one format * Define Multiple occurrences of data structures. In the data area data structure. * The job is created (job name is assigned. Overrides gives you the flexibility to use existing model files and dynamically change their attributes. its data is implicitly retrieved for processing and written back at the end of the program. 57.

Why would you prefer OPNQRYF than logical file? The main difference is : Logical file creates permanent object on the system. 64. Physical contains data derived by the field reference file. OPNQRYF creates temporary access path. Record format name in join logical file should be different. which contains field definitions and descriptions. What the purpose of the keywords FIFO. FCFO: The duplicate key records will retrieved in first changed first out order. *STATUS. Frequently Asked Questions in AS/400 Page 8 . 63. If you specify this in a file level. 62. Because access path maintenance performed on the file. What is the difference between access path and Dynamic select? Dynamic select occurs whenever the program reads file. FCFO? These keywords are used at file level. and it doesn't have member. 61. Exception errors may be controlled by testing for an error code in the *STATUS field which is included in a file information data structure. Four keywords . When would you prefer logical file than OPNQRYF? The physical file you are working with very large. LIFO: The duplicate key records will retrieved in last in first out order. Specifically. *RECORD. keywords including *FILE. Join logical file contains only one record format. Then on the Select/Omit criteria. Physical file contains actual data. But access path occurs before the file is read (but not necessarily). creating and using a logical file will allow an application to perform faster than using an open query file. the system doesn't perform record selection until the program reads file.* The RPG/400 routine in which the error occurred. 60. Through join logical file we can't made changes in physical file. *ROUTINE. 59. Record format name in regular logical file should be same based on the physical file. 58. What is the purpose of DYNSLT keyword? This is a file level keyword used in a logical file. 65. LIFO. it selects the records from the specified file. Logical file contains more than one record format.*STATUS. *OPCODE. * 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. What is field reference file? Field reference file is a file. Logical file doesn't contains data but it provides view from the physical file. *PARMS are supported by a program status data structure. Note that any code greater than 00099 is flagged as an exception/error. applications that use an access path frequently will be more efficient using a logical file. Through logical file we can made changes in physical file. *ROUTINE provide the previously named information. What is the difference between regular logical file and join logical file? Regular logical file contains more than one record format. since the access path will not have to be rebuilt every time the file is open. Since access paths created by open query files are temporary. The purpose of each one is described below: FIFO: The duplicate key records will retrieved in first in first out order. Distinguish between logical file and physical file? Physical file contains only one record format. *PROGRAM.

the files exists in test library allowed to update. What is the difference between production library and test library ? In debug mode. Table: Table is stored at the begining of the input records. e. Rebuild takes place whenever remaining access paths will be open. Delay : Rebuild will not takes place. Attributes like * Maximum number of members * Member size * Level check enforced * Open data path is shared 69.only open access paths will update whenever changes made to the file. The syntax is as follows: REF(library name/name of the field reference file) 67. 73. Table: Table can be searched consecutively. 74. Frequently Asked Questions in AS/400 Page 9 . still the space used by the deleted records not used by the other purpose. What is purpose of declarative statement DEFN? 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. Table: Only one table element can be accessed at a time. * If the factor 1 is *NAMVAR then DEFN opcodes defines the field as a data area. How can you identify End of file in CLP program? With the help of MONMSG MSGID(CPF0864) we can identify end of file in clp program. What is the necessary keyword used in a physical file to refer field definitions from the field reference file? REF which is a file level keyword is necessary to define at file level in a physical file. the files exists in production library not allowed to update. In the other hand.66. If you again perform read on the same records. 72. records won't be read. What is the purpose of SFLNXTCHG keyword in a subfile? Which is a subfile record format keyword. Because internal indicator MDT would be off. . 70. If you perform read on the subfile. 68. Array: We can access all the elements in array by specifying the array name. What is the purpose of CHGPF (Change physical file) command? CHGPF command is used to change the attributes of a physical file. What is the purpose of reorganizing the physical file i. Array: Array can be searched randomly. What is the difference between Array and Table? Array: Array is stored any where in the body of the input records. Hence you should be explicitly set on the MDT by SFLNXTCHG keyword. What are the different types of access paths maintained on the file? Immediate: All the access paths (open and close) associated with a file will be updated whenever changes made to a file. RGZPFM? Even if you delete the records in a physical file through the program. 71. the internal indicator MDT (modified data tag) is automatically set off by the system. Hence using RGZPFM command we can compress the deleted records space. Rebuild.

78. What is the purpose of RTVMBRD command? In order to access the information related to member. 76. 85. What is the difference between SETON LR and RETRN? If you specify SETON LR.+ data extracted') ENDDO RTVDTAARA DTAARA(JBA001DT *ALL) RTNVAR (&FROMDATE) Frequently Asked Questions in AS/400 Page 10 . Define an Interactive Job? * A user requests a job. What is difference between fully procedural file and primary file? In primary file the records will be read and processed from begining to end. * Job is placed on a job queue. all the files used in program will be closed. The field definitions and descriptions are defined in side the program in a program described file. * Job is created and job name. all the files used in program will remain open.75. What are necessary keywords to code message subfile? SFLMSGRCD. This order is not changed. In fully procedural file the records will be read and processed in any order. The logic flow is controlled by the opcodes in RPG program. 83. If you specify RETRN. 84. How many primary files allowed in a program? Only one primary file is allowed in program. Hence we have to explicitly open and close the file in a program.74 in a file description specification indicating that user control on a file. 81. What is message subfile? Message subfile is special file contains multiple messages taken from program message queue and placed in message sub file for display on the screen. What is the difference between externally described file and program described file? The field definitions and descriptions are defined out side of the program in a externally described file. SFLMSGKEY. job attributes are assigned. 79. When will you use OPEN and CLOSE opcodes in RPG program? If you specify the letter "U" at columns 73 . we can find existence of object on the system. How many secondary files allowed in a program? More than one secondary files are allowed in a program. we can RTVMBRD command. 82. 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. SFLPGMQ 77. * The sub system QINTER takes the job from the job queue and starts processing. How can you check the existence of object in a system? With the help of CHKOBJ clp command. * The output generated by the interactive job is placed on the output queue * The spool sub system QSPL prints the output. 80.

What is the maximum number of record formats in DSPF? 1024 (One thousand and twenty four) 90. You can specify the DSPATR keyword more than once for the same field. 3. delete the objects on the system. What is the purpose of FRCDTA (Force Data) keyword? Use this record-level keyword to immediately display a record format. 86. The following are valid attributes: For All Fields Display Attribute BL HI RI CS ND PC UL Meaning Blinking field High Intensity Reverse Image Column separator Non Display Position cursor Underline For Input-Capable Fields Only PR MDT OID SP 89. and you can specify more than one attribute for the same keyword. without waiting for the next input or output/input operation. 87. It is always good CLP programming approach to check the object before you rename.The execution of above steps is listed below: steps 1: First it checks the data area object on the system. Frequently Asked Questions in AS/400 Page 11 . Protect contents of field from input keying Set modified data tag when displayed Operator identification Select by light pen What is the purpose of PUTOVR (Put with explicit override) keyword? 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 function of DSPATR (display attributes) keyword? Use this field level keyword in display file to specify one or more display attributes for the field you are defining. What is the purpose of OVRDTA (Override Data) keyword? Use this field level keyword with PUTOVR keyword to override the existing the data contents of a field already on the display. next we can dynamically create the data area. SFLDROP: To drop the second line of multiple line subfile. If the data area object found. the MONMSG command executes with the help of message identifier. control transfers to statement below ENDDO. What is the purpose of SFLFOLD and SFLDROP keywords? SFLFOLD: To fold the second line of multiple line subfile. 88. 2: If the data area object not found. 91.

102.O are defined and what they will do? S. 94. This is also called as regular logical file. We have to define it in a file level. 95. Record level. What is a Logical file? It is nothing but a logical view provided by the physical file. 105. What is a Non-join logical file? It only provides logical view based on the physical file. 98. JFILE. Frequently Asked Questions in AS/400 Page 12 . (thirty two). What is a Member? It is a subset of data records of a physical file. 101. 100. What are the necessary keywords for the Join Logical file? JDFTVAL. 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. What is a Physical file? Physical file nothing but a table contains a only one record format in which we can describe the field definitions and descriptions. 99. 93. 107. What is the use of UNIQUE keyword and what level it is defined? It will avoid to enter duplicate key values. 96. What is Join Logical file? Join logical file joins more than one file. 97.92. What is the necessary keyword for Non-join logical file? PFILE (which is record level keyword) 106. O are to defined at key field level. The maximum of number of files allowed to join is 32 103. 104. The S/O is allowed in Logical file only. Field level. JREF. 108. At what level S. They are File level. What is the maximum number of fields under a record format of physical file? 8000 (eight thousand) What is the maximum number of parameters allowed in RPG? 255 (Two hundred and fifty five) What is the maximum number of parameters allowed in CLP? 43 (Forty three) What is the maximum number of subroutines allowed in RPG? 254 (Two hundred and fifty four) What is the maximum number of files allowed in RPG? 50 (Fifty including eight printer file) What is maximum number of Arrays allowed in RPG? 250 (Two hundred and Fifty ) Where can you specify an indicator in LOKUP operation? In 'EQ' position. How many levels are there in a Physical file? Four levels. JFLD. Key field level. JOIN.

109. What is acronym of RPG? Report Program Generator 119. * In order to rename the record format of a database file in a program. What is a Keyed physical file? Defining a field as a key in physical file. 111. What is a composite key? Defining more than one key as a key field in physical file. They are listed below: * * * * * * * 122. What is the difference between Packed decimal and Zoned decimal? Packed decimal : One digit occupies 1 byte. 112. What is the use of JDFTVAL in join logical file? If you specify JDFTVAL at file level. What is the native language of AS/400? RPG/400 120. continuation line ? * In order to refer the named record format as a subfile record format in the program. * Supports externally described files. 117. Header Specification File Description specification Extension specification Line counter specification Input specification Calculation specification Output specification When do you use F-spec. What is arrival sequence? The records will be accessed the way in which records are added to physical file. even the primary file record does not match with secondary file record. 115. Zoned decimal : One digit occupies 2 bytes. But we have to give record length. Hence we can access records through the key field. Is it possible to create a physical file without DDS? Yes. What is the maximum number of key fields allowed defining in a physical file? 120 118. What is default data type (if you define decimals '0') in Physical file? Packed decimal What is default data type for the fields(sub fields) defined in data structures in RPG? Zoned decimal 110. Why RPG/400 is famous? * Easy to code and analyze. How many specifications are there in RPG/400? What are they? There are seven specifications are exits in RPG/400. 113. With the help of CRTPF we can achieve this. the join takes place. * In order to define a named data structure as a file information data structure. 114. Page 13 Frequently Asked Questions in AS/400 . 121. 116.

What are the different types of Data Areas? The different types of Data Areas are general data area. 133. deleted by the user. printer files. local data area. we can use indicators in RPG. How do you read data area in an RPG program? With the help of 'IN' opcode. It is not associated with any library. group data area. *Group Data Area *Pip Data Area 129. How do you know that records are locked? By using a command WRKOBJLCK. 128.It can be created by user implicitely or explicitly It can be referred by any other jobs. What is the version of OS/400 that we have? V4R2 (Version 4. . SAA? Common User Access System Application Architecture Why is AS/400 called Object Oriented Machine? Everything on the AS/400 System that can be stored and retrieved is contained in the object.It is automatically created and deleted by the system We can access the group data area value through clp. 124. 131. It is meant for group jobs. we can access the data area record in to the program.It can not be referred by any other job.123. It can be associated with a library. 127. 130. . *General Data Area . It is automatically created and deleted by the system. It can be created. discket files. 134. tape files etc. When do you explicitly open files and close files in an RPG program? If you specify the letter ' U ' at column 73-74. you need to be open and close files explicitly in a RPG program. What are the various types of device files? Display files. What is DDM ? Distribution 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. pip (program initialization parameter data area) data area. * Local Data Area . Frequently Asked Questions in AS/400 Page 14 . 126. TFRCTL Which single RPG opcode performs both SETLL and READE? CHAIN What is term CUA . 125. CALL. 0 Release 2. 0) 132. . What is the purpose of Indicators in RPG? In order to control the logic flow.It is meant for pre start jobs. What are various techniques to pass parameters from one program to another? PLIST.

There should be an initial group job and it can be branched to many other group jobs. 147. 145. Why is it required? A file that holds output data to be processed. What is a Library in AS/400? A library in AS/400 is an object that serve(acts) as a repository for other objects. What is Spool file. How are the objects stored on AS/400? All objects are stored on AS/400 in a single level storage.135. 141. such as information waiting to be printed. QUSRTOOL. In this method all objects are referenced by one virtual address which is translated in to a physical address whether it is an auxiliary storage or main memory. QSYS. which govern the execution of a job? Run time priority and Time slice Page 15 140. Batch Job : A predefined group of processing actions submitted to the system to be performed. 142. Frequently Asked Questions in AS/400 . 146. How many libraries can be there in library list ? Total 40 (15 system and 25 application) What is Folder? A Folder is a named object that is used as a directory for documents and other folders. 144. 138. What are the two main attributes. Group Job is useful in enhancing the programmers productivity. Folders can be filed with in another folder. QCBL. 139. 137. Name few IBM supplied libraries? QGPL. What is the difference between Interactive & Batch Job? Interactive Job: A Job started for a person who signon to a workstation. It is as though logging into the same user-id many times. QTEMP. What is an Object? An object is any thing that exists in and occupies space in storage and on which operation can be performed. message queues. 136. The group jobs can have different library lists and different output. What is Job description? A Job description defines an environment in which a batch job or an interactive job to be executed. What are the attributes of a Job? A Job is a basic unit of work on AS/400. What is Job. What is Group Job? A Group Job is attached to one workstation and a user. The attributes are: Job Number Unique system generated sequential number Job Name Any user defined name (Max 10 char) User Name Who initiated the job. 143. QRPG What is library list ? A list that indicates libraries used for the process and the order in which it has to be searched System identifies it in *LIBL.

150. What is a message file? It is a file which contains the messages of an application. What are the types of data areas? User defined Data Area. One subsystem can have more than one active job at a time. 149. A data area can be locked to a single user. Device file can be Printer. How to create a user defined (general) data area? Using CRTDTAARA command Only one GDA can 161. Local Data Area (LDA). Tape and Remote system. all COBOL/400 messages are stored in a file. 158. length of a LDA? *CHAR. thus preventing other users from processing at the same time. jobs started on the system by a reader. 1024 bytes What is GDA? The system creates a GDA when an interactive job becomes group jobs. and subsystem monitor jobs. How to create files dynamically without DDS? Through OPNQRYF What command must be executed before executing OPNQRYF command? OVRDBF (Override Data base file) What is Data Area? Data area is an object used to hold data for access by any job running on the system. What is a Device file? A device file contains the description of how data is to be presented to a program from a device or vice versa. What is the type. 153.148. Group Data Area (GDA). 160. exists for group. 155. 154. What is a job log? A record of request submitted to system be a job. including auto-start jobs. The system program maintains it. 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. and action performed by the system on the log. What is Sub-System? Sub-Systems are specific user defined partitions of the CPU where various jobs may be executed. Program Initialization Parameter (PIP) Data Area. Frequently Asked Questions in AS/400 Page 16 . Disk. 156. What is LDA? LDA is created by the system for each job in the system. 151. What is an ICF file? A device file that allows a program on the system to communicate with program in other system. 152. 159. 157. The message related to the requests. For example all RPG/400 messages are stored in a file.

166. How do you use DEBUG utility? STRDBG program-name UPDPROD(*YES) Data Queues are used in Program 163. 169. How to create a data queues? Using CRTDTAQ command. *OBJOPR 174.162. NUMERIC and LOGICAL How can a data area be locked after being updated? Using OUT *LOCK What is the use of Data Queues? Data queue is a type of system object that you can create. *CHANGE. *ADD. 164. 171. How do you put jobs in batch mode? SBMJOB What is the use of OVRDBF ? You can use the Override with Database file (OVRDBF) command to replace the database file named in a CL program or to change certain parameters of the existing database file. How do you grant authority? Using GRTOBJAUT command What are the types of object authorities? *USE. and read without lock. How to change file attributes such as size. permanently? Using CHGPF command Frequently Asked Questions in AS/400 Page 17 . *OBJEXIST. The system identifies it an object type *AUTL 172. 165. *ALL. file wait time. 176. 175. What are the valid data types in Data Queue? Char. Numeric. 173. What is the use of OVRPRTF ? 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. *READ. Using IN opcode in RPG What are the valid user defined data area types? CHAR. *EXCLUDE. 168. 167. *UPD. What are the different ways to input data into data area? CHGDTAARA (using CL) Using OUT opcode in RPG How to retrieve data from data area? Using RTVDTAARA command in CL. . *OBJMGT. to program communication. What is an authorization list? A lists of two or more user Ids & their authorities for system resources. *DLT. record wait time etc. and Logical What are the two types of read performed on data queues? Read with lock. 170. 177.

181. and the record format can be different for different physical files. 190. 187. What is the function of RJE Conversion Utility? It converts compressed data written to an AS/400 database file to decompressed data written to another AS/400 database. Keyed sequence access path. How to see active jobs of the system. 189. 183. 182.178. What is the default value for the number of increment for the physical file? Three When does the DFT keyword in PF be used? To specify the default value it a field. What is class of service ? A set of link and node characteristics associated with a session. 186. Frequently Asked Questions in AS/400 Page 18 . 191. What the difference between Source Physical File and Physical File? A Source Physical File contains the source for the various objects created this file has specific structure. 179. 192. Record level. diskette. or device file. Commitment control is a function that allows you to define and process a number of changes to database files as a single unit (transaction). What are the system objects required for journalling? Journal receiver. A Physical File contains data. Select/Omit level. 193. 185. journal and PFs to be journalled. Keyfield level. Using WRKACTJOB command How do you detect unused spool storage? Using Reclaim Spool Storage. What are the different definition levels in Data Description Specifications? File level. What are all the different types of access path? Arrival sequence access path. What process the command SBMRJEJOB does? Sends RJE input stream to host system What is journaling & Commitment Control? Journaling is a function which records the changes in a file in a journal. 188. These record images are used to recover the changes in the file should the system ends abnormally. What is the purpose of STRCMTCTL command? Starts commitment control for files that are being journalled. What is an access path? The order in which the database fields are organized for processing in the program. What are the functions of Remote Job Entry (RJE) ? Allows user of AS/400 system to submit jobs and receive jobs from a host system. What is the use purpose of CRTCMD? To create user defined command. 180. Field level. Join level. 184.

to select/omit records. 205. 200. 206. The Data Tag detect whether the field has been changed as a result of user input. What is Multi-format logical file? Logical which uses fields from two or more physical files. underline and highlight display attributes were active? The result is same as if you had specified ND. Can error messages as a result of a COMP. 202. OVRATA keyword (field or record level) can be used to override the existing display attributes of a field or record already on the display. If DSPATR(PC) and CSRLOC were specified for a format. RANGE or VALUES keyword be overridden? Yes. What is the use of DSPATR(MDT) keyword? Sets on the modified Data Tag of the field. 201. Record format level. OVRATA keywords? OVRDTA keyword (field or record level) can be used to override the existing data contents of a field or record already on the display. What are the different types of keywords in display files? File level. 207. What the purpose of OVRDTA. 197. How can a message from a message file appear as a constant on the screen? By using MSGCON (message constant) keyword. 209. by using CONCAT keyword When would the ALL keyword be used? Use with Select or Omit. What is the Select and Omit criteria in logical file? This is used to specify rules for the Selection/Omission of records from a Physical File. 208. 199. Can fields be concatenated INa logical file level? Yes. What is the purpose of the INDARA keyword? This File-level keyword is used to remove option and response indicators from the buffer and places them in 99-byte separate indicator area. 210. 195. 196. which keyword would have priority? CSRLOC gains priority. In conjunction with what other keyword must OVRDTA and OVRATA be used? PUTOVR keyword must used. What would be the effect on the field where reverse image. through CHKMSGID keyword. to detect whether field has been changed as a result of user input. 203. Field level What is the maximum number of records you can specify in a display file? 1024 How can a screen field that has changed since the last output operation be detected ? Attach the MDT (modified data tag) attribute to the field. Explain the purpose of KEEP and ASSUME keywords? Page 19 Frequently Asked Questions in AS/400 . 204.194.

Can more than one subfile record be displayed on one line? Yes. 224. Maximum number of subfiles that can be active for a single file is? 12 221. Associated Subfile Keywords. 225.KEEP: Keep the display from being deleted when the display file is closed. 211. Relative Record Number. What is the purpose of FRCDTA keyword ? Immediately display a record format without waiting for the next I/O operation. Maximum number of subfiles that can Defined in a RPG program for one display file is 24 220. What keyword must be used with PROTECT keyword? OVERLAY What is Subfile? Subfile is group of records of same record format and can be read from or write to the display in a single operation. What are the two record formats a subfile contain ? Subfile record forma (SFL). SFLSIZ : it is an attribute which specifies the number of records can be stored in subfile. 213. How will you display a particular page in subfile? Move a valid relative record number (RRN) in the field specified using SFLRCDNBR keyword in DDS. by using SFLLIN keyword. 217. 218. Subfile Control Record Format. which specifies the number of records to scroll at a time. How to pick up the changed records every time in a subfile after the first change made? Seton SFLNXTCHG keyword indicator and update the subfile record. and subfile control record forma (SFLCTL). What is the maximum number of subfiles that can be specified in a display file. 212. 215. What are all the contents of subfile? Subfile Record Format. 512 219. 222. 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. 216. How do you specify the number of records to roll in a subfile? Use SFLROLVAL keyword in DDS along with number. 214. 223. What is the use of SFLEND keyword? Page 20 Frequently Asked Questions in AS/400 . Subfile Record Number. What is SFLPAG and SFLSIZ ? SFLPAG : it is an attribute which specifies the number of records that can be displayed in a screen. Explain the use of DFTWRT display keyword? No records will be displayed until there is any I/O operation.

What are the different types of variables available in CL? DEC. 229. 226. 231. Break message. where as Message subfile is defined by SFLMSG keyword. Explain the difference between defining Subfile and Message-subfile? Subfile record is defined by SFL keyword. User message How to trap errors in CL? By using Monitor Message Command (MONMSG) What is the maximum length of a variable name in CL? Maximum 11 characters (including '&') What are the limitations of CL (compare to RPG) ? you can not use CL program to ADD or UPDATE records in database files. TCAT. the two character strings are concatenated. one blank is inserted. What is difference between CAT. then the two character strings are concatenated. CHAR.line display of a particular record in a subfile? Using SFLDROP keyword. Use Program described files. You cannot declare more than one object (file) in a CL programme. 236. LGL How do you pass parameters in CL? Using PARM keyword. 233. the Bottom/More message could be displayed at end of screen. Program message. BCAT? CAT Concatenate two variables or constants into one continuous string. 232. TCAT Truncates all trailing blanks in the first character string. How to toggle between single line and Multi . Use Printer or ICF files. 230. 234. 227. Frequently Asked Questions in AS/400 . 237. Use subroutines. Specify different indicators used in RPG? Overflow indicators Record Identifying Indicators Field Indicators Page 21 228. When will DUMP and DEBUG opcodes be ignored? If blank is specified in position 15 of H specs. What are the different types of messages in CL? Immediate message. BCAT Truncates all trailing blanks in the first character string. 235. provides informaion about generating and running programs.By specifying this keyword. What is the use of Header Specification in RPG/400? It identifies by H in column 6. but a single output message subfile is a special type of subfile that is supported well in CL. Use the concept of subfile (to display more than one record).

Resulting Indicators Control Level Indicators 237. What is a Program Described file in RPG? The field name and length of the fields are defined with in the RPG program. 241. When is a TAG statement used in RPG? Page 22 Frequently Asked Questions in AS/400 . 247. 238. 242. 245. 248. 251. 252. Output. What is a Primary File? It is used in RPG Program Cycle to automatically read records in a cycle. to assign the files to specified devices. 250. 243. 239. How do you specify page overflow indicator for printer files in RPG? Specify an indicator in position 33-34 of F specification. arrays and tables. Can a indexed file be accessed in arrival sequence in RPG program? Yes. What is the use of L specs in RPG? Line counter specification can be used to describe printer file to indicate the length of the form and number of lines per page. What are Control level indicators? 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. 244. 249. Can you specify a display file to be used in the following modes Input. 240. 246. In which specification the report layout can be defined? O Specification. How many files can be defined in F specs? 50 How many printer files can be defined in F specs ? 8 Give three main purposes of File specification ? To define files. or Combined modes ? Yes. What is the use of E specification in RPG? Extension Specs describes all record address files. to describe the files. What is match field indicator? Matching record indicator is seton when all the matching fields in the record of a secondary file matches with all the matching fields of a record in a primary file. What is the length of a variable in RPG? 6 Characters. What is externally described file ? All information about the fields is specified in DDS and the RPG program can use them with in the program.

frees static storage and ensures program initialization (first cycle processing) the next time program is called. How do you use commitment control in RPG program ? Using COMIT operation. 263. 264. What does 'SR' in columns 7-8 of C specs mean? Calculation operation is a part of RPG subroutine. What is SCAN and XLATE? SCAN operation scans a character string (base string) contained in factor 2 for a substring (compare string ) contained in factor 1. 255. Use OPEN and CLOSE opcodes in RPG program to open and close files. What is XFOOT opcode? Adds all the elements in a numeric array. Page 23 257. and places the sum in the result field. How can we sort an array? By using SORTA opcode. Frequently Asked Questions in AS/400 . How do you use exceptional write in C specs? Using EXCPT opcode. 261. It does not close file or unlock data area. What does CHECK opcode is used? The check operation verifies that each character in the base string (factor 2) is among the character indicated in the comparator string (factor 1). 267. What opcode could be used to test an alphanumeric field for all numeric values? TESTN What opcode will be used to test the zone of a character field? TESTZ How to read database records without locking them? Put 'N' in position 53 of C specs. How can the user implicitly open and close the files in RPG program ? Enter UC in position 71-72 of F specs. 259. 265. 258. 256. What is the maximum number of elements in an array? 9999 Can we define Multi-dimensional arrays in RPG? No. What does the opcode FREE do? The FREE operation removes a program from the list of activated programs. What does opcode POST do? Puts information in INFDS. 253. 266. XLATE operation translates characters in source string (factor 2 ) to the from and to strings (factor 1 ) and put into the result field.It is used as Label. 254. 262. Makes all changes to the files that have been specified in output operation since the previous COMIT or the begining of operations under commitment control(if there has been no previous COMIT or ROLBK operation). 260.

What is File Information Data Structure? File Information Data structure (INFDS) can be defined for each file to make file exception/error information available to the program. A file information data structure contains predefined subfields that identify: the name of the file for which the exception/error occurred. The last operation being processed when the exception/error occurred. 273. and protocols that will provide a consistent framework across the System/370. /EJECT. DS is defined as program status DS by an S in position 18 of the DS statement. writing output (WRITE) ****************************************************************************** Frequently Asked Questions in AS/400 Page 24 . AS/400 and PS/2. What is Program Status Data Structure? A Program status DS can defined to make program exception/error information available to an RPG program. the record being processed when the exception/error occurred or the record that caused the exception/error. 1. reading input (READ) 2.268 How many parameters can be defined in a RPG program. /COPY What is SAA? Systems Application Architecture (SAA) is a collection of selected software interfaces. The status code. *STATUS contains status code. During execution. What is the maximum number of times Multiple Occurrences DS can occur in a program? 9999 272. conventions. *ROUTINE : contains name of routine in which the exception/error occurred *PARMS : contains the number parameters passed to this program from the calling program. 271. processing calculations (PROCESS) 3. /SPACE. The RPG routine in which the exception/error occurred. ? 255 269. 270. What are all the compiler directive statements? /TITLE. an RPG/400 program automatically follows a sequence of operations for each record that is processed. 274. The built-in program cycle includes the following logical steps.

A-spec UNIQUE. QTEMP. LIFO in Database environment ? These are file level keywords which are used to access the records in the order FCFO : First Changed First Out FIFO : First In First Out LIFO : Last In Fist Out How many record formats can you have in a Physical file and in a Logical file ? Physical file can contain only one record format. What is the function of SEU ? A utility for editing programming language source code. 284. What is a library in AS/400 ? Library in AS/400 is an object that serves as a repository for other objects. where as Logical file serves as a access path to database. Frequently Asked Questions in AS/400 . How many libraries can be there in a library list ? Total 40 (15 system and 25 application). QSYS. What is FCFO. System identifies it in *LIBL. QUSRTOOL. What is the Function of PDM? Productivity tool for copying. 276. CLP. FIFO. 279.Data Description Specification. QRPG & QCBL. REFFLD 282. deleting. Page 25 285. DDS . Source Physical File contains the source for the various objects created. changing & creating source files. 283. What is a library list ? Library list that indicates libraries used for the process and the order in which it has to be searched. DSPF. PRTF. What does the keyword UNIQUE mean ? Records with duplicate key values are not allowed. What is keyword PFILE specifies ? PFILE is used define the Physical file being referenced. 277. Can it be used for Update ? Logical file that combines more than one physical file. What is a Join Logical File.275. 280. This file has a specific structure. What is the difference between Physical and Logical files ? Physical file contains data. PFILE. scanning. 286. etc. What is the use of SDA ? Screen Design Aid is used to create display files interactively. 287. 288. 281. Name few IBM supplied libraries ? GPL. 278. RPG. What is Multi-format logical file ? Logical which uses fields from two or more physical files. Logical file can contain more than one record format. Update is not possible through JLF.

In which specification Data Structures can be defined? I . 304. What keyword must be used with PROTECT keyword ? OVERLAY What is RPG ? Report Program Generator.( H ) File Spec. In which specification can a report layout be defined ? O Specification. Is it possible to join the same file to itself ? Yes. 294. to detect whether field has been changed as a result of user input.( I ) Calculation Spec. 302. 307. 306.( C ) Output Spec. 299.Spec. 301. What does SDA stands for ? What is the symbol used for defining a new field in SDA? What is the symbol used for shifting fields in SDA? What is the symbol used for copying & moving new field in SDA? Copying : '-' & '=='.( F ) Extension Spec. What is the purpose of OVRDTA and OVRATA keywords ? OVRDTA keyword (field or record level) can be used to override the existing data contents of a field or record already on the display.( O ) Is it necessary to define all formats ? Which are mandatory and which are Optional ? No. 296.289. 290. OVRATA keyword (field or record level) can be used to override the existing display attributes of a field or record already on the display.( L ) Input Spec. 291. What would be the effect on the field where reverse image. '>'. underline and highlight display attributes are active ? The result is same as if you had specified ND. '+'. What is the use of E specification in RPG ? Extension Specs describes all record address files. *TIME. When is a TAG statement used in RPG ? It is used as a Label. How many files can be defined in F specs ? A maximum of 50 files. 293. 292. 297. *DATE. How can a screen field that has changed since the last output operation be detected ? Attach the MDT attribute to the field. Moving : '-' & '='. 305. all are Optional. Frequently Asked Questions in AS/400 Page 26 . 300. 295.( E ) Line counter Spec. Can an indexed file be accessed in arrival seQuence in RPG program ? Yes. arrays and tables. What are the different types of specification available in RPG/400 ? Control Spec. 298. '<' . Screen Design Aid. 303. What is the symbol used to get name & length of a field in SDA? '?' .

CHAIN. UNLCK. REDPE. SFLSIZ : it is an attribute which specifies the number of records can be stored in the subfile. 324. 310. What are the different opcodes used for file operation on a subfile in a RPG pgm? READ. 314. Can a single screen format occupy a screen area above and below a subfile format ? Not possible. What does opcode POST do ? Puts information in INFDS. 326. What are the different types of arrays available in RPG ? Pre-execution time array. 320. Compile time array. 327. 312. 313. 325. In conjunction with which statements can ORxx and ANDxx conditions be used ? DOUxx. 317. READC. Can we define Multi-dimensional arrays in RPG ? No. 318. SETGT. 316. and WHxx. What is the difference between *LIKE and *NAMVAR ? *LIKE defines the variables as in database. OPEN. DELET. How can database records be read without lock ? Put 'N' in position 53 of C specs. NEXT. 311. During input operation which indicator position is seton if there is a record lock? LO indicator position is seton. The maximum number of subfiles that can be active for a single file is ____ . 24 321. What does CHECK opcode do ? The check operation verifies that each character in the base string (factor 2) is among the ` character indicated in the comparator string(factor 1). 309. SETLL. 319. IFxx. 12 322. READP. *NAMVAR is used to define variables as data area. Execution time array. CLOSE. What is SFLPAG and SFLSIZ ? SFLPAG : it is an attribute which specifies the number of records that can be displayed in a screen. Can you have multiple key lists for a single file ? Yes. WRITE. READE.308. 315. What is the maximum number of subfiles that can specified in a display file ? 512 The maximum number of subfiles that can defined in a RPG program for one display file is ___ . which specifies the number of records to scroll at a time. Frequently Asked Questions in AS/400 Page 27 . Where will control be passed after the execution of the *PSSR subroutine if the factor2 of the ENDSR is blank ? Control will return to the next sequential instruction. What are the different Opcodes available in RPG for Database access ? READ. FORCE. How do you specify the number of records to roll in a subfile ? Use SFLROLVAL keyword in DDS along with the number. UPDAT. How will you display a particular page in subfile ? Move a valid relative record number(RRN) in the field specified using SFLRCDNBR keyword in DDS. CHAIN. and places the sum in the result field.UPDAT and WRITE 323. DOWxx. How to pick up the changed records every time in a subfile after the first change made ? Seton SFLNXTCHG keyword indicator and update the subfile record. What is XFOOT opcode ? Adds all the elements in a numeric array.

What is the command used to invoke RLU ? STRRLU.View Fields.Space Fields evenly.New Page.Change Line for Continuation. NP . What are the three line types in RLU ? Report line. 332.Define Constants.Centre Fields & SP . DF . SD Create Sample Data. What are different record spacing keywords in RLU ? SKIPA. Record level & Field level. CLC . 329. SPACEA & SPACEB. How do you combine two record formats in RLU ? Using CLC. What are the different commands used in RLU ? DR . What is the function of RLU ? To design & prototype a report. Filler line & Sample line.Define Fields. SKIPB. CF . CLR . 19. VF . 330. 333. DC . Frequently Asked Questions in AS/400 Page 28 .Change Line for Record. 331.Define Record. What are the three types of keywords associated with printer file ? File level. 334.328.

An MDT is set ON. And if the indicator is not associated and it is seton it READC reads all the records from sub-file How can see logical file based on which physical file and vice versa DSPDBR How can u check no of records in a file DSPFD How do u compile RPGLE program Either thru 15 or crtrpgmod Is module executable No You need to create an RPG prog to run the module What is procedure? A procedure is the set of self-contained high level language statements that can perform a particular task and then returns to a caller What is service program? A Service Program is a collection of runnable procedures and available data items easily accessible by other ILE programs. 345. We can divert the output of command to an OUTFILE. How do you set pointers to values 55 or next higher or greater? SETGT. 346. A service program is bound into a program or other service programs using binding by reference What is LOKUP opcode? Look’s for a particular element of an array How many files. and it can have resultant fields i. 336. SFLPAG are the mandatory key words Difference between SFLRCDNBR and SFLNXTCHG SFLRCDNBR will give the RRN of the First record displayed on the screen at a given time. 343. Command associated with OPNQRYF is CPYFRMQRYF to save the output permanently 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. 344. 341. It is also used to monitor user message. Mandatory keywords of sub file SFL. SFLDSP. This means that you cannot call a service program using the CALL operation. 338. SFLSIZ. How will I explicitly open a file in an RPG 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. Frequently Asked Questions in AS/400 Page 29 . SFLCTL. 347. printer files you can describe in a RPG 50 files and 8 printers How do handle file exception/error *INFDS . A service program differs from a program in two ways: It does not contain a program entry procedure. if the expression is A = B + C then B and C are from the file while A is defined in OPNQRYF. If an indicator is associated with SLFNXTCHG and it is SETON then READC will read only the changed record. 339. 348. MONMSG commands It is Dynamically creation of access path.*PSSR defining it in F spec What is OPNQRYF. Whenever a record is changed on display file. 340.e. 337.335. 342. In many respects it is similar to a subroutine library and procedure library.

FACTOR2 and RESULT field for the RPG operation code PARM? It is add value of FACTOR1 to FACTOR2 or compare the value of FACTOR 2 with FACTOR1. 360. It initialized all the character field as blanks and numeric fields as zeros. 361. 362. How will you add a field to physical file already containing data? With CPYF command and *NOCHK & *DROP What are the uses of FACTOR1. What is SFLINZ and SFLRNA? SFLINZ stands for subfile initialize. Runtime gets populated at the time execution. What is message file? It is file which contain messages created by the user through which a user can display own message while validating.349. Compile time gets populated at the time of compilation. 351. 358. If you validate a record in subfile on some condition all the invalid records can display in reverse image. 353. Frequently Asked Questions in AS/400 . How will you find a string using PDM? By using FNDSTRPDM. 359. 354. 355. Distinguish between terminating a program through SETON LR and RETURN? LR closes all the files used in the program and RETURN is used to return the control to the parent program. 352. What is ELASTIC and NON ELASTIC SUBRILE? 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. Can you display a empty subfile? Yes by using the keyword SFLINZ and SFLRNA. Why do we use READC? What is SFLNXTCHG? READC is to read those records which have changed in the subfile. SFLRNA stands for subfile record not active (It means records are there in the subfile but active). What are DDS required for SUBFILE? SUBFILE DISPLAY (SFLDSP) SUBFILE DISPLAY CONTROL (SFLDSPCTL) SUBFILE CLEAR (SFLCLR) SUBFILE SIZE (SFLSIZE) SUBFILE PAGE (SFLPAGE). 356. How will you search an array? LOKUP What are the different types of arrays? Preruntime gets populated at the time input. 357. What does DEFN do? It is used to define a field based on the value specified in FACTOR 1. The first which Page 30 350. What are two types of record are used in subfile? SUBFILE RECORD FORMAT and SUBFILE CONTROL RECORD FORMAT.

365. How you will find an error which is not in the first page of the subfile without using ROLLDOWN key? By using keyword SFLRCDNBR. What is SFLROLVAL? 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). What are the maximum parameters can be passed from one RPG program to another RPG program? 255 How many maximum parameters can be passed from on RPG program to another CL program? 40 How many maximum arrays can be used in a single RPG program? 200. 375. 364. 370. Frequently Asked Questions in AS/400 Page 31 . 372. How do you read changed records backward in subfile? NOT POSSIBLE.have changed and made valid and released still displaying in reverse image. How many levels of security are there on AS/400? There are 10 to 50 level of security on AS/400. How many maximum loops can be used in a single RPG program? 100 How many maximum printer files can be used in a single RPG program? 8 What is the maximum length of an OCCUR? 9999. What is maximum size of data area? 9999. 368. 377. How you get the relative record in a subfile in which cursor is located? By using the keyword SFLCUSRRN (Subfile cursor relative record number). 376. 366. 374. What is QCMDEXC? It is used to execute a single CL command within the RPG program. How to translate field values form lower case to Upper case? By using opcode XLATE. 367. 369. How you will know whether you are in SFLDROP or SFLFOLD mode? Bu using the keyword SFLMODE. 371. 378. 363. The records have read even it has not been changed due to SFLNXTCHG. 373. How to fire a JOB? SBMJOB.

Difference between WRKUSRJOB and WRKACTJOB? All the jobs in WRKUSRJOB are seen including Active jobs where as in WRKACTJOB only active jobs are seen. Adding new record. Modifying the existing record. Why do we define MOVE *ON *INLR? It frees the memory. 381. How do you display a screen in CL? SNDF. 390. 386. What is a subfile? Subfile is a group of records which can be used for (Displaying. How do you write and read a value (similarly as EXFMT of RPG) using a display file in CL? SNDRCVF. Can you update a file in CL? NO. 387. 391. What is *PSSR? It is a system subroutine which is executed by default when any error occurs in a program. 393.379. How do you monitor message in CL? By using monitor message ID: (MONMSG MSGID (CPF0000) Except report design what else can be done by O spec? We can write a Physical File from O spec. 389. and Deleting the existing records). 383. Frequently Asked Questions in AS/400 . 388. 385. 395. How to check end of file in CL? Monitor the message ID (CPF0864). You have given a job for printing and you are not getting the printout what might be the reason? Page 32 380. How do you shutdown your IBM server? PWRDWNSYS. 396. 392. What is the full for of CA and CF? Command Attention and Command Function. All the fields and parameters in the memory will become blank. 384. What are the three levels of SDA? File level. Can you add a record to a physical file through CL? NO What opcode is used for submit job? Why it is used? SBMJOB opcode is used and it is used for background processing. 382. 394. Record level. If your workstation does not show login screen what might be the problem? Problem with some subsystem. Field level. What is maximum size of a subfile? 9999.

Some more pending jobs might be there in Job Queue. SFLSIZ. 409. which function key should be pressed to get the field from the field reference file? F10 From work with member using PDM screen you have to modify existing member using SDA. If user wants to add one field on the report then which function key should be pressed? F11. 405. 407. user wants to add record level keyword then which function key should be pressed? F18. 400. While designing the screen user wants to add file level keywords. SFLDSPCTL. SFLCTL. SFLPAG. 398. 403. which option do you select? 17 Write system defined function used to place system name on the screen *SYSNAME While designing the screen. 404. SFLRCDNBR is a FIELD LEVEL keyword While designing the report using RLU. 408. 402. How to see the CPU usage? WRKACTJOB or WRKSYSSTS Which Function key should be pressed to define hidden field while you are working with SDA? F4 Which function key should be pressed to watch all strings defined on the SDA screen? F20 While designing the screen using SDA. 397. On which level should it be defined? File Level Write down any two mandatory keywords used when defining a subfile? SFLDSP. 401. 406. 399. 410. SDA: After getting field reference from reference file selected files will appear at the bottom of the screen and then which command function will be used to get it on screen with its label to be left aligned? &3L Frequently Asked Questions in AS/400 Page 33 . F3 function key is kept common for all record formats. There are multiple jobs for printing in job queue and you want to print a important document then what will you do? Change the priority or change the job queue name. then which function key should be pressed? F14.

‘) SPACE and SKIP are FIELD & RECORD LEVEL keywords. RLU: If user wants to define new numeric field on record format then which line command will be used? VF. 418. SEU shows prompt/syntax checking according to MEMBER TYPE. 424. 421. 426. To change constant field defined on RLU screen which field level keyword should be used? DFT RLU: Which field level keyword should be used to change any numeric field of length 8 to 99.99. Using DFU. 425. if user is designing a report using RLU? FALSE (378 Max). which contain data.411. What is difference between SKIPB (2) & SPACEB (2). 415. 417. What is the difference between normal UPDDTA to PF and updating using DFU program? Both are same only difference is DFU allows you to add or change selected fields. 427. What is Library? A library is a system object that serves as a directory to other objects or collection of object What is Library List? A job’s library list defines the path of libraries that the job follows when trying to locate programs. If user wants to center the company name on his report then which line command will be used? CF. 422.9999 format? EDTWRD (‘ . Difference between Source Physical File & Physical File? Source Physical File contains members who contain source statements & Physical File contains members. Frequently Asked Questions in AS/400 Page 34 . . its also possible to create level break reports. Using Query. 416. files or other As/400 objects. TRUE. 419. 413. User (*test) & Product (*prod).*PF/SRC 412. 420. Type of Source File & Physical File? Source File: . 414. Types of Libraries on As/400? There are 3 types of libraries on As/400 they are System (*sys). user will be able to ___________ from Physical File? Add/Update/Selected or all fields. Maximum report length is 132. If user wants to change the length of the numeric field defined in report then which combination of keys will be used? F23 & F10. 423.

Printer file & Display file? *File How many types of display are available on As/400 for user interaction? 4 Types they are Entry. Can a Join Logical File be updated? No.on which action is performed Qualifier: . How many types of files are available on As/400? There are 2 types of files on As/400 they are Databases files & Device files. 441. Menu. What is the object type of PF. Frequently Asked Questions in AS/400 Page 35 . Objects. 436. What is the command to know how many LF are related to a PF? DSPDBR (Display Database Relationship) What is the command to know key fields of file? DSPFD (F4) *ACCPTH(Access Path). 442. which is created externally & described in the program. In which Specs can PF be made internally? In I Specs. 429. LF. Which path a good programmer should use? Unqualified path. 443. What is a Join Logical File? A join Logical File can be built over the two PF’s.identifies your job What is externally described file? A file. 433. What is Qualified & Unqualified path? Qualified path means mentioning object name along with library name while Unqualified path means directly writing the object name.Physical File: . Information & List Display. 440. What is the format of As/400 Commands? Verb Object Qualifier Verb: . 438. 435. 439. Members & User Options. 432. Which is the Primary Editor of As/400? Source Entry Utility (SEU). What is Logical File? A Logical file is an Access path to the Physical File. How can you specify no duplicate key? By defining the unique key. What’s the use of STRPDM? To work with Libraries.*PF/DTA 428. 430. It is available for read access. 437.action Object: . is called as external described file. with the PF’s ‘joined’ by a common key value. 431. 434.

What does EXFMT does? Write & Read. L. shows right hand side date & left hand side the line number. 452. PRTF & DSPF. 447. PF.444. What are the basic features of SEU? Prompt depending upon type. 451. What does the OVRDBF command do? It overrides the PF temporarily for a job. 456. 450. When you are defining a flat file in your program in F Specs which format will you specify? Flat File: . 445. I. How many printer files maximum can be used in single RPG program? 8 because of the overflow indicators OA-OG & OV. How many Specs are there in RPG & Which are they? There are 7 Specs in RPG they are H. In which Specs Arrays. C & O. of lines on that page. CL. 454. Difference between skip before & space before? Skip before leaves the specified no. F. 457. How does the RUNQRY show the output? RUNQRY shows the output always in RRN (Relative Record Number) & not in keyed sequence. CF: .It does not retains the value into the buffer memory. Tables & Constants are defined? In I Specs. LF. Which indicator is used for Read? EQ (Equal to) 458. 448.F (Fixed Length) Other File: .E (Externally Described) 446. Difference between GOTO & EXSR? EXSR is a conditional branching while a GOTO is an unconditional branching. 455. Difference between CA & CF? CA: . of lines moving to the next page while Space before leaves the specified no. Frequently Asked Questions in AS/400 Page 36 .It retains the value into the buffer memory. 453. 449. What is a Spool File? Printed output items placed in an output queue are known as spooled files. E. 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) Which are the member types which SEU supports? RPG.

Types of Tables in RPG? There are 2 types of tables in RPG they are: Compile Time Tables Pre-Runtime Tables 461. How can we run a Batch Job? SBMJOB Command. *BLANKS. 472. runs & continues to execute instructions without human intervention or control while Interactive job are user driven. *HIVAL. 468. SETGT. 460. What is the syntax for PLIST? *ENTRY PLIST PARM What are indicators? Indicators are inbuilt class of variables for RPG. Which are the figurative constants used in RPG? *ZERO. 469. EXCPT & WRITE. 464. *ZEROS. it is a system-defined subroutine it is executed automatically. Frequently Asked Questions in AS/400 Page 37 . 465. 462. 470. File Access Opcodes? READ. READPE CHAIN. What is RPG Fixed Logic Cycle? A logic the compiler supplies is called RPG Fixed Logic Cycle. What is Subroutine in RPG? A subroutine is a group of statements in a program that can be processed several times in that program. READP. *OFF. Do we have to Execute the *INZSR compulsory? No. KFLD. The label specified must appear as the Factor1 of a TAG operation somewhere in the program. Which are the Relational Operators in RPG? GT. What does LOKUP does in Tables & Arrays? The LOKUP opcode searches the Factor1 entry in table or array. What is CAB? It compares Factor1 with Factor2 & if condition is true. *ON & *ALL. What is the use of *PSSR in the program? Whenever there is any type error in the program the control straight away passes onto this subroutine. GE. control is transferred to label designated in the result field. 471. LE & EQ. SETLL. Difference between Interactive & Batch Job? Batch job begins. 466. READE. KLIST. LT. 463.459. In ‘O’ Specs what is the opcode for write? EXCPT.*BLANK. 473. *LOVAL. 467.

476. How to run other job when one job is active? Change the priority or rename the job. 475. 480. Program Status Data Structure. File Information Data Structure. Multiple Occurrence Data Structure. 485. c. What is Subfile? A Subfile is a temporary area in memory which records may written to & read from a display file device. Frequently Asked Questions in AS/400 Page 38 .474. 477. e. 478. Defining an area of storage in more than 1 format. 484. Types of Data Structures? a. 483. Use of Data Structures? • • • • Dividing a field into sub fields. Which is the subsystem that is always on till the main power switch is off? QCTL What is the command to shutdown the As/400 Server? PWRDWNSYS & Parameter *IMMED. b. How can we know the CPU utilization of the server? WRKACTJOB (Work with active job) WRKSYSSTS (Work with system status) Which are the libraries (system) always present in the library list? QTEMP & QGPL Which users are allowed to manipulate system libraries? QSECOFR & QSYSOPR Can the objects stored in the product library be modified? No. d. User Defined Data Structure. What is the error if we don’t get login screen? There is some problem with subsystem. 486. Grouping non-contiguous data in a contiguous format. Changing the format of a field. Difference between CALL & SBMJOB? CALL performs interactively job while SBMJOB performs batch job. 479. Maximum number of Records in Display File? 1024 What does VLDCMDKEY means? Valid Command Key. 481. Date Area Data Structure. 482. 487.

Join Logical Files have always one record format. What is the opcode to release all the locks on a particular PF? UNLCK What is a trigger? A trigger is an action that automatically occurs whenever a change Is made to a physical file. File.488. How many triggers can be associated with a single PF? 6 (max) How can we know the triggers associated with the PF? DSPFD with parameter TYPE (*TRG) How can we add & remove trigger to a PF? ADDPFTRG & RMVPFTRG F is the type of file desg. 496. 490. It provides the Page 39 491. 500. Types of Object Locks & what they do? There are mainly 3 types of locks they are as follow: *EXCL : Only the routing step holding the lock can use the object *EXCLRD : Routing step can read/update the file other jobs can only read. 498. *SHRUPD : All jobs can read/update the object. What is a Join Logical File? A Join Logical File combines information from two or more physical files into one record format. Library. Data Queue. organization & modification of a database & access to the date stored within it. 501. Frequently Asked Questions in AS/400 . Menu &Program. 493. How do you place or remove locks on the objects? *AACOBJ & *DLCOBJ Some of the object types on which locks can be allocated? Data Area. 489. 495. Used for externally described files given when file types are? I&U What is an Output Queue? They are the holding areas that store printed output generated from Batch programs or Interactive applications. Give an example of DEFN opcode? *LIKE DEFN ENAME$ENAME (Now the $ENAME has all the attributes same like ENAME) What is DBMS? A DBMS is a software system that controls the creation. 492. How many types of objects are there on As/400? 80 How is data stored in PF’s? In fixed length records. What does print writer do? It is a system job that selects files from the output queue & prints Them on a printer. 503. 497. Message Queue. 502. 494. 499.

Frequently Asked Questions in AS/400 Page 40 . The members in LF contain? Access Path. data elements Must be of same type and same length. 507. 513. What are the 2 types of lines on O Specs? Record Identification Line & Field Identification Line. 512. What is an Array? Array is a collection of data. 510. What is a Run Time Table? Data from a separate disk file is loaded into a table each time the Program runs. 514. 516. 506. 504. 505. 515.interface between output queue’s Spooled files & the printer. the data elements must be of same Length and same type. To store information in multiple columns. Can a Subroutine contain another Subroutine? No. What is Alternate Table? RPG tables stores information in 1 column. they simply position to the record. Does the SETLL & SETGT retrieve the record? No. it uses the concept of Alternate Table. What is a Compile Time Table? We can hard code data within the program is said to be Compile Time Table. The Qualified name for an object ORDPF residing in a library TRAINING is? TRAINING/ORDPF The members in a Source Physical File contain? Source statements for a program. 509. The members in a PF contain data? (True/False) True What is the command to view the library list? DSPLIBL 508. Give the Table definition? TABMT 1 12 2 A Where1 = Number of entries per record 12 = Total number of entries 2 = Length of each entry A = Ascending Sequene If the data is likely to change over a period of time & Moreover data is large than which type of table is preferred? Compile Time Table. 518. What is a table? A table is collection of data elements in one column. 511. 517.

525. 531. 529. 521. 530.519. When a spooled file is created. While designing the screen user wants to add file level keywords then which function key is pressed? F14 While designing the report using RLU user wants to add record level keywords which function key is pressed? F18 If user wants to add one field on the report then which function key is pressed? F11 If user wants to center the company name on his report then which command will be used? CF (Center Field) 527. 528. 534. The function key to start SEU session through program development manager is? F6 The Member type for an RPG & CL program which SEU supports is? RPG & CLP Printed output items placed in an output queue are known as? Spool Files. 523. 532. 520. 524. Library on the bottom of the library list & Current library? Current library Consider the following command: WRKOBJ OBJ (*ALLUSR/DBTMEF) Object DBTMEF in all libraries except system libraries. 522. What is the command to create PF? CRTPF The LF is associated with how many PF’s? At least one PF at a time. Frequently Asked Questions in AS/400 Page 41 . it is placed into an? OUTQUEUE The command to display a list of spooled files? WRKSPLF Change in the externally described file does not require recompilation of the program? (True/False) False Command to display current library is? DSPCURLIB A PF can have how many record formats? Only one Which one of the following has the highest priority Library on top of the library list. 533. 526. Library QGPL.

551. RLU: If user wants to define new numeric field on record format then which line command will be used? VF Maximum report length is 132. 544. 550. From WRKMBRPDM screen you have to modify existing member-using SDA which option do you select? 17. SFLDSP. 543. 538. 549. if user is designing a report using RLU? FALSE (Maximum is 378) To change constant field defined on RLU screen which field level keyword should be used? Page 42 541. SEU shows prompt/syntax checking according to? Member Type It is possible to run Query using RUNQRY command? YES Using Query it is possible to create level break report? YES Using DFU user can do which operation? Add. 537. Write system defined function used to place system name on the screen? *SYSNAME While designing screen F3 function key is kept common for all record formats on which level should it be defined? File level Write down mandatory keywords used when defining a subfile? SFL. 542. 548. Update & Select fields What is the difference between UPDDTA to PF & updating using DFU? Both are same. only difference is DFU program allows you to add & update selected fields. 539. Which function key should be pressed to define hidden field while you are working with SDA? F4 Which function key should be pressed to watch all string defined on SDA screen? F20 While designing the screen using SDA. 536. 547. Frequently Asked Questions in AS/400 .535. which function key should be pressed to get the field from the FRF? F10. SFLSIZ. 540. 546. 545. SFLCTL & SFLPAG If user wants to change the length of the numeric field defined in the report then which combination of the keys will be used? F23 & F10 What is the difference between SKIPB (2) & SPACEB (2)? 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.

DFT (Default) 552. 565. 553. Frequently Asked Questions in AS/400 Page 43 . divide fields into sub fields & to form a group of fields. 566. date separator. Space & Skip are which level keywords? Field & Record A Join Logical File has how many Record formats? 1 A Multiple format Logical File is also known as? Union File How does Union file maintains Record formats? 1 Record format for each PF What is full form for DDS? Data Description Specification What are members? Members are separate entities within a database file & they are components of As/400 object. 556. 554. 562. 564. 561. which purpose is H Specs used? Writing header information. 567. U (Update) & C (Combine). fields. What if RPG. 555. For. What are the different File Format Types in RPG? F (Fixed Length) & E (Externally Described) What is the use of File Format in RPG? It tells to the program that the records are within the program (F) or outside the program (E). O (Output). 557. 558. What is I Specs for? To describe the records within Program described file. What are the different File Designation Types in RPG? P (Primary) & F (Fully Procedural) What’s the use of File Designation in RPG? It refers to the way program will access or retrieve the data from the file. when & who invented it? Report Program Generator is IBM introduced a High Level Language in 1960. constants. 559. 560. 563. currency symbol etc. How many maximum spaces could be given in O Specs? 3 568.) Which are the different File Types in RPG? I (Input). What is the size of the filename in RPG? 8 Characters (Max. What is L Specs for? To tell length of page & number of lines to be printed on a page.

Which are Control Break Logic indicators? L1 – L9. 570.569. An access path may be in which sequence? It can be in Arrival & Keyed sequence Records can be Read/Update/Deleted with which file? Simple Logical File & Physical File. Update Delete & File Enquiry. Frequently Asked Questions in AS/400 Page 44 . 583. 572. Which are the four keywords supported by Program Status Data Structure? *STATUS. 581. 585. When are the Unique Constraints executed? During Insert. 579. CHECKR. 582. 576. 580. 574. 578. 575. 573. 571. Which type of object is used in DB2/400? *FILE What is SQL? SQL is an interface for programming language. *PARM. *ROUTINE & *PROGRAM Which are the String Manipulation Opcodes? TESTN. which can be given in a Query? LIST To add a file to the ‘File Selection’ option of a Query. 586. File level entry for a PF can be? UNIQUE & FIFO Command to create FRF? CRTPF Join Logical File displays data from how many files? 2 or more PF’s A Query can be displayed without saving it? True Which are the Query selection criteria. 584. SUBST & CAT DB2 is a type of Database? It is an Integrated RDBMS. What are Data Structures? Data Structures define an area of storage & layout of fields within the defined structure. 577. CHECK. the function key to be pressed is? F9 A Query can be run in which mode? Batch & Interactive What does DFU program you to do on a record? Insert. SCAN.

597. 593. 594. 591.587. When are the Referential Constraints executed? Insert. fetch values from records into variables. 602.5 Which of the following CL command us used to display a screen & wait for the user to press enter or a function key? SNDRCVF A CL program. Update & Delete. 596. fetch records. 599. In order to test changes in EMP001 a test file called TESTEMP is library TESTLIB needs to be used EMP002 should process EMPMAST as it normally would.RPg program EMP001 & EMP002 were both written to process the file. 595. Add the following CL statement directly before the call to EMP002 DLTOVR FILE (EMPMAST) 592. What do we can do with the Embedded SQL statements? We can Insert/Update/Delete records. Frequently Asked Questions in AS/400 Page 45 . A program variable coded in an Embedded SQL statement is referred to as? Host Variable Which of the CL command can be used to determine which logical files are dependent on a specific file? DSPDBR Which CL command is used to trap error messages during program execution? MONMSG Which CL command can be used at program execution to redirect the file named in an RPG program? OVRDBF What is the length of the variable in the given example? DCL VAR (&Name) TYPE (*Char)? Default 32 & for Decimal 15. 598. EMPCL1 calls the RPG program EMP001 & the calls the RPG program EMP002. 590. 601. Which are the DB2 tools to protect Integrity of the database? Journaling & Commitment Control. 589. 600. How many triggers can be associated with a file? 6(Maximum) Why is the Declare cursor statement is used for? To define & name the cursor & specify rows to be fetched. 588. What is the values SQLCOD when there is an error in fetching the records specified in the select statement? -ve value A file cannot have more than 1 unique key? False DLCOBJ command is mandatory for removing lock on any object? False What is a Journal? A Journal is an object used primarily to record changes to data in a PF. Referential Integrity Embedded SQL & Object/Record Locks.

OVRPRTF FILE (Output) SPLFNAME (Reports) OVRPRTF FILE (Output) COPIES (3) CALL PGM (Rpg001) Copies = 3 Command to retrieve attributes of a job? RTVJOBA Only 1 file can be declared in CL program? True Command in CL to copy a Query to a database file? CPYFRMQRYF Command CLOF stands for? Closes the database file.603. 609. What is command to convert the date format in CL? CVTDAT What is command to write or update to a database file in CL? No command What is the command for retrieving user profile attributes? RTVUSRPRF What is the command to display the Data Area “Name”? DSPDTAARA “Name” What is the command to submit the Batch Job? SBMJOB Submitting a job using numeric parameters. 617. 611. 605. 606. Command OVRDBF stands for? Override (replace) the file named in the program & Override certain parameters of a file that are used by the program. Frequently Asked Questions in AS/400 . the length of the parameter should be? 15. 619. 618. 613. D PGMNAME S 20A Inz (‘THX1138’) Page 46 610. What is the type of the Array in the following code? D Arr S 30A Dim (30) PerRcd (1) CTADTA Compile Time Array Given the following code segment. 608. 604. 607. Can you debug RPG III program with STRDBG? YES & Vice versa NO Which of the following options describes the result of using the USROPN keyword? This file must be opened with an explicit OPEN operation prior to accessing this file. 616. 615.5 What will be the attributes of the output report. 614. 612. Command OPNQRYF stands for? Opens a database file to a set of database records that satisfies a database Query request.

631. 632. Frequently Asked Questions in AS/400 Page 47 . 626.C CALL PGMNAME C PARM P1 5 The CALL to the program name stored in the PGMNAME field ends in an error. 625. %CHAR If user wants to retrieve the time in microseconds. 620. 628. In the following code %SUBST is a Eval Result = %SUBST (Flda: Str: Len) Built in function What ILE RPG/400 code procedures the same results as the RPG/400 code shown below? C A Add B Sum1 Sum1 Mult X Rslt Rslt Div Tot Answ C Eval Answ = (A+B)*X/Tot The DATFMT keyword allows you to specify which of the following date format? *USA What is the command invoked when we give option 14 to RPGLE program? CRTBNDRPG What will happen. what Would be data type of the field? Z 621. 622. 623. Which of the following methods will make externally describe file fields available to a program? A Data Structure definition specification that names the file on the EXTNAME keyword. the RPGLE code look like this: D $Aprid S Like (Crprid) The keyword used to define number of entries per record for Tables/Arrays in RPGLE is? PerRcd (n) What will be the output of the following ILE code? D Loandate SD DATFMT (*USA) Inz (D’12 31 92’) UBDUR -30: *D Loandate Which will be the output of the following ILE Code? D Answer S T C T’12:00PM’ ADDDUR 12: *Hours Answer 00. %EDITW. 627.00 AM Which of the following Specs. 629. 624. 630. the program is not found. Is not used in ILE? E Specs. if we use STRISDB command for RPGLE program? Error: Program type not valid If we want to define a new variable $Aprid with same attributes as field Crpid. Which is the Built in function to convert numeric field to Alpha field? %EDITC.

634. Subprocedures can use RPG cycle? False RPGLE supports which calls? Static & Bound State whether the following code is correct? @Arr is an array. READPE OFF EQ SETLL ON EQ SETGT ON HI What does XFOOT.633. X False How many files can be opened in RPG IV program? No Limit For CHAIN. MOVEA: . SETGT. MOVEA & SORTA does? XFOOT: . 635. & Length of each element = 3A. Frequently Asked Questions in AS/400 Page 48 . No of elements = 5. READE. READE. 637. SETLL.Transfers valued from Factor2 to the Result field of the Operation but one of them must be an array 636. READP. 638.Sums the elements of an array SORTA: . C Movel ‘ABC’ @Arr.Sorts the array in ascending order but if while declaring the array Sequence is defined as D it arranges in descending order. READPE & READE where indicators are given & their success? Opcode Success Indicator CHAIN OFF HI READ.

And this two are the different parts of sub-file. 643. While in ILE RPG it is supported. Frequently Asked Questions in AS/400 Page 49 . then 10 records from file are written to subfile. 641. It is always a 640. In case of ILE we have the concept of ACTIVATION GROUP. Here sub file size should 9999 or the number of records form PF which ever is less. SFL and SFLCTL ? There are the two mandatory key words for subfile program /design. SFLSIZ = 10 and SFLPAG=9. if SFLSIZ = 10 and SFLPAG = 10. In ILE EPM (Extended Program Model) is implemented while in RPG OPM (original program model) What is sub-file? It is group of records read from or written to display file in a column format. recursive call is not supported. An MDT is set ON. Advantages of ILE or RPG? 1) In RPG it is one step compilation (we will get *PGM object) while in ILE-RPG it is two step compilation (we have to create a *MODULE and then bind that module to a program. For example. Extended Factor 2 Length of Factor 1 & 2 is increased to 14 as well as Length of OP-CODE is 10 Free format is allowed Built-in-functions are available. subset of records from physical file hence the name subfile.(this is applicable to Load all type also). SFLRCDNBR will give the RRN of the First record displayed on the screen at a given time. 645. What is SFLNXTCHG? Whenever a record is changed on display file.639. 642.e. What are the Sub file Types? There are three types of sub file Load All . 9999 records are written to subfile. If an indicator is associated with SLFNXTCHG and it is SETON then READC will read only the changed record. what is SFLDROP and SFLFOLD These are the two key-words used in sub-file for displaying additional information which cannot fit one line. then 10 records from written the sub file from physical file but only 9 are displayed on screen.In which all the records from the Physical file or at max. 644. SFLFOLD will give view in folded form and SFLDROP will give view in truncated form. In this case PAGEUP AND PAGEDOWN is taken care by system. In this case PAG Expandable/elastic/growing – In this case SFLSIZ should be grater at least by 1 than SFLPAG. SFLPAG should be less than SFLSIZ Single Page/non-elastic – In this case sub file size (SFLSIZ) must be equal to sub file page (SFLPAG). And if the indicator is not associated and it is seton it READC reads all the records from sub-file Reading records from a subfile using READC With the help of READC op-code we can read only changed records from subfile. In RPG we cannot call a program i. While SFL is used to define Subfile record format while SFLCTL is used to define Subfile Control Record format. What is SFLCSRRRN and SFLRCDNBR ? SFLCSRRRN will give the RRN of the record where the cursor is positioned. For example. 646.

SFLEND are the optional key words used in subfile. Yes. will options be there on the display / in subfile.647. Frees the space and release ODP.PGUP . 654. How will you achieve POSITION TO in Load all subfile? While loading subfile move RRN. What is the operation / op-code to change in file? In RPG/RPGLE with the help of UPDAT / UPDATE op-code. 649. SFLCLR. 657. Once invalid options is encountered program should stop processing and display error message at the bottom of the scrreen. Next READ will read that particular record. How will you take care of multiple options in case sub-file? We will have to handle it within the program using a READC in a loop. KEYVALUE in to a two dimensional array. In CL/CLLE we can not insert a record into database file. SFLCTL. 655. 653. Required key words for subfile. Two way of deleting records from file? one is DELETE and other with the help of O-Specs ADD/DEL specify DEL. 648. SFLDSPCTL. what should happen? It should process all the valid options before invalid options encounter. if we type options and then PGDN. 652. Different operations on indicator? There are only two operations on indicator those are SETON and SETOFF. If we type some options on screen out of which some are invalid and pressed enter. Assigning RRN value to SFLRCDNBR and then displaying the sub-file. RETURN – It dose not close files and dose not release the ODP and passes the control to the calling program / command prompt if the program is called from command prompt. it will position the record pointer just before the required record. 658. SFLSIZ. The whole construct is defined as subroutine. 650. In case of Load all sub-file. SFLDSP. Frequently Asked Questions in AS/400 Page 50 . LR indicator and RETURN operation? LR indicator – It close all the open files. Position to particular record? With help of op-code SETLL from RPG/RPGLE. 651. 659. SFL. having a LOOKUP into a array we can get a corresponding RRN. SFLINZ. 656. How do I insert a record into a database file? In RPG / RPGLE with the help of WRITE op-code. How to define a subroutine ? with help of two op-code BEGSR(Begin subroutine) ENDSR (End subroutine) and between these two op-codes write the instruction. It will retain all the options entered in the previous page. SFLPAG are the mandatory key words. When a key value is entered into POSITION TO field. PLIST and KLIST PLIST is a list of parameter and KLIST is the list of KEY fields.

666. 667.660. What are the built in function in RPGLE ? %SIZE . What is INFDS? INFDS is a File Information Data Structure. D ARR2 S 5 DIM(5) CTDATA PERRCD(1) It is a Compile time array. %CHAR – Converts a Numeric filed to character. %EOF – End of File. D ARR1 S 1 0 DIM(5) It is a Run time array D ARR1 S 40 DIM(7) FROMFILE(File name) PERRCD(1) It is Pre Run time array What is *PSSR and INFSR? It is an exception/error handling routine which is specified in F-Sepcs for a file.Trims the right & left blanks of the string %TRIMR . 665.Change the index of a table or multiple-occurrence data structure. Operation code The first five posi First 8 characters of the procedure RPG IV source listing line number 661.e. %SUBST . record already locked. Frequently Asked Questions in AS/400 Page 51 . How to determine if the record is in used by another user ? We can determine weather a record is in use bye another user with the help of status code (*STATUS). How to define array in D spec. If *STATUS = 01218 i.Gives number of elements or occurrences %INDEX . 664.gives a sub string from a variable (%SUBST(X:Y:Z) %ELEM .Gives the size of the variable or literal %PARM – Gives the number of parameter passed to parameter %PADDR . 1 9 10 11 16 22 30 8 9 10 15 21 29 37 Character Character Character Zoned dec Character Character Character *FILE *STATUS *OPCODE *ROUTINE The first 8 characters of the file Open indication (1 = open). INFSR(*PSSR). 663.Gives address of the variable %TRIM .Replaces the specified number of characters from the specified position. How to go to *PSSR ? Whenever an exception/error occurs and *PSSR is declared in F-specs. End of file (1 = end of file) Status code. INFSR is an information subroutine to specify the routine name in F-specs. %FOUND – If record is Found. %LEN – Returns the length of value from a field.Gives the address of the procedure %ADDR .Trims the right blanks of the string %TRIML . Whether the statements specified are executed. How to print HEADER if O-specs are used in program ? With the help of op-code EXCEPT. 662.Trims the Left blanks of the string %REPLACE . it is automatically goes to *PSSR Can we call *PSSR if no exception occurs? What happen it is called ? Yes.

Frequently Asked Questions in AS/400 Page 52 . 670. it should end with C RETURN PARMA + PARMB 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. 669. 672. How to write *PSSR ? It just similar to any other subroutine. 673. What is the disadvantage of using Global variable? We can not trace out at which point the value of variable is changed. And PR. 674. the procedure should end with C PROC1 E In returnable procedure. How to define a procedure ? First we have define Procedure Prototype along with all parameter. What is Service Program? A Service Program is a collection of runnable procedures and available data items easily accessible by other ILE programs. D PROC1 PR Procedure Interface It is section where we define all the parameter which are receiving or returning some values. 671. *PSSR BEGSR ……………… ……………… …………….668. Procedure Prototype In this section we specify the name of the procedure along with PR. In many respects it is similar to a subroutine library and procedure library. D PROC1 PI 5 0 D PARMA 5 0 D PARMB 5 0 How to define Global Parameter in ILE ? Declare a variable with key word EXPORT and while using this variable in anther program declare with IMPORT keyword. ENDSR What is Procedure ? A procedure is the set of self contained high level language statements that can perform a particular task and then returns to a caller.

COMP Disadvantage of using Validity Check keyword? How to overcome these disadvantages ? If invalid values are entered. System defined message is displayed which may not be user friendly. How to validate input values in Display file ? with the help of Validity check key words VALUE.2. 678. A service program is bound into a program or other service programs using binding by reference.%EOF. 680. The option filed is displayed in reverse image. How to define to define a Hidden filed in DSPF ? Page 53 681. NOT %BOF…etc. EDTCDE cannot be applied to some Codes pre-defined for example. Keyboard is locked. What is the structure of Service Program ? What is signature ? ????????????????????????????? What is *ISO date format? YYYY-MM-DD for other formats refer to IBM manual or ERIS document. This means that you cannot call a service program using the CALL operation. How to avoid using indicators in ILE ? By using the standard Built In Expressions like %FOUND. EDTCDE( Z) – for date field. What key word is used when screen is re-display? RSTDSP is a parameter to be specified at compile time for display file. Frequently Asked Questions in AS/400 . And EDTCDE has suppressing the leading zero Y – for EDTWRD can be used to define user used for formatting purpose. To overcome above disadvantage validations is done within program and user friendly/defined message is displayed. what will happen ? Program crashes. While command function key passes indicator status as well as a data from screen to program. EDTCDE & EDTWRD EDTCDE & EDTWRD are key words Character filed. If we tried to move year part of *ISO date into a field of length 3. What are the important factors in Error message subfile ? We must define error message record format (SFLMSG). And a Program Queue. OVERLAY It allows a record format to be displayed on screen retaining the previous displayed record formats. defined formatting for a fields. 683. 682. NOT Display / Printer File 679. RANGE. %EOF. we have to reset it. %BOF. 686. 675. 676. 685.A service program differs from a program in two ways: It does not contain a program entry procedure. Command Attention key and Command Function Key ? With the help of Command attention key we can pass only the indicator status to program not the data from screen. 684. as in case of *ISO format it required fields of 4.2. 677. (PGMQ) and Record format is associated to a line number.

That is. What is the stored procedure and how do you define a stored procedure. ETC. Writing an SQL statement from selecting records from TWO files using single statement and Nested select statement. Procedures in SQL provide the same benefits as procedures in a hot language. Frequently Asked Questions in AS/400 Page 54 . SELECT * FROM FILE1. etc. OUT . END-SQL We can have parameters as IN . 689. syntax is as below… EXEC SQL DELCARE P1 PROCEDURE (:PARM1 INOUT CHAR(10)) (EXTERNAL NAME MYLIB/PROC1 LANGUAGE RPGLE SIMPLE CALL WITH NULLS).0 fixed We can specify *FILED for filed *REC for Record on which a key is pressed. SQL / 400 – Structured Query Language 688. 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.FLD1 FROM FILE2) 690. UPDATE RULE.A referential constraint is being added *UNQCST . FILE2 WHERE FILE1. Commands are ADDPFCST for Physical file and ADDLFCST for Logical file. here we need to define a field to get row and column. Type of constraints *REFCST . INOUT type. CL.Define a filed in a DSPF of use HIDDEN.A primary key constraint is being added *CHKCST . How do you achieve referential integrity? By adding Referential Integrity Constraints to a Physical file or Logical file. C.(H) 687. MYLIB/PROC1 this PROC1 is a program written and compiled separately and it is of language which you are specifying in section LANGUAGE. *PRIKEY .A check constraint is being added Type of Delete rule (DLTRULE) *NOACTION – 1. a common piece of code need only be written and maintained once and can be called from several programs. Constraints like PRIMARY KEY. FOREGIN KEY. A stored procedure is a program that can be called to perform operations that can include both host language statements and SQL statements. Language can be RPGLE. Stored procedures can be used in both distributed and non-distributed applicaitons.FLD1 Using Nested Select statement SELECT * FROM FILE1 WHERE FILE1. Using Single statement. How To get the cursor position? With the help of RTNCSRLOC keyword.A unique constraint is being added. Length of variable should be 5.FLD1 = FILE2.. It is defined using DECLARE PROCEDURE statement.FLD1 EQ (SELECT FILE2. DELETE RULE.

. Deleting a record in a parent file is restricted if data for a non-null parent key matches data for a foreign key. If we want to have a look where the stored procedure. Select * from ????????????????????? Difference between View and Index ? View will not any data.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. Frequently Asked Questions in AS/400 Page 55 . Can we have records (with fields from more than one file) from multiple files and Nested / sub query in SQL ? Yes. 691. 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. 693.FLD1 IN (SELECT FILE2. *CASCADE – The cascade delete rule is used. 694. 695. 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. Updating a record in a parent file is restricted if data for a non-null parent key matches data for a foreign key. Where Stored procedure lies in the system. Type of Update rule (UPDRULE) *NOACTION – No Action *RESTRICT – 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. *RESTRICT – 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.FLD1 FROM FILE2) What is the sequence when using CURSOR? Define Cursor Declare Cursor Open Cursor Fetch record Processing Close Cursor Different type of Cursor? Two types of Cursor Simple / Serial Cursor A serial cursor is one defined without SCROLL key word For serial cursor each row is fetched only once per OPEN When it is opened it is positioned before the first row in the table. To use serial cursor we have to re-issue OPEN 692. It only shows a data from table while Index has a Indexing Data for a sequence on which Index is created. we can have a look through SQL. 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.

then we can have different set of output depending upon the parameter passed to it. What are the two important parameter while creating a SQLRPGLE program ? 1) CMTCTL . 704.*ENDMOD (End of Module) by default is *ENDACTGRP Can we update database file with the help SQL Cursor ? While declaring the cursor if we specify FOR READ then we cannot update but if we specify FOR UPDATE or nothing (by default is FOR UPDATE) then we can update database file. which provides all the resources required for the execution of program along with necessary memory space required. Records selected into cursor are locked when the cursor is opened. How to call / invoke the stored procedure ? Using CALL command . LAST. When the FETCH is issued . Miscellaneous 701. 698. Does Opening of cursor locks records ? Yes. Cursor defined with SCROLL key word Rows of cursor can be fetched many times When it is opened it is positioned before the first row in the table. ???????????????????/ needs to elaborated more…. 705. from which we would retrieve or save the required object. NEXT.????????????????? What is difference between Interactive and Batch Job ? job where user interaction is present is called an interactive job.*NONE (Commitment Control) CLOSQLCR . 699. 703. What is library list ? list that indicate libraries used for the process and the order in which it has to be searched. (FIRST. 706. 702. AS/400 triggers are file level triggers. What will happen if we call stored procedure again and again ? It the creation of procedure is included in the called program. What is Trigger? Trigger are the programs which are activated upon certain event. the cursor is positioned to the row of the table that is specified by the POSITION option.Scrollable Cursor which is defined with SCROLL key word. And If creation is outside the called program then we will be available with only one set of output. What is Library? Library is an AS/400 object of type *LIB. What is Sub-system in as/400? It is Run-time environment. 700. RELATIVE) 696. It can contain all types of objects except another object of type *LIB What is Library List? It is sequence of objects of type *LIB. A job where user interaction is not required is called a batch job. 697. Frequently Asked Questions in AS/400 Page 56 . For example to find an object system will search in the in the ascending order of libraries mention in library list. PREV.

712. What is JOBQ and PRINTQ ? Jobs go into the job queue in order to run in a subsystem. Which is the better option to write a transaction (order header and detail transaction) using two physical files or one join logical file(on those two physical files) in a program and why ? Using two physical files is the better option because records can't be written through join logical file. Why can't a database file be used in place of data area ? Using database file will reduce the performance of application. 710. 719. 716. An object is stored and retrieved via a device-independent addressing mechanism. What is the difference between OPNQRYF & Logical file ? OPNQRYF is temporary Logical file. How QTEMP is different from other libraries ? It is associated to each job (Other Jobs can't access the other's QTEMP). 708. situation where frequency to run the programs is less & very large number of records are present in data base file. 709. What kind of job is it --. 713. 715. Print queue where the printer files (report) reside and wait for their turn to get printed. What is single level storage ? Main storage and disk stroage appears contiguous. It is not a job. How many record formats can you have in a Physical & Logical file? Physical file can contain only one record format where as Logical file can have more than one record format. The data is read by "IN" and written by "OUT" opcode. QTEMP is created when the Job is started and deleted when Job is closed. 714.you have signed on AS400 and then typed Call XYZ and pgm XYZ is an RPG program which simply reads a database file and generates report. 717.707. What does STRSRVJOB command used for ? It is used to debug the batch programs or debug the interactive program of another job. 711. What is difference between Physical file and Logical File ? Physical file contain data where as logical file serve as access path. choice is RPG program. Which program RPG or CL is efficent to update a transaction onto a database file and why ? CL program cannot update/write onto a data base file and hence. OPNQRYF is used for dynamic selection. to use different file with same record format in a program. It is defined using opcode *NAMVAR. How to handle run time error in CL Program ? By using command MONMSG with suitable message identifier What is Data area and how it is used in RPG program ? Data area is a type of an object which is used for storing data. It is used in association with OPNQRYF. What is OVRDBF and where it is used ? OVRDBF is a command to temprorarly over ride the parameters of a Data base file. Frequently Asked Questions in AS/400 Page 57 . 718. 720.

splitting date field into day. Can a file be journaled without using it under commitment control ? Yes Can a file be used under commitment control without being jorunaled ? No What is difference between module and program ? Module is a non-runnable object where as program is runnable. 726. 725. What is difference between ILE RPG and RPG/400 ? Difference is in program development (specification). What is difference between Journaling and commitment control ? Journaling record all transactions and is used for restoring or reverting back the transactions onto the database file for a particular time span. 727. Pre-Run time and Run time. Committment control ensures that a transaction is updated successfully onto the data base (all relevant files). What is difference between Multi record format Join and Non. Pre-run time array gets value from a file at the beginning of a program execution (before any statement of a program is executed). Can an indexed file (File with key fields) be accessed in arrival sequence in an RPG program ? Yes. *NAMVAR is used to define variable as Data area. 729. What is the difference between triggers and referential integrity ? Triggers are programs (which carry out a particular business function) invoked either before or after manipulation of the records in a database. 728.Join logical file ? Multi record format logical file contain more than one record format( based on one or more physical file) With join logical file only read operation can be done whereas in non-join logical file all operations can be done. Frequently Asked Questions in AS/400 Page 58 . Run time array gets value during the program execution. bind module to create program). What are different types of Arrays and what is the difference between them ? There are 3 types of arrays Compile time. 731. Can we have a multi record format join and non join logical file based on one physical file ? We can only have Join logical file based on one physical file. program creation (create module. resource sharing). combining various key fields to make one key field and so on. Referential integrity maintain the integrity of a database using key fields. Various uses are converting character value into numeric. 723. What is Multi occurence data structure ? It is an array of a Data structure. don't specify "K" in F specification in the program for this file. 730. month and year. 732. 722. What is a data structure ? What are its uses ? A data structure is a variable field which is partitioned by defining variable fields (call as Sub fields). 724. Compile time array gets value at the time of compilation of the source of a program. 733.721. What is the difference between *LIKE and *NAMVAR opcode? *LIKE defines program variable same as that of another pre defined variable. program running (activation group.

736. subroutine *PSSR How will you display a particular page (or record) in a Sub file? Move a valid relative record number(RRN) in the field specified using SFLRCDNBR keyword in DDS What is difference between Command Function and Command Attention key? Command function key returns variable value along with response indicator (associated with CF key) where as Command attention returns only the response indicator value. 735.734. What is the difference between SKIPA & SPACEA ? In a printer file the printing control goes to the line (of the page) mention in SKIPB where as it leaves number of lines mention in SPACEB How to handle run time error in RPG Program ? by using indicator on statement. 3rd.times from sub file after reading them once. What are different type of Sub files ? There are three types of Subfile (1) Load all Subfile (Page Size = 9999) (2) Extendable Sub file (Sub file size > Sub file page).. 740. What is SFLROLVAL keyword used for ? It specify the number of records to roll in a subfile. What is difference between keyword SFLCSRRRN & RTNCSRLOC ? RTNCSRLOC returns the location of cursor into the variable (associated with this keyword) and SFLCSRRRN returns the relative record number where the cursor is positioned. (3) Load by Page (Sub file size = Sub file page) What is SFLNXTCHG keyword used for ? To read the change records for 2nd. 739. 738. 741. Frequently Asked Questions in AS/400 Page 59 ... 737.