Top Banner
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. 1
34
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: AS400 FAQ

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:255What 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 theexisting 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:NOWhat 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:40How 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:100How many maximum printer files can be used in a single RPG program?Ans:8

1

Page 2: AS400 FAQ

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.How to see the CPU usage?Ans:WRKACTJOB or WRKSYSSTSWhile designing the screen, F3 function key is kept common for all record formats. On which level should it be defined?Ans:File LevelWrite 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:F4Which function key should be pressed to watch all strings defined on the SDA screen?Ans:F20While designing the screen using SDA, which function key should be pressed to get the field from the field reference file?Ans:F10From work with member using PDM screen you have to modify existing member using SDA, which option do you select?Ans: 17While 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: &3LIf 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:DFTWhich 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

2

Page 3: AS400 FAQ

What’s 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 jobWhat 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.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 PF’s, with the PF’s ‘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 objectWhat is Library List?Ans:A job’s 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?

3

Page 4: AS400 FAQ

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 thespecified 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 PARMWhat 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 labelspecified 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?

4

Page 5: AS400 FAQ

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 whileInteractive job are user driven.How can we run a Batch Job?Ans:SBMJOB Command.What is the maximum number of records you can specify in a display file?Ans:1024How can a screen field that has changed since the last output operation be detected ?Ans:Attach the MDT (modified data tag) attribute to the field, to detect whether field has been changed as a result of user input.What would be the effect on the field where reverse image, underline and highlight display attributes were active?Ans:The result is same as if you had specified ND.What is the use of DSPATR(MDT) keyword?Ans:Sets on the modified Data Tag of the field. The Data Tag detect whether the field has been changed as a result of user input.If DSPATR(PC) and CSRLOC were specified for a format, which keyword would have priority?Ans:CSRLOC gains priority.Can error messages as a result of a COMP, RANGE or VALUES keyword be overridden?Ans:Yes, through CHKMSGID keyword.What the purpose of OVRDTA, 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.How can a message from a message file appear as a constant on the screen?Ans:By using MSGCON (message constant) keyword.In conjunction with what other keyword must OVRDTA and OVRATA be used?Ans:PUTOVR keyword must used.What is the purpose of the INDARA keyword?Ans:This File-level keyword is used to remove option and response indicators from the buffer and places them in 99-byte separate indicator area.Explain the purpose of KEEP and ASSUME keywords?Ans:KEEP: Keep the display from being deleted when the display file is closed.ASSUME: It is used to specify that the OS/400 program is to assume that this record is already shown on the displaywhen this file is opened.Explain the use of DFTWRT display keyword?Ans:No records will be displayed until there is any I/O operation.What is the purpose of FRCDTA keyword ?Ans:Immediately display a record format without waiting for the next I/O operation.What keyword must be used with PROTECT keyword?Ans:OVERLAYWhat is Subfile?Ans: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 all the contents of subfile?Ans:Subfile Record Format, Subfile Control Record Format, Relative Record Number, Subfile Record Number, Associated Subfile Keywords.

5

Page 6: AS400 FAQ

What are the two record formats a subfile contain ?Ans:Subfile record forma (SFL), and subfile control record forma (SFLCTL).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 subfile.What is the maximum number of subfiles that can be specified in a display file,Ans:512Maximum number of subfiles that can Defined in a RPG program for one display file isAns:24Maximum number of subfiles that can be active for a single file is?Ans:12Can more than one subfile record be displayed on one line?Ans:Yes, by using SFLLIN keyword.How do you specify the number of records to roll in a subfile?Ans:Use SFLROLVAL keyword in DDS along with number, which specifies the number of records to scroll at a time.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.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.What is the use of SFLEND keyword?Ans:By specifying this keyword, the Bottom/More message could be displayed at end of screen.How to toggle between single line and Multi - line display of a particular record in a subfile?Ans:Using SFLDROP keyword.Explain the difference between defining Subfile and Message-subfile?Ans:Subfile record is defined by SFL keyword, where as Message subfile is defined by SFLMSG keyword.What are the different types of variables available in CL?Ans:DEC, CHAR, LGLHow do you pass parameters in CL?Ans:Using PARM keyword.What are the valid user defined data area types?Ans:CHAR, NUMERIC and LOGICALWhat is Multi-format logical file?Ans:Logical which uses fields from two or more physical files.What is the Select and Omit criteria in logical file?Ans:This is used to specify rules for the Selection/Omission of records from a Physical File.Can fields be concatenated INa logical file level?Ans:Yes. by using CONCAT keywordWhen would the ALL keyword be used?Ans:Use with Select or Omit, to select/omit records.What are the different types of keywords in display files?Ans:File level, Record format level, Field levelWhat is difference between CAT, TCAT, BCAT?Ans:CAT - Concatenate two variables or constants into one continuous string.BCAT - Truncates all trailing blanks in the first character string, one blank is inserted, then the two character stringsare concatenated.TCAT - Truncates all trailing blanks in the first character string, the two character stringsare concatenated.

6

Page 7: AS400 FAQ

What are the different types of messages in CL?Ans:Immediate message, Break message, Program message, User messageHow to trap errors in CL?Ans:By using Monitor Message Command (MONMSG)What is the maximum length of a variable name in CL?Ans:Maximum 11 characters (including '&')What are the limitations of CL (compare to RPG) ?Ans:You can not use CL program to ADD or UPDATE records in database files.Use Printer or ICF files.Use Program described files.Use the concept of subfile (to display more than one record), but a single output message subfile is a special type ofsubfile that is supported well in CL.Use subroutines.You cannot declare more than one object (file) in a CL programme.What is the use of Header Specification in RPG/400?Ans:It identifies by H in column 6, provides informaion about generating and running programs.When will DUMP and DEBUG opcodes be ignored?Ans:If blank is specified in position 15 of H specs.Specify different indicators used in RPG?Ans:Overflow indicatorsRecord Identifying IndicatorsField IndicatorsResulting IndicatorsControl Level IndicatorsWhat are Control level indicators?Ans:L1 to L9 used to identify certain fields on control fields and then used to condition which operations are to be processed at detail or total calculation or output time.What is the use of E specification in RPG?Ans:Extension Specs describes all record address files, arrays and tables.What is the use of L specs in RPG?Ans:Line counter specification can be used to describe printer file to indicate the length of the form and number of lines per page.In which specification the report layout can be defined?Ans:O Specification.How many files can be defined in F specs?Ans:50How many printer files can be defined in F specs ?Ans:8Give three main purposes of File specification ?Ans:To define files, to describe the files, to assign the files to specified devices.How do you specify page overflow indicator for printer files in RPG?Ans:Specify an indicator in position 33-34 of F specification.What is a Primary File?Ans:It is used in RPG Program Cycle to automatically read records in a cycle.Can a indexed file be accessed in arrival sequence in RPG program?Ans:Yes.

What opcode could be used to test an alphanumeric field for all numeric values?Ans:TESTNWhat opcode will be used to test the zone of a character field?Ans:TESTZ

7

Page 8: AS400 FAQ

How to read database records without locking them?Ans:Put 'N' in position 53 of C specs.What does CHECK opcode is used?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).What does 'SR' in columns 7-8 of C specs mean?Ans:Calculation operation is a part of RPG subroutine.What is SCAN and XLATE?Ans:SCAN operation scans a character string (base string) contained in factor 2 for a substring (compare string ) contained in factor 1.XLATE operation translates characters in source string (factor 2 ) to the from and to strings (factor 1 ) and put into the result field.How do you use commitment control in RPG program ?Ans:Using COMIT operation. 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).How do you use exceptional write in C specs?Ans:Using EXCPT opcode.What does the opcode FREE do?Ans:The FREE operation removes a program from the list of activated programs, frees static storage and ensures program initialization (first cycle processing) the next time program is called. It does not close file or unlock data area.What does opcode POST do?Ans:Puts information in INFDS.What is the maximum number of elements in an array?Ans:9999What is a Program Described file in RPG?Ans:The field name and length of the fields are defined with in the RPG program.What is externally described file ?Ans:All information about the fields is specified in DDS and the RPG program can use them with in the program.Can you specify a display file to be used in the following modes Input, Output, or Combined modes ?Ans:Yes.What is match field indicator?Ans: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?Ans:6 Characters.When is a TAG statement used in RPG?Ans:It is used as Label.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.How can we sort an array?Ans:By using SORTA opcode.What is Program Status Data Structure?Ans:A Program status DS can defined to make program exception/error information available to an RPG program.DS is defined as program status DS by an S in position 18 of the DS statement.*STATUS contains status code.*ROUTINE : contains name of routine in which the exception/error occurred*PARMS : contains the number parameters passed to this program from the calling program.What is the maximum number of times Multiple Occurrences DS can occur in a program?Ans:9999What are all the compiler directive statements?Ans:/TITLE, /SPACE, /EJECT, /COPYWhat is SAA?Ans:Systems Application Architecture (SAA) is a collection of selected software interfaces, conventions, and protocols that will provide a consistent framework across the System/370, AS/400 and PS/2.During execution, an RPG/400 program automatically follows a sequence of operations for each record that is processed. The built-in program cycle includes

8

Page 9: AS400 FAQ

the following logical steps.1. reading input (READ)2. processing calculations (PROCESS)3. writing output (WRITE)What is the Function of PDM?Ans:Productivity tool for copying, deleting, scanning, changing & creating source files.What is the function of SEU ?Ans:A utility for editing programming language source code.How can the user implicitly open and close the files in RPG program ?Ans:Enter UC in position 71-72 of F specs.Use OPEN and CLOSE opcodes in RPG program to open and close files.How many parameters can be defined in a RPG program. ?Ans:255What is File Information Data Structure?Ans:File Information Data structure (INFDS) can be defined for each file to make file exception/error information available to the program. A file information data structure contains predefined subfields that identify: the name of the file for which the exception/error occurred. the record being processed when the exception/error occurred or the record that caused the exception/error. The last operation being processed when the exception/erroroccurred.The status code. The RPG routine in which the exception/error occurred.What is the use of SDA ?Ans:Screen Design Aid is used to create display files interactively.What the purpose of the keywords FIFO, LIFO, FCFO?Ans:These keywords are used at file level. The purpose of each one is described below:FIFO: The duplicate key records will retrieved in first in first out order.LIFO: The duplicate key records will retrieved in last in first out order.FCFO: The duplicate key records will retrieved in first changed first out order.What is the difference between regular logical file and join logical file?Ans:Regular logical file contains more than one record format.Record format name in regular logical file should be same based on the physical file.Join logical file contains only one record format.Record format name in join logical file should be different.Through logical file we can made changes in physical file.Through join logical file we can't made changes in physical file.Distinguish between logical file and physical file?Ans:Physical file contains only one record format.Logical file contains more than one record format.Physical file contains actual data.Logical file doesn't contains data but it provides view from the physical file.What is field reference file?Ans:Field reference file is a file, which contains field definitions and descriptions, and it doesn't have member. Physical contains data derived by the field reference file.What is the difference between access path and Dynamic select?Ans:Dynamic select occurs whenever the program reads file. But access path occurs before the file is read (but not necessarily). Because access path maintenance performed on the file.Why would you prefer OPNQRYF than logical file?Ans:The main difference is : Logical file creates permanent object on the system. OPNQRYF creates temporary access path.What is the necessary keyword used in a physical file to refer field definitions from the field reference file?Ans:REF which is a file level keyword is necessary to define at file level in a physical file. The syntax is as follows: REF(library name/name of the field reference file)What is purpose of declarative statement DEFN?Ans:Depends on the factor 1 value it will do two things:* If the factor1is *LIKE then DEFN opcode defines the new field based on the attributes old field. * If the factor 1 is

9

Page 10: AS400 FAQ

*NAMVAR then DEFN opcodes defines the field as a data area.What is the purpose of SFLNXTCHG keyword in a subfile?Ans:Which is a subfile record format keyword. If you perform read on the subfile, theinternal indicator MDT (modified data tag) is automatically set off by the system. If you again perform read on thesame records, records won't be read. Because internal indicator MDT would be off. Hence you should be explicitly seton the MDT by SFLNXTCHG keyword.What is the difference between Array and Table?Ans:Array: Array is stored any where in the body of the input records.Table: Table is stored at the begining of the input records.Array: We can access all the elements in array by specifying the array name.Table: Only one table element can be accessed at a time.Array: Array can be searched randomly.Table: Table can be searched consecutively.What are the different types of access paths maintained on the file?Ans:Immediate: All the access paths (open and close) associated with a file will be updated whenever changes made to a file.Rebuild- only open access paths will update whenever changes made to the file. Rebuild takes place whenever remaining access paths will be open.Delay : Rebuild will not takes place.What is the purpose of reorganizing the physical file i. e. , RGZPFM?Ans:Even if you delete the records in a physical file through the program, still the space used by the deleted records not used by the other purpose. Hence using RGZPFM command we can compress the deleted records space.What is the purpose of CHGPF (Change physical file) command?Ans:CHGPF command is used to change the attributes of a physical file. Attributes like* Maximum number of members* Member size* Level check enforced* Open data path is sharedHow can you identify End of file in CLP program?Ans:With the help of MONMSG MSGID(CPF0864) we can identify end of file in clp program.What is the difference between production library and test library ?Ans:In debug mode, the files exists in production library not allowed to update.In the other hand, the files exists in test library allowed to update.When will you use OPEN and CLOSE opcodes in RPG program?Ans:If you specify the letter "U" at columns 73 - 74 in a file description specification indicating that user control on a file. Hence we have to explicitly open and close the file in a program.What is difference between fully procedural file and primary file?Ans:In primary file the records will be read and processed from begining to end. 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.What is the difference between externally described file and program described file?Ans:The field definitions and descriptions are defined out side of the program in a externally described file. The field definitions and descriptions are defined in side the program in a program described file.How many primary files allowed in a program?Ans:Only one primary file is allowed in program.How many secondary files allowed in a program?Ans:More than one secondary files are allowed in a program.What is the purpose of RTVMBRD command?

10

Page 11: AS400 FAQ

Ans:In order to access the information related to member, we can RTVMBRD command.Define an Interactive Job?Ans:* A user requests a job.* Job is created and job name, job attributes are assigned.* Job is placed on a job queue.* The sub system QINTER takes the job from the job queue and starts processing.* The output generated by the interactive job is placed on the output queue* The spool sub system QSPL prints the output.How can you check the existence of object in a system?Ans:With the help of CHKOBJ clp command, we can find existence of object on the system.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.+data extracted')ENDDORTVDTAARA DTAARA(JBA001DT *ALL) RTNVAR (&FROMDATE)The execution of above steps is listed below:steps1: First it checks the data area object on the system.2: If the data area object not found, the MONMSG command executes withthe help of message identifier, next we can dynamically create the data area.3. If the data area object found, control transfers to statement below ENDDO.It is always good CLP programming approach to check the object before yourename, delete the objects on the system.What is the purpose of FRCDTA (Force Data) keyword?Ans:Use this record-level keyword to immediately display a record format, without waiting for the next input or output/input operation.What is the purpose of SFLFOLD and SFLDROP keywords?Ans:SFLFOLD: To fold the second line of multiple line subfile.SFLDROP: To drop the second line of multiple line subfile.What is the function of DSPATR (display attributes) keyword?Ans:Use this field level keyword in display file to specify one or more display attributes for the field you are defining. You can specify the DSPATR keyword more than once for the same field, and you can specify more than one attribute for the same keyword. The following are valid attributes:For All FieldsDisplay ,Attribute MeaningBL Blinking field ,HI High Intensity ,RI Reverse Image ,CS Column separator ,ND Non DisplayPC Position cursor ,UL UnderlineFor Input-Capable Fields OnlyPR Protect contents of field from input keyingMDT Set modified data tag when displayedOID Operator identificationSP Select by light penWhat is message subfile? Ans:Message subfile is special file contains multiple messages taken from program message queue and placed in message

11

Page 12: AS400 FAQ

sub file for display on the screen.What is the purpose of PUTOVR (Put with explicit override) keyword?Ans: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 are necessary keywords to code message subfile?Ans:SFLMSGRCD, SFLMSGKEY, SFLPGMQWhat is the difference between SETON LR and RETRN?Ans:If you specify SETON LR, all the files used in program will be closed.If you specify RETRN, all the files used in program will remain open.What is the purpose of OVRDTA (Override Data) keyword?Ans:Use this field level keyword with PUTOVR keyword to override the existing the data contents of a field already on the display.What is the maximum number of record formats in DSPF?Ans:1024 (One thousand and twenty four)What is the maximum number of fields under a record format of physical file?Ans:8000 (eight thousand)What is the maximum number of parameters allowed in RPG?Ans:255 (Two hundred and fifty five)What is the maximum number of parameters allowed in CLP?Ans:43 (Forty three)What is the maximum number of subroutines allowed in RPG?Ans:254 (Two hundred and fifty four)What is the maximum number of files allowed in RPG?Ans:50 (Fifty including eight printer file)What is maximum number of Arrays allowed in RPG?Ans:250 (Two hundred and Fifty )Where can you specify an indicator in LOKUP operation?Ans:In 'EQ' position.What is a Member?Ans:It is a subset of data records of a physical file.What is a Physical file?Ans:Physical file nothing but a table contains a only one record format in which we can describe the field definitions and descriptions.What is a Logical file?Ans:It is nothing but a logical view provided by the physical file.What is Join Logical file?Ans:Join logical file joins more than one file. The maximum of number of files allowed to join is 32 (thirty two).What are the necessary keywords for the Join Logical file?Ans:JDFTVAL, JFILE, JOIN, JFLD, JREF.What is a Non-join logical file?Ans:It only provides logical view based on the physical file. This is also called as regular logical file.What is the necessary keyword for Non-join logical file?Ans:PFILE (which is record level keyword)How many levels are there in a Physical file?Ans:Four levels. They are File level, Record level, Field level, Key field level.What is the use of UNIQUE keyword and what level it is defined?Ans:It will avoid to enter duplicate key values. We have to define it in a file level.At what level S,O are defined and what they will do?Ans:S, O are to defined at key field level. The purpose Select/Omit logic is depends on the criteria (condition) given at the

12

Page 13: AS400 FAQ

key field level (At function entry) it selects and omits the records. The S/O is allowed in Logical file only.What is the difference between Packed decimal and Zoned decimal?Ans:Packed decimal : One digit occupies 1 byte.Zoned decimal : One digit occupies 2 bytes.What is default data type (if you define decimals '0') in Physical file?Ans:Packed decimalWhat is default data type for the fields(sub fields) defined in data structures in RPG?Ans:Zoned decimalWhat is the use of JDFTVAL in join logical file?Ans:If you specify JDFTVAL at file level, even the primary file record does not match with secondary file record, the join takes place.Is it possible to create a physical file without DDS?Ans:Yes. With the help of CRTPF we can achieve this. But we have to give record length.What is a Keyed physical file?Ans:Defining a field as a key in physical file. Hence we can access records through the key field.What is a composite key?Ans:Defining more than one key as a key field in physical file.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 specificationWhen 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 explicitlyIt 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 systemWe can access the group data area value through clp.

13

Page 14: AS400 FAQ

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, TFRCTLWhich single RPG opcode performs both SETLL and READE?Ans:CHAINWhat is term CUA , SAA?Ans:Common User AccessSystem Application ArchitectureWhy 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, QRPGWhat 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 numberJob 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

14

Page 15: AS400 FAQ

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 sliceWhat 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:120What is acronym of RPG?Ans:Report Program GeneratorWhat is the native language of AS/400?Ans:RPG/400Why 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 OPNQRYFWhat 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 bytesWhat 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 *LOCKWhat 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

15

Page 16: AS400 FAQ

communication.How to create a data queues?Ans:Using CRTDTAQ command.What are the valid data types in Data Queue?Ans:Char, Numeric, and LogicalWhat 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 *AUTLHow do you grant authority?Ans:Using GRTOBJAUT commandWhat are the types of object authorities?Ans:*USE, *CHANGE, *ADD, *DLT, *READ, *UPD, *ALL, *EXCLUDE, *OBJEXIST, *OBJMGT, *OBJOPRHow do you put jobs in batch mode?Ans:SBMJOBWhat 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 commandWhat 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 commandHow 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 systemWhat 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?

16

Page 17: AS400 FAQ

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:ThreeWhen 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 commandWhat are the different ways to input data into data area?Ans:CHGDTAARA (using CL)Using OUT opcode in RPGHow to retrieve data from data area?Ans:Using RTVDTAARA command in CL. Using IN opcode in RPGDifference between CALL & SBMJOB?Ans:CALL performs interactively job while SBMJOB performs batch job.Maximum number of Records in Display File?Ans:1024What 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 TablesWhat is the error if we don’t 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.

17

Page 18: AS400 FAQ

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:QCTLWhat 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 & QGPLWhich users are allowed to manipulate system libraries?Ans:QSECOFR & QSYSOPRWhat 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 havealways 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 theobject *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 & *DLCOBJSome 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:UNLCKWhat 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:80How is data stored in PF’s?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 & RMVPFTRGWhat 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

18

Page 19: AS400 FAQ

betweenoutput queue’s 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 & RMVPFTRGWhat 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 betweenoutput queue’s 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 = AscendingSequeneIf 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:TrueWhat is the command to view the library list?Ans:DSPLIBLWhat is the command to create PF?Ans:CRTPFThe LF is associated with how many PF’s?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/ORDPFThe function key to start SEU session through program development manager is?Ans:F6

19

Page 20: AS400 FAQ

The Member type for an RPG & CL program which SEU supports is?Ans:RPG & CLPPrinted 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:OUTQUEUEThe command to display a list of spooled files?Ans:WRKSPLFChange in the externally described file does not require recompilation of the program?Ans:FalseCommand to display current library is?Ans:DSPCURLIBA PF can have how many record formats?Ans:Only oneWhich 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 libraryWhile designing the screen user wants to add file level keywords then which function key is pressed?Ans:F14While designing the report using RLU user wants to add record level keywords which function key is pressed?Ans:F18If user wants to add one field on the report then which function key is pressed?Ans:F11If 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 TypeIt is possible to run Query using RUNQRY command?Ans:YESUsing Query it is possible to create level break report?Ans:YESUsing DFU user can do which operation?Ans:Add, Update & Select fieldsWhat is the difference between UPDDTA to PF & updating using DFU?Ans:Both are same, only difference is DFU program allows you to add & update selectedfields.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:F20While 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:*SYSNAMEWhile designing screen F3 function key is kept common for all record formats on which level should it be defined?Ans:File level

20

Page 21: AS400 FAQ

Write down mandatory keywords used when defining a subfile?Ans:SFL, SFLDSP, SFLSIZ, SFLCTL & SFLPAGIf 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 & F10What 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:VFMaximum 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 SpecificationWhat 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)What’s 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:3Which 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.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?

21

Page 22: AS400 FAQ

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 STAT01I 'OPEN' C STAT02Ans: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 debuggingAns: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 ORDHISTb. The file ORDHIST may or may not existc. If the file ORDHDR does exist, it may or may not contain datad. The file ORDHIST may or may not contain data, if the file does contain data the old data should be erasedAns:Commands are as followsa. CPYF FILE(ORDHDR) TOFILE(ORDHIST)b. CPYF FILE (ORDHDR) TOFILE (ORDHIST) CRTFILE (*YES)c. CPYF FILE (ORDHDR) TOFILE (ORDHIST) *ADDd. CPYF FILE (ORDHDR) TOFILE (ORDHIST) *REPLACEWhat is the purpose of the following?FORDHDR1 IF E K DISKORDHDRF KRENAMEORDHDRF1Ans: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 followingAns:C/COPY QRPGSRC,ORDERRDuring 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 followingAns:FORDHDR1 CF E WORKSTN

22

Page 23: AS400 FAQ

$2SFN SFILE FMT2The 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 followingI UDSI 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 EQC CALL 'CVTDAT' DTPRM 66Ans:The above statement causes, call the program and pass the parameter.Define each of the following operation codesa. READ To read the records sequentially.b. READE To read the equal key recordsc. READP To read the previous recordsd. 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 EQC *IN66 DOUEQ *OFFC KEY1 CHAIN FILEA 90 66C 66 CALL PGM1 PRMC ENDDOAns: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.

23

Page 24: AS400 FAQ

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 don’t vary. In the other hand, we can store theDifferent values in same variables at various stages.What is *INZSR used for?Ans:It is special type of RPG/400 subroutine, which is executed automaticallyat 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.Which of the following operations does NOT zero the field FLDA defined as 4,0?Ans:C MOVE *ZEROS FLDAC Z-ADD *ZEROS FLDAC Z-ADD 0 FLDAC MOVE *ALL'0' FLDAC SUB FLDA FLDAC MOVE '0000' FLDAC CLEAR FLDAC MOVE *BLANKS FLDAThe 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. CLOFHow 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 3MOVE 'JOHN' MNAME 4MOVE 'WATSON' LNAME 6FNAME CAT MNAME: 1 VAR1 8VAR1 CAT LNAME:1 VAR2 15DSPLY VAR2MOVE *ON *INLRWhen 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:

24

Page 25: AS400 FAQ

PGMDCL 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)ENDPGMDefine the purpose of Factor 1 the Operation Code and *IN15 in following codeHI LO EQC *YMD Test(D) yymmddDate 15Ans: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:

25

Page 26: AS400 FAQ

* displayed on a workstation (screen)* printed* stored in another database file.What is the CLP command to access a Query/400?Ans:WRKQRYWhat 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 structureWhen 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 structureA 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 structureProgram 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.

26