Sie sind auf Seite 1von 37

Tags:Mainframe AS400 Interview Questions and Answers,AS/400,AS400 Interview Questions,AS400 Interview Answers.

Define what a data area is along with a brief example of what it may be used for? Ans:Data area is a storage area to store limited information. 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. Define what a data queue is along with a brief example of what it may be used for? Ans: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. What is the purpose of the following? I 'CLOSED' C STAT01 I 'OPEN' C STAT02 Ans:It is a type of initializing the variables in I-spec. and these are further used in C-spec. What is the difference between UDATE and the system date? Ans:UDATE supports two-digit year. The format is *MDY (MMDDYY). *DATE (system date) supports four digit year. The format is *MDYY (MMDDYYYY). List some of the commonly used commands for debugging Ans:STRDBG(for batch jobs), STRISDB. Define the RCVF command? Ans:RCVF command used to receive the records either from the data base file or device file. Define the purpose of the %SST function? Ans:To extract the information from the specified string. Define the purpose of the *CAT function? Ans:To concatenate the two strings into a one string. Define the purpose of the *BCAT function? Ans:To concatenate the two strings by placing a single blank in a resultant. Describe the difference between the DOWxx and DOUxx operations? Ans: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.

Define the purpose of the LEAVE operation? Ans:If you specify LEAVE, the control transfers to the statement below the ENDDO. Define the purpose of the ITER operation? Ans:If you specify the ITER, the groups of statements are allowed to execute repeatedly. List the steps/commands necessary to accomplish the following: a. Copy data from the file ORDHDR into file ORDHIST b. The file ORDHIST may or may not exist c. If the file ORDHDR does exist, it may or may not contain data d. The file ORDHIST may or may not contain data, if the file does contain data the old data should be erased Ans:Commands are as follows a. CPYF FILE(ORDHDR) TOFILE(ORDHIST) b. CPYF FILE (ORDHDR) TOFILE (ORDHIST) CRTFILE (*YES) c. CPYF FILE (ORDHDR) TOFILE (ORDHIST) *ADD d. CPYF FILE (ORDHDR) TOFILE (ORDHIST) *REPLACE What is the purpose of the following? FORDHDR1 IF E K DISK ORDHDRF KRENAMEORDHDRF1 Ans: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. What is the purpose of the following Ans:C/COPY QRPGSRC,ORDERR During the compilation the source code of ORDERR copy book is copied into the existing program. Where as /COPY is compiler directive statement. What is the purpose of the following Ans:FORDHDR1 CF E WORKSTN $2SFN SFILE FMT2 The above line indicates that, $2SFN is a relative record number and FMT2 is name of the subfile record format. How can you check for a records existence without causing and I/O (CHAIN/READ)? Ans: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.

What is the difference between SFLCLR and SFLINZ? Ans:SFLCLR : It clears the subfile. SFLINZ : First it clears the subfile and initiliazing the numeric variables with zeros and alphanumeric variables with characters. Define the purpose/use for SFLRNA? Ans:Using this, we can make specified subfile record format inactive. What is the purpose of the following I UDS I 1 60ORDER# I 7 90LINE# Ans:The purpose is to define the variables in I-Spec and these are further used in C-spec. 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. What is the purpose of the following? A CSRLOC (F1ROW F1COL) Ans:Using this record level keyword, you can specify cursor location on an output operation to the record format you are defining. The program sends output after setting the cursor location. 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 Ans:The above statement causes, call the program and pass the parameter. Define each of the following operation codes a. READ To read the records sequentially. b. READE To read the equal key records c. READP To read the previous records d. READC To read the records from the workstation file (Subfile). e. REDEP To read the equal key previous records.

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 Ans: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. How do you set the keywords SFLSIZ and SFLPAG if you want the subfile to dynamically expand? Ans:SFLSIZ > SFLPAG. When would you use or not use this approach? Ans:It is the most desirable method in building a real time applications. We can use at all the times. How can you detect and handle a record lock situation? Ans: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 lock situation. Generally it will happen, when the same file of type " U" used in different programs. How can you detect overflow for a print program that prints multiple lines per cycle? Ans:You specify the indicators OA through OG and OV in 33 - 34 columns in a printer file. This indicator automatically set on whenever overflow occurs on a type of page. Define a shared access path? Ans:To share the open data path by various programs in a same job. What is the difference between array and a multiple occurrence data structure? Ans:The values stored in array dont vary. In the other hand, we can store the Different values in same variables at various stages. What is *INZSR used for? Ans: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. How can you execute a command from within an RPG program without calling a CLP program? Ans:By calling QCMDEXC application program interface we can execute a CL command with in an RPG program. What is the purpose of the "N" in the following calculation specification? Ans: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.

Tags:AS/400 ,AS400 Interview Questions and Answers asked in companies like IBM,CTS,Infosys,Wipro,HCL,HP,TCS,Dell. Which of the following operations does NOT zero the field FLDA defined as 4,0? Ans: C MOVE *ZEROS FLDA C Z-ADD *ZEROS FLDA C Z-ADD 0 FLDA C MOVE *ALL'0' FLDA C SUB FLDA FLDA C MOVE '0000' FLDA C CLEAR FLDA C MOVE *BLANKS FLDA The last instruction does NOT zero the field FLDA. 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? Ans: With the help of OPNQRYF Clp command, we can select the records from the data base file. The process involves following steps: Steps: 1. OVRDBF with SHARE (*YES) 2. OPNQRYF 3. CALL the program 4. DLTOVR 5. CLOF 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) Ans: MOVE 'Dr. ' FNAME 3 MOVE 'JOHN' MNAME 4 MOVE 'WATSON' LNAME 6 FNAME CAT MNAME: 1 VAR1 8 VAR1 CAT LNAME:1 VAR2 15 DSPLY VAR2 MOVE *ON *INLR 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? Ans:If you specify RETRN in called program, the *INZSR will not execute again. 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 VAR(&VAR1) LENGTH(6) TYPE(*CHAR) VALUE('YYMMDD') DCL VAR(&RCVD) LENGTH(6) TYPE(*CHAR) DCL VAR(&VAR2) LENGTH(4) TYPE(*CHAR) DCL VAR(&VAR3) LENGTH(2) TYPE(*CHAR) CHGVAR VAR(&VAR2) VALUE(%SST(&VAR1 3 4)) CHGVAR VAR(&VAR3) VALUE(%SST(&VAR1 1 2)) CHGVAR VAR(&RCVD) VALUE(&VAR2 *CAT &VAR3) SNDMSG MSG(&RCVD) TOUSR(*USRPRF) ENDPGM Define the purpose of Factor 1 the Operation Code and *IN15 in following code HI LO EQ C *YMD Test(D) yymmddDate 15 Ans:If the factor 1 value matches with factor2 value, the indicator specified in EQ comes *ON. Describe the function of SETLL operation in RPG language? Ans: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. Describe the function of SETGT operation in RPG language? Ans: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. What is the purpose of Level Check parameter in a Physical file? Ans:Specifies whether the level identifiers of the record formats in the physical file are checked when the file is opened by the program. Define a Job Queue? Ans:Job queues are queues of batch jobs waiting to be processed. Define a Output Queue? Ans:Output queues are queues of jobs waiting to be printed. What is the function of CPYSPLF command? Ans:It copies the spooled file to the data base file.

What is the function of CPYF command? Ans:To copy the data from the one file to another. What is the function of CRTDUPOBJ command? Ans:To create the replica from the original object. Define Subsystem? Ans:Subsystem is nothing but it provides specialized environment to complete the execution of jobs. What are different types of Substems? Ans:QBATCH, QINTER, QSPL, QCMN, QCTL, QBASE. Define a Batch Job? Ans: * A user request the job. * The job is created (job name is assigned, job attributes are allocated) * The job is placed on a job queue * The sub system QBATCH takes the job from job queue and starts it. * Output generated by the batch job is placed on an output queue. * The spool sub system prints the output on the output queue. Describe about Query/400? Ans:Query/400 is a licensed program that uses a query to analyze and select the information contained in the data base files and create a query report. A query report can be: * displayed on a workstation (screen) * printed * stored in another database file. What is the CLP command to access a Query/400? Ans:WRKQRY What is the purpose of Overrides? Ans:The basic purpose of Overrides is to temporarily change the attributes of a file. So you don't have to create permanent files for every combination of attributes your application might need. Overrides gives you the flexibility to use existing model files and dynamically change their attributes. Define Data Structure? Ans: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. What is the purpose of Data structure?

Ans: * 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. List and explain the different type of data structures? Ans: * Data area data structure When the data area is defined in an RPG/400 program as a data area data structure, its data is implicitly retrieved for processing and written back at the end of the program. In the 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. 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 * The RPG/400 routine in which the error occurred. Exception errors may be controlled by testing for an error code in the *STATUS field which is included in a file information data structure. Specifically, keywords including *FILE, *RECORD, *OPCODE, *STATUS, *ROUTINE provide the previously named information. * 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. Note that any code greater than 00099 is flagged as an exception/error. Four keywords - *STATUS, *ROUTINE, *PROGRAM, *PARMS are supported by a program status data structure. What is the purpose of DYNSLT keyword? Ans:This is a file level keyword used in a logical file. If you specify this in a file level, the system doesn't perform record selection until the program reads file. Then on the Select/Omit criteria, it selects the records from the specified file. When would you prefer logical file than OPNQRYF? Ans:The physical file you are working with very large, creating and using a logical file will allow an application to perform faster than using an open query file. Since access paths created by open query

files are temporary, applications that use an access path frequently will be more efficient using a logical file, since the access path will not have to be rebuilt every time the file is open.

Tags: AS-400 Interview Questions Answers,AS/400 Interview Questions,Mainframe AS400 Interview What are the three types of keywords associated with printer file ? Ans:File level, Record level & Field level. Difference between SFLRCDNBR and SFLNXTCHG Ans:SFLRCDNBR will give the RRN of the First record displayed on the screen at a given time. Whenever a record is changed on display file. An MDT is set ON. If an indicator is associated with SLFNXTCHG and it is SETON then READC will read only the changed record. 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 Ans:DSPDBR How can u check no of records in a file Ans:DSPFD How do u compile RPGLE program Ans:Either thru 15 or crtrpgmod Is module executable Ans:No You need to create an RPG prog to run the module. How do you combine two record formats in RLU ? Ans:Using CLC. 19. What are the different commands used in RLU ? Ans:DR - Define Record, CLC - Change Line for Continuation, CLR - Change Line for Record, SD - Create Sample Data, VF - View Fields, NP - New Page, DC - Define Constants, DF - Define Fields, CF - Centre Fields & SP - Space Fields evenly. What is the command used to invoke RLU ? Ans:STRRLU. What are different record spacing keywords in RLU ? Ans:SKIPA, SKIPB, SPACEA & SPACEB.

Mandatory keywords of sub file Ans:SFL, SFLCTL, SFLDSP, SFLSIZ, SFLPAG are the mandatory key words What is procedure? Ans: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? Ans: A Service Program is a collection of runnable procedures and available data items easily accessible by other ILE programs. In many respects it is similar to a subroutine library and procedure library. A service program differs from a program in two ways: It does not contain a program entry procedure. This means that you cannot call a service program using the CALL operation. A service program is bound into a program or other service programs using binding by reference What is LOKUP opcode? Ans:Looks for a particular element of an array How many files, printer files you can describe in a RPG Ans:50 files and 8 printers How do handle file exception/error Ans:*INFDS ,*PSSR defining it in F spec Distinguish between terminating a program through SETON LR and RETURN? Ans:LR closes all the files used in the program and RETURN is used to return the control to the parent program. How will you add a field to physical file already containing data? Ans:With CPYF command and *NOCHK & *DROP What are the uses of FACTOR1, FACTOR2 and RESULT field for the RPG operation code PARM? Ans:It is add value of FACTOR1 to FACTOR2 or compare the value of FACTOR 2 with FACTOR1. How will you find a string using PDM? Ans:By using FNDSTRPDM. How will you search an array? Ans:LOKUP What are the different types of arrays?

Ans:Preruntime gets populated at the time input. Runtime gets populated at the time execution.Compile time gets populated at the time of compilation. What is message file? Ans:It is file which contain messages created by the user through which a user can display own message while validating. What does DEFN do? Ans:It is used to define a field based on the value specified in FACTOR 1. What are two types of record are used in subfile? Ans:SUBFILE RECORD FORMAT and SUBFILE CONTROL RECORD FORMAT. What are DDS required for SUBFILE? Ans:SUBFILE DISPLAY (SFLDSP) SUBFILE DISPLAY CONTROL (SFLDSPCTL) SUBFILE CLEAR (SFLCLR) SUBFILE SIZE (SFLSIZE) SUBFILE PAGE (SFLPAGE). What is ELASTIC and NON ELASTIC SUBRILE? Ans: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. What is SFLINZ and SFLRNA? Ans:SFLINZ stands for subfile initialize. It initialized all the character field as blanks and numeric fields as zeros. SFLRNA stands for subfile record not active (It means records are there in the subfile but active). Can you display a empty subfile? Ans:Yes by using the keyword SFLINZ and SFLRNA. Why do we use READC? What is SFLNXTCHG? Ans:READC is to read those records which have changed in the subfile. If you validate a record in subfile on some condition all the invalid records can display in reverse image. The first which have changed and made valid and released still displaying in reverse image. The records have read even it has not been changed due to SFLNXTCHG. How do you read changed records backward in subfile? Ans:NOT POSSIBLE. How you will find an error which is not in the first page of the subfile without using ROLLDOWN key? Ans:By using keyword SFLRCDNBR. What is SFLROLVAL? Ans: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). How you will know whether you are in SFLDROP or SFLFOLD mode? Ans:By using the keyword SFLMODE. How you get the relative record in a subfile in which cursor is located? Ans:By using the keyword SFLCUSRRN (Subfile cursor relative record number). What is QCMDEXC? Ans:It is used to execute a single CL command within the RPG program. What is OPNQRYF, MONMSG commands Ans: It is Dynamically creation of access path, and it can have resultant fields i.e. if the expression is A = B + C then B and C are from the file while A is defined in OPNQRYF. We can divert the output of command to an OUTFILE. 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. It is also used to monitor user message.

Tags:AS-400,AS/400 Technical Interview Questions,AS400 Interview Questions and Answers Which are the four keywords supported by Program Status Data Structure? Ans:*STATUS, *PARM, *ROUTINE & *PROGRAM Which are the String Manipulation Opcodes? Ans:TESTN, SCAN, CHECK, CHECKR, SUBST & CAT DB2 is a type of Database? Ans:It is an Integrated RDBMS. An access path may be in which sequence? Ans:It can be in Arrival & Keyed sequence To change constant field defined on RLU screen which field level keyword should be used? Ans:DFT (Default) Space & Skip are which level keywords? Ans:Field & Record

A Join Logical File has how many Record formats? Ans:1 A Multiple format Logical File is also known as? Ans:Union File How does Union file maintains Record formats? Ans:1 Record format for each PF Records can be Read/Update/Deleted with which file? Ans:Simple Logical File & Physical File. Which type of object is used in DB2/400? Ans:*FILE What is SQL? Ans:SQL is an interface for programming language. File level entry for a PF can be? Ans:UNIQUE & FIFO What is the command to create FRF? Ans:CRTPF Join Logical File displays data from how many files? 2 or more PFs A Query can be displayed without saving it? Ans:True Which are the Query selection criteria, which can be given in a Query? Ans:LIST To add a file to the File Selection option of a Query, the function key to be pressed is? Ans:F9 A query can be run in which mode? Ans:Batch & Interactive What is the values SQLCOD when there is an error in fetching the records specified in the select statement? Ans:-ve value

A file cannot have more than 1 unique key? Ans:False DLCOBJ command is mandatory for removing lock on any object? Ans:False What is a Journal? Ans:A Journal is an object used primarily to record changes to data in a PF. Which are the DB2 tools to protect Integrity of the database? Ans:Journaling & Commitment Control, Referential Integrity Embedded SQL & Object/Record Locks. What are the different Opcodes available in RPG for Database access ? Ans:READ, CHAIN, WRITE, UPDAT, DELET, SETLL, SETGT, READE, READP, REDPE, OPEN, CLOSE, FORCE, NEXT, UNLCK. How can database records be read without lock ? Ans:Put 'N' in position 53 of C specs. What does CHECK opcode do ? Ans:The check operation verifies that each character in the base string (factor 2) is among the ` character indicated in the comparator string(factor 1). In conjunction with which statements can ORxx and ANDxx conditions be used ? Ans:DOUxx, DOWxx, IFxx, and WHxx. What does opcode POST do ? Ans:Puts information in INFDS. Can you have multiple key lists for a single file ? Yes. What are the different types of arrays available in RPG ? Ans:Pre-execution time array. Compile time array. Execution time array. Can we define Multi-dimensional arrays in RPG ? Ans:No. What is XFOOT opcode ?

Ans:Adds all the elements in a numeric array, and places the sum in the result field. During input operation which indicator position is seton if there is a record lock? Ans:LO indicator position is seton. What is the difference between *LIKE and *NAMVAR ? Ans: *LIKE defines the variables as in database. *NAMVAR is used to define variables as data area. What would be the effect on the field where reverse image, underline and highlight display attributes are active ? Ans:The result is same as if you had specified ND. What is the purpose of OVRDTA and OVRATA keywords ? Ans:OVRDTA keyword (field or record level) can be used to override the existing data contents of a field or record already on the display. OVRATA keyword (field or record level) can be used to override the existing display attributes of a field or record already on the display. What keyword must be used with PROTECT keyword ? Ans:OVERLAY What is RPG ? Ans:Report Program Generator. Where will control be passed after the execution of the *PSSR subroutine if the factor2 of the ENDSR is blank ? Ans:Control will return to the next sequential instruction. What is the maximum number of subfiles that can specified in a display file ? Ans:512 The maximum number of subfiles that can defined in a RPG program for one display file is ___ . Ans:24 The maximum number of subfiles that can be active for a single file is ____ . Ans:12 What are the different opcodes used for file operation on a subfile in a RPG pgm? Ans:READ, READC, CHAIN,UPDAT and WRITE

How will you display a particular page in subfile ? Ans:Move a valid relative record number(RRN) in the field specified using SFLRCDNBR keyword in DDS. Can a single screen format occupy a screen area above and below a subfile format ? Ans:Not possible. What is SFLPAG and SFLSIZ ? Ans: SFLPAG : it is an attribute which specifies the number of records that can be displayed in a screen. SFLSIZ : it is an attribute which specifies the number of records can be stored in the subfile. How to pick up the changed records every time in a subfile after the first change made ? Ans:Seton SFLNXTCHG keyword indicator and update the subfile record. How do you specify the number of records to roll in a subfile ? Ans:Use SFLROLVAL keyword in DDS along with the number, which specifies the number of records to scroll at a time. What are the three line types in RLU ? Ans:Report line, Filler line & Sample line. What is the function of RLU ? Ans:To design & prototype a report.

Mainframe AS/400 Interview Questions ,Mainframe Realtime AS400 Interview Questions Part V ,AS400 Interview Questions How do you set pointers to values 55 or next higher or greater? Ans:SETGT. How will I explicitly open a file in an RPG program? Ans: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. What is maximum size of data area? Ans:9999. How to fire a JOB? Ans:SBMJOB.

How many levels of security are there on AS/400? Ans:There are 10 to 50 level of security on AS/400. How to translate field values form lower case to Upper case? Ans:By using opcode XLATE. What are the maximum parameters can be passed from one RPG program to another RPG program? Ans:255 What is the maximum length of an OCCUR? Ans:9999. What is a subfile? Ans:Subfile is a group of records which can be used for (Displaying, Adding new record, Modifying the existing record, and Deleting the existing records). What is maximum size of a subfile? Ans:9999. How do you write and read a value (similarly as EXFMT of RPG) using a display file in CL? Ans:SNDRCVF. How do you display a screen in CL? Ans:SNDF. How to check end of file in CL? Ans:Monitor the message ID (CPF0864). Can you update a file in CL? Ans:NO. Can you add a record to a physical file through CL? Ans:NO What opcode is used for submit job? Why it is used? Ans:SBMJOB opcode is used and it is used for background processing. How do you monitor message in CL? Ans:By using monitor message ID: (MONMSG MSGID (CPF0000) Except report design what else can be done by O spec?

Ans:We can write a Physical File from O spec. What is the full for of CA and CF? Ans:Command Attention and Command Function. Difference between WRKUSRJOB and WRKACTJOB? Ans:All the jobs in WRKUSRJOB are seen including Active jobs where as in WRKACTJOB only active jobs are seen. What are the three levels of SDA? Ans:File level, Record level, Field level. What is *PSSR? Ans:It is a system subroutine which is executed by default when any error occurs in a program. How many maximum parameters can be passed from on RPG program to another CL program? Ans:40 How many maximum arrays can be used in a single RPG program? Ans:200. How many maximum loops can be used in a single RPG program? Ans:100 How many maximum printer files can be used in a single RPG program? Ans:8 Why do we define MOVE *ON *INLR? Ans:It frees the memory. All the fields and parameters in the memory will become blank. How do you shutdown your IBM server? Ans:PWRDWNSYS. If your workstation does not show login screen what might be the problem? Ans:Problem with some subsystem. You have given a job for printing and you are not getting the printout what might be the reason? Ans:Some more pending jobs might be there in Job Queue. There are multiple jobs for printing in job queue and you want to print a important document then what will you do? Ans:Change the priority or change the job queue name.

Tags:IBM AS400 Realtime Interview Questions Answers and Explanations ,AS400 AS-400 Realtime Interview Questions Answers,Mainframe AS400 ,AS-400 Interview Questions How to see the CPU usage? Ans:WRKACTJOB or WRKSYSSTS While designing the screen, F3 function key is kept common for all record formats. On which level should it be defined? Ans:File Level Write down any two mandatory keywords used when defining a subfile? Ans:SFLDSP, SFLDSPCTL, SFLCTL, SFLSIZ, SFLPAG. While designing the screen user wants to add file level keywords, then which function key should be pressed? Ans:F14. Which Function key should be pressed to define hidden field while you are working with SDA? Ans:F4 Which function key should be pressed to watch all strings defined on the SDA screen? Ans:F20 While designing the screen using SDA, which function key should be pressed to get the field from the field reference file? Ans:F10 From work with member using PDM screen you have to modify existing member using SDA, which option do you select? Ans: 17 While designing the report using RLU, user wants to add record level keyword then which function key should be pressed? Ans:F18. If user wants to add one field on the report then which function key should be pressed? Ans:F11. 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? Ans: &3L

If user wants to center the company name on his report then which line command will be used? Ans: CF. If user wants to change the length of the numeric field defined in report then which combination of keys will be used? Ans:F23 & F10. What is difference between SKIPB (2) & SPACEB (2). If user wants to define new numeric field on record format then which line command will be used? Ans:VF. Maximum report length is 132, if user is designing a report using RLU? Ans:FALSE (378 Max). To change constant field defined on RLU screen which field level keyword should be used? Ans:DFT Which field level keyword should be used to change any numeric field of length 8 to 99.99.9999 format? Ans:EDTWRD ( . . ) Using Query, its also possible to create level break reports. Ans:TRUE. Types of Libraries on As/400? Ans:There are 3 types of libraries on As/400 they are System (*sys), User (*test) & Product (*prod). Type of Source File & Physical File? Ans:Source File: - *PF/SRC Physical File: - *PF/DTA Whats the use of STRPDM? Ans:To work with Libraries, Objects, Members & User Options. In which Specs can PF be made internally? Ans:In I Specs. What is the format of As/400 Commands? Ans:Verb Object Qualifier Verb: - action Object: - on which action is performed Qualifier: - identifies your job What is externally described file?

Ans:A file, which is created externally & described in the program, is called as external described file. What is Qualified & Unqualified path? Ans:Qualified path means mentioning object name along with library name while Unqualified path means directly writing the object name. Which path a good programmer should use? Ans:Unqualified path. How many types of files are available on As/400? Ans:There are 2 types of files on As/400 they are Databases files & Device files.

IBM AS400 RPG Interview Questions, Answers, and Explanations,AS400 Realtime Interview Questions Answers What is Logical File? Ans:A Logical file is an Access path to the Physical File. How can you specify no duplicate key? Ans:By defining the unique key. What is the command to know how many LF are related to a PF? Ans:DSPDBR (Display Database Relationship) What is the command to know key fields of file? Ans:DSPFD (F4) *ACCPTH(Access Path). What is a Join Logical File? Ans:A join Logical File can be built over the two PFs, with the PFs joined by a common key value. It is available for read access. Can a Join Logical File be updated? Ans:No. Using DFU, user will be able to ___________ from Physical File? Ans:Add/Update/Selected or all fields. What is the difference between normal UPDDTA to PF and updating using DFU program? Ans:Both are same only difference is DFU allows you to add or change selected fields. What is Library?

Ans:A library is a system object that serves as a directory to other objects or collection of object What is Library List? Ans:A jobs library list defines the path of libraries that the job follows when trying to locate programs, files or other As/400 objects. Difference between Source Physical File & Physical File? Ans:Source Physical File contains members who contain source statements & Physical File contains members, which contain data. What is the object type of PF, LF, Printer file & Display file? Ans:*File What are the different methods to access SEU? Ans: 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? Ans:RPG, CL, PF, LF, PRTF & DSPF. In which Specs Arrays, Tables & Constants are defined? Ans:In I Specs. What is a Spool File? Ans:Printed output items placed in an output queue are known as spooled files. How many Specs are there in RPG & Which are they? Ans:There are 7 Specs in RPG they are H, F, E, L, I, C & O. What is the difference between GOTO & EXSR? Ans:EXSR is a conditional branching while a GOTO is an unconditional branching. Difference between CA & CF? Ans:CA: - It does not retains the value into the buffer memory. CF: - It retains the value into the buffer memory. What does EXFMT does? Ans:Write & Read. What does the OVRDBF command do? Ans:It overrides the PF temporarily for a job. How does the RUNQRY show the output? Ans:RUNQRY shows the output always in RRN (Relative Record Number) & not in keyed sequence.

How many printer files maximum can be used in single RPG program? Ans:8 because of the overflow indicators OA-OG & OV. When you are defining a flat file in your program in F Specs which format will you specify? Ans:Flat File: - F (Fixed Length) Other File: - E (Externally Described) Difference between skip before & space before? Ans:Skip before leaves the specified no. of lines moving to the next page while Space before leaves the specified no. of lines on that page. Which indicator is used for Read? Ans:EQ (Equal to) How many types of display are available on As/400 for user interaction? Ans:4 Types they are Entry, Menu, Information & List Display. Which is the Primary Editor of As/400? Source Entry Utility (SEU). What are the basic features of SEU? Ans:Prompt depending upon type, shows right hand side date & left hand side the line number. Which are the figurative constants used in RPG? Ans:*ZERO,*BLANK, *ZEROS, *BLANKS, *HIVAL, *LOVAL, *OFF, *ON & *ALL. What is the syntax for PLIST? Ans:*ENTRY PLIST PARM What are indicators? Ans:Indicators are inbuilt class of variables for RPG. What is CAB? Ans:It compares Factor1 with Factor2 & if condition is true, control is transferred to label designated in the result field. The label specified must appear as the Factor1 of a TAG operation somewhere in the program. Which are the Relational Operators in RPG? Ans:GT, GE, LT, LE & EQ. In O Specs what is the opcode for write? Ans:EXCPT. What does LOKUP does in Tables & Arrays? Ans:The LOKUP opcode searches the Factor1 entry in table or array.

File Access Opcodes? Ans:READ, SETLL, SETGT, READE, READP, READPE CHAIN, KLIST, KFLD, EXCPT & WRITE. What is RPG Fixed Logic Cycle? Ans:A logic the compiler supplies is called RPG Fixed Logic Cycle. Difference between Interactive & Batch Job? Ans:Batch job begins, runs & continues to execute instructions without human intervention or control while Interactive job are user driven. How can we run a Batch Job? Ans:SBMJOB Command.

Tags:AS400 Interview Questions,Mainframe Interview Questions on AS400,Mainframe AS400 Interview Questions What is arrival sequence? Ans:The records will be accessed the way in which records are added to physical file. How many specifications are there in RPG/400? What are they? Ans:There are seven specifications are exits in RPG/400. They are listed below: * Header Specification ,* File Description specification ,* Extension specification * Line counter specification ,* Input specification ,* Calculation specification ,* Output specification When do you use F-spec. continuation line ? Ans: * In order to refer the named record format as a subfile record format in the program. * In order to rename the record format of a database file in a program. * In order to define a named data structure as a file information data structure. What are the various types of device files? Ans:Display files, printer files, discket files, tape files etc. , When do you explicitly open files and close files in an RPG program? Ans:If you specify the letter ' U ' at column 73-74, you need to be open and close files explicitly in a RPG program. How do you know that records are locked? Ans:By using a command WRKOBJLCK. What is the purpose of Indicators in RPG? Ans:In order to control the logic flow, we can use indicators in RPG.

How do you read data area in an RPG program? Ans:With the help of 'IN' opcode, we can access the data area record in to the program. What are the different types of Data Areas? Ans: The different types of Data Areas are general data area, local data area, group data area, pip (program initialization parameter data area) data area. *General Data Area - It can be created by user implicitely or explicitly It can be referred by any other jobs. It can be associated with a library. It can be created, deleted by the user. * Local Data Area - It can not be referred by any other job. It is automatically created and deleted by the system. It is not associated with any library. *Group Data Area - It is automatically created and deleted by the system We can access the group data area value through clp. It is meant for group jobs. *Pip Data Area - It is meant for pre start jobs. What are various techniques to pass parameters from one program to another? Ans:PLIST, CALL, TFRCTL Which single RPG opcode performs both SETLL and READE? Ans:CHAIN What is term CUA , SAA? Ans:Common User Access System Application Architecture Why is AS/400 called Object Oriented Machine? Ans:Everything on the AS/400 System that can be stored and retrieved is contained in the object. What is the version of OS/400 that we have? Ans:V4R2 (Version 4. 0 Release 2. 0) What is DDM ? Ans: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. What is an Object? Ans:An object is any thing that exists in and occupies space in storage and on which operation can be performed. How are the objects stored on AS/400? Ans:All objects are stored on AS/400 in a single level storage. In this method all objects are referenced by one virtual address which is translated in to a physical address whether it is an auxiliary storage or

main memory. What is a Library in AS/400? Ans:A library in AS/400 is an object that serve(acts) as a repository for other objects. Name few IBM supplied libraries? Ans:QGPL, QTEMP, QSYS, QUSRTOOL, QCBL, QRPG What is library list ? Ans:A list that indicates libraries used for the process and the order in which it has to be searched System identifies it in *LIBL. How many libraries can be there in library list ? Ans:Total 40 (15 system and 25 application) What is Folder? Ans:A Folder is a named object that is used as a directory for documents and other folders. Folders can be filed with in another folder.

What is Spool file, Why is it required? Ans:A file that holds output data to be processed, such as information waiting to be printed. What is Job, What are the attributes of a Job? Ans: A Job is a basic unit of work on AS/400. 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. What is Job description? Ans:A Job description defines an environment in which a batch job or an interactive job to be executed. What is the difference between Interactive & Batch Job? Ans: Interactive Job: A Job started for a person who signon to a workstation. Batch Job : A predefined group of processing actions submitted to the system to be performed. What is Group Job? Ans:A Group Job is attached to one workstation and a user. There should be an initial group job and it can be branched to many other group jobs. The group jobs can have different library lists and different output, message queues. Group Job is useful in enhancing the programmers productivity. It is as though logging into the same user-id many times. What are the two main attributes, which govern the execution of a job? Ans:Run time priority and Time slice

What is Sub-System? Ans:Sub-Systems are specific user defined partitions of the CPU where various jobs may be executed. One subsystem can have more than one active job at a time. What is a Device file? Ans:A device file contains the description of how data is to be presented to a program from a device or vice versa. Device file can be Printer, Disk, Tape and Remote system. What is the maximum number of key fields allowed defining in a physical file? Ans:120 What is acronym of RPG? Ans:Report Program Generator What is the native language of AS/400? Ans:RPG/400 Why RPG/400 is famous? Ans: * Easy to code and analyze. * Supports externally described files. What is an ICF file? Ans:A device file that allows a program on the system to communicate with program in other system. What is a message file? Ans:It is a file which contains the messages of an application. For example all RPG/400 messages are stored in a file, all COBOL/400 messages are stored in a file. What is a job log? Ans:A record of request submitted to system be a job. The message related to the requests, and action performed by the system on the log. The system program maintains it. What is the purpose of OPNQRYF (Open Query File)? Ans:OPNQRYF is used to select certain records of the database file based on the QRYSLT (Query select ) condition. How to create files dynamically without DDS? Ans:Through OPNQRYF What command must be executed before executing OPNQRYF command? Ans:OVRDBF (Override Data base file) What is Data Area? Ans:Data area is an object used to hold data for access by any job running on the system. A data area can be locked to a single user, thus preventing other users from processing at the same time.

What are the types of data areas? Ans:User defined Data Area, Local Data Area (LDA), Group Data Area (GDA), Program Initialization Parameter (PIP) Data Area. What is LDA? Ans:LDA is created by the system for each job in the system, including auto-start jobs, jobs started on the system by a reader, and subsystem monitor jobs. What is the type, length of a LDA? Ans:*CHAR, 1024 bytes What is GDA? Ans:The system creates a GDA when an interactive job becomes group jobs. Only one GDA can exists for group. How can a data area be locked after being updated? Ans:Using OUT *LOCK What is the use of Data Queues? Ans:Data queue is a type of system object that you can create. Data Queues are used in Program to program communication. How to create a data queues? Ans:Using CRTDTAQ command. What are the valid data types in Data Queue? Ans:Char, Numeric, and Logical What are the two types of read performed on data queues? Ans:Read with lock, and read without lock. How do you use DEBUG utility? Ans:STRDBG program-name UPDPROD(*YES) What is an authorization list? Ans:A lists of two or more user Ids & their authorities for system resources. The system identifies it an object type *AUTL How do you grant authority? Ans:Using GRTOBJAUT command What are the types of object authorities? Ans:*USE, *CHANGE, *ADD, *DLT, *READ, *UPD, *ALL, *EXCLUDE, *OBJEXIST, *OBJMGT, *OBJOPR How do you put jobs in batch mode? Ans:SBMJOB What is the use of OVRDBF ?

Ans:You can use the Override with Database file (OVRDBF) command to replace the database file named in a CL program or to change certain parameters of the existing database file. What is the use of OVRPRTF ? Ans:Override with Printer file (OVRPRTF) command is used to override certain parameters of the printer files used in the program or to replace the printer file. How to change file attributes such as size, file wait time, record wait time etc. , permanently? Ans:Using CHGPF command What is the use purpose of CRTCMD? Ans:To create user defined command. What is class of service ? Ans:A set of link and node characteristics associated with a session. How to see active jobs of the system. Ans:Using WRKACTJOB command How do you detect unused spool storage? Ans:Using Reclaim Spool Storage. What are the functions of Remote Job Entry (RJE) ? Ans:Allows user of AS/400 system to submit jobs and receive jobs from a host system. What is the function of RJE Conversion Utility? Ans:It converts compressed data written to an AS/400 database file to decompressed data written to another AS/400 database, diskette, or device file. What process the command SBMRJEJOB does? Ans:Sends RJE input stream to host system What is journaling & Commitment Control? Ans:Journaling is a function which records the changes in a file in a journal. These record images are used to recover the changes in the file should the system ends abnormally. Commitment control is a function that allows you to define and process a number of changes to database files as a single unit (transaction). What is the purpose of STRCMTCTL command? Ans:Starts commitment control for files that are being journalled. What are the system objects required for journalling? Ans:Journal receiver, journal and PFs to be journalled. What are the different definition levels in Data Description Specifications? Ans:File level, Record level, Field level, Join level, Keyfield level, Select/Omit level. What the difference between Source Physical File and Physical File?

Ans:A Source Physical File contains the source for the various objects created this file has specific structure. A Physical File contains data, and the record format can be different for different physical files. What is an access path? Ans:The order in which the database fields are organized for processing in the program. What are all the different types of access path? Ans:Arrival sequence access path. Keyed sequence access path. What is the default value for the number of increment for the physical file? Ans:Three When does the DFT keyword in PF be used? Ans:To specify the default value it a field. How to create a user defined (general) data area? Ans:Using CRTDTAARA command What are the different ways to input data into data area? Ans:CHGDTAARA (using CL) Using OUT opcode in RPG How to retrieve data from data area? Ans: Using RTVDTAARA command in CL. Using IN opcode in RPG

Difference between CALL & SBMJOB? Ans:CALL performs interactively job while SBMJOB performs batch job. Maximum number of Records in Display File? Ans:1024 What does VLDCMDKEY means? Ans:Valid Command Key. What is Subroutine in RPG? Ans:A subroutine is a group of statements in a program that can be processed several times in that program. Do we have to Execute the *INZSR compulsory? Ans:No, it is a system-defined subroutine it is executed automatically. What is the use of *PSSR in the program? Ans:Whenever there is any type error in the program the control straight away passes onto this

subroutine. Types of Tables in RPG? Ans:There are 2 types of tables in RPG they are: - Compile Time Tables Pre-Runtime Tables What is the error if we dont get login screen? Ans:There is some problem with subsystem. How to run other job when one job is active? Ans:Change the priority or rename the job. Use of Data Structures? Ans: Dividing a field into sub fields. Changing the format of a field. Grouping non-contiguous data in a contiguous format. Defining an area of storage in more than 1 format. Types of Data Structures? Ans: a. File Information Data Structure. b. Program Status Data Structure. c. User Defined Data Structure. d. Multiple Occurrence Data Structure. e. Date Area Data Structure. What is Subfile? Ans:A Subfile is a temporary area in memory which records may written to & read from a display file device. Which is the subsystem that is always on till the main power switch is off? Ans:QCTL What is the command to shutdown the As/400 Server? Ans:PWRDWNSYS & Parameter *IMMED. How can we know the CPU utilization of the server? Ans:WRKACTJOB (Work with active job) WRKSYSSTS (Work with system status) Which are the libraries (system) always present in the library list? Ans:QTEMP & QGPL Which users are allowed to manipulate system libraries? Ans:QSECOFR & QSYSOPR What is a Join Logical File? Ans:A Join Logical File combines information from two or more physical files into one record format. Join Logical Files have

always one record format. Types of Object Locks & what they do? Ans: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. *SHRUPD : All jobs can read/update the object. How do you place or remove locks on the objects? Ans:*AACOBJ & *DLCOBJ Some of the object types on which locks can be allocated? Ans:Data Area, Data Queue, File, Library, Message Queue, Menu &Program. What is the opcode to release all the locks on a particular PF? Ans:UNLCK What is a trigger? Ans:A trigger is an action that automatically occurs whenever a change Is made to a physical file. How many triggers can be associated with a single PF? Ans:6 (max) Can the objects stored in the product library be modified? Ans:No. How many types of objects are there on As/400? Ans:80 How is data stored in PFs? Ans:In fixed length records. Give an example of DEFN opcode? Ans:*LIKE DEFN ENAME $ENAME (Now the $ENAME has all the attributes same like ENAME) What is DBMS? Ans:A DBMS is a software system that controls the creation, organization & modification of a database & access to the date stored within it. How can we know the triggers associated with the PF? Ans:DSPFD with parameter TYPE (*TRG) How can we add & remove trigger to a PF? Ans:ADDPFTRG & RMVPFTRG What is an Output Queue? Ans:They are the holding areas that store printed output generated from Batch programs or Interactive applications.

What does print writer do? Ans:It is a system job that selects files from the output queue & prints Them on a printer. It provides the interface between output queues Spooled files & the printer. What are the 2 types of lines on O Specs? Ans:Record Identification Line & Field Identification Line. How can we add & remove trigger to a PF? Ans:ADDPFTRG & RMVPFTRG What is an Output Queue? Ans:They are the holding areas that store printed output generated from Batch programs or Interactive applications. What does print writer do? Ans:It is a system job that selects files from the output queue & prints Them on a printer. It provides the interface between output queues Spooled files & the printer. Can a Subroutine contain another Subroutine? Ans:No. Does the SETLL & SETGT retrieve the record? Ans:No, they simply position to the record. What is a table? Ans:A table is collection of data elements in one column, data elements Must be of same type and same length. What is a Compile Time Table? Ans:We can hard code data within the program is said to be Compile Time Table. What is a Run Time Table? Ans:Data from a separate disk file is loaded into a table each time the Program runs. Give the Table definition? Ans:TABMT 1 12 2 A Where 1 = 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? Ans:Compile Time Table. What does the members in a Source Physical File contain? Ans:Source statements for a program.

The members in LF contain? Ans:Access Path. The members in a PF contain data? (True/False) Ans:True What is the command to view the library list? Ans:DSPLIBL What is the command to create PF? Ans:CRTPF The LF is associated with how many PFs? Ans:At least one PF at a time.

What is Alternate Table? Ans:RPG tables stores information in 1 column. To store information in multiple columns, it uses the concept of Alternate Table. What is an Array? Ans:Array is a collection of data, the data elements must be of same Length and same type. The Qualified name for an object ORDPF residing in a library TRAINING is? Ans:TRAINING/ORDPF The function key to start SEU session through program development manager is? Ans:F6 The Member type for an RPG & CL program which SEU supports is? Ans:RPG & CLP Printed output items placed in an output queue are known as? Ans:Spool Files. When a spooled file is created, it is placed into an? Ans:OUTQUEUE The command to display a list of spooled files? Ans:WRKSPLF Change in the externally described file does not require recompilation of the program? Ans:False Command to display current library is? Ans:DSPCURLIB

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

select? Ans:17. Write system defined function used to place system name on the screen? Ans:*SYSNAME While designing screen F3 function key is kept common for all record formats on which level should it be defined? Ans:File level Write down mandatory keywords used when defining a subfile? Ans:SFL, SFLDSP, SFLSIZ, 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? Ans:F23 & F10 What is the difference between SKIPB (2) & SPACEB (2)? Ans: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. RLU: If user wants to define new numeric field on record format then which line command will be used? Ans:VF Maximum report length is 132, if user is designing a report using RLU? Ans:FALSE (Maximum is 378) What is full form for DDS? Ans:Data Description Specification What are members? Ans: Members are separate entities within a database file & they are components of As/400 object. What if RPG, when & who invented it? Ans:Report Program Generator is IBM introduced a High Level Language in 1960. For, which purpose is H Specs used? Ans:Writing header information, date separator, currency symbol etc. What is the size of the filename in RPG? Ans:8 Characters (Max.) Which are the different File Types in RPG? Ans:I (Input), O (Output), U (Update) & C (Combine). What are the different File Designation Types in RPG? Ans:P (Primary) & F (Fully Procedural)

Whats the use of File Designation in RPG? Ans:It refers to the way program will access or retrieve the data from the file. What are the different File Format Types in RPG? Ans:F (Fixed Length) & E (Externally Described) What is the use of File Format in RPG? Ans:It tells to the program that the records are within the program (F) or outside the program (E). What is L Specs for? Ans:To tell length of page & number of lines to be printed on a page. What is I Specs for? Ans:To describe the records within Program described file, fields, constants, divide fields into sub fields & to form a group of fields. How many maximum spaces could be given in O Specs? Ans:3 Which are Control Break Logic indicators? Ans:L1 L9. What are Data Structures? Ans:Data Structures define an a storage & layout of fields within the defined structure.