AS400 Questions S

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 21
At a glance
Powered by AI
The key takeaways are about differences between elastic and non-elastic subfiles, READC operation, and SETLL and SETGT operations.

A non-elastic subfile has a size equal to its page size, while an elastic subfile has a size greater than its page size. An elastic subfile handles page up/down automatically while a non-elastic one requires coding.

The READC operation reads only the first changed record in the subfile.

AS/400 interview questions

MBT: 1) Briefly describe the difference of coding SFLSIZE = 11, SFLPAG = 10 and SFLSIZE = 50, SFLPAG = 10. Elastic and Non-elastic subfiles. Non-Elastic subfile : Subfile size = Subfile page Elastic subfile : Subfile size > Subfile page a) If SFLSIZ = 11 & SFLPAG = 11 how should the subfile be controlled. Non-elastic subfile : Here the subfile filling, clearing, page up and page down will have to be controlled through coding. Elastic : Page up and page down is handled by the system.

2) What does READC do? Select __ _1_ _1_ __ Emp Num 01 02 03 04 Emp Name Vishnu Kumar Ibrar Ranjan Neerav

a) Will READC read all the changed records or only the first changed record. b) What will SFLNXTCHG do? READC will read only the 1st changed record SFLNXTCHG keyword stands for Subfile Next Change. It maintains that a record is to be considered a changed record and returned to the program when a READC operation is performed. 3) What does SETLL & SETGT do? No. Name 50 55 58 60 avk cjn erk rod

Record Format Name = EMPREC Key field Name = $KEY Suppose key ($KEY) value is: - 57 HILOEQ a) $KEY SETLLEMPREC 99 b) $KEY SETLLEMPREC 98 c) $KEY SETLLEMPREC 97 Where is the record pointer positioned in the above cases? SETLL: It points to the record with equal or nearest value. SETGT: It points to the record with greater value. a) 99 will be off. It will be on if EOF. b) 98 will be off. It will be on if error. c) 97 will be off. It will be on if equal. In all the above cases the record pointer will be between 55 and 58. Read will fetch values of 58.

Page 1 of 21

4) How will an updated record be reflected in your subfile display? By clearing and filling the subfile I will be able to see the updated records. 6) What are the advantages of subfiles? If user is allowed to change multiple record in the Subfile, will you be able to update these multiple changed records to the PF or you have to Update one by one record. We will have to update record one by one 7) How do you maintain referential integrity in DB2/400? By defining primary key and foreign key using ADDPFCST command. The Add Physical File Constraint (ADDPFCST) command can be used to add constraint relationships to a specified physical file. The three types of constraint relationships that you can add are referential constraints, unique constraints, or a primary key constraint. All constraints are defined at the file level. You can use constraint relationships to define dependencies between files. The relationships that you define are enforced by the system when changes occur to information in the files. When you define constraint relationships you control the referential integrity of the data being processed. A maximum of 300 constraint relationships can be established for a file. However, only one primary key constraint can be established for a file. 8) What is the difference between tables and physical files and CRTPF and CRTTBL? PF: The Create Physical File (CRTPF) command creates a physical file from the information specified on this command and (optionally) from the data description specifications (DDS) contained in a source file. A physical file is a database file that contains data records. The data records are grouped into physical file members and each member has its own access path to the data. Normally, database files have only one member which, by default, is added to the file when the file is created. Table: The Create Table (CRTTBL) command creates a named table. The table can be used for the translation of data that is moved between the system and a device. The table can also be used to specify an alternate collating sequence or to specify field translation functions. 9) What are embedded SQLs? The query, which we use in SQL RPG between EXEC-SQL and END-EXEC, is called embedded SQLs.

Page 2 of 21

10) What is the difference between OPNQRY & LF? Ans: OPNQRY is a CL command which is used to view LF's, PF's and QRY files. No object is created. LF is a logical file whose object is created. Without creating an object of LF you cannot view records. The Open Query File (OPNQRYF) command opens a file to a set of database records that satisfy a database query request. Once opened, the file looks like a database file opened using the Open Database File (OPNDBF) command, and the records in the file are accessed by high-level language programs that share the open data path (ODP). The path is closed, and all query resources are deallocated, using the Close File (CLOF) command. This command is used to do any combination of the following database functions: Join records from more than one file, member, and record format. The join may be either equal or non-equal in nature. Calculate new field values using numeric and character operations on field values and constants. Group records by like values of one or more fields, and calculate aggregate functions, such as minimum field value and average field value, for each group. Select a subset of the available records, with selection both before and after grouping the records. Arrange result records by the value of one or more key fields. LF: The Create Logical File (CRTLF) command creates a logical file from the information specified on this command and from the data description specifications (DDS) contained in a source file. A logical file is a database file that describes how data records contained in one or more physical files are presented to a program. The logical file does not contain data records. The data records are contained in the physical files associated with the logical file. The data records contained in the physical files are grouped into physical file members. The logical file accesses the data records through one or more logical file members. Each logical file member describes the data contained in one or more physical file members, and each logical file member has its own access path to the data. 11) How do you use OVRDBF? The Override with Database File (OVRDBF) command is used to (1)Override (replace) the file named in the program (2) To use specific member of a file (3)Override certain parameters of a file that are used by the program OVRDBF FILE(FILE1) TOFILE(FILE2) SHARE(*YES) 12) Why do you use OVRDBF In OPENQRY?

Page 3 of 21

13) What are the different types of data areas? Data area is an object used to communicate data such as variables values between programs within a job and between jobs. It is created using the command CRTDTAARA. Types: LDA (Local data area), *GDA (Global Data area), *PDA (Program Initialization). *GDA The group data area is displayed, if this job is a group job. This data area is automatically associated with the group and cannot be accessed from jobs outside the group. The length of this character data area is 512 bytes. *LDA The local data area is displayed. The local data area (*LDA) is a character data area 1024 bytes in length. It is automatically associated with your job and cannot be accessed from another job. *PDA The program initialization parameter data area is valid only if this is a prestart job. The add length is 2000 bytes. 14) What is SFLNXTCHG? SFLNXTCHG keyword stands for Subfile Next Change. It maintains that a record is to be considered a changed record and returned to the program when a READC operation is performed. 15) Can you control the open and closing of PFs and LFs inside a RPG program? Yes by mentioning the File Condition as UC (User Control) If UC is Blank The program can use the file. UC Type UC if the programmer is to have control of the first open. If a file is to be opened by the OPEN operation in the calculation specifications 16) Can you read a physical file in CL? Yes using the command RCVF The Receive File (RCVF) command is used in a CL program to receive data from a display device or database file. You have to declare file first. DCLF RCVF FILE (STTEST/EMPSETLL) RCDFMT (EMPREC)

17) Can I chain a primary file and what is the sequence of processing. No. Following error 5092 Factor 2 is not the name of a fully procedural file for operation specified. 18) What is the difference between CHAIN & SETLL CHAIN: Points to a particular record and also reads it, so that the values of the record are available. SETLL: It will just point to a particular record. To fetch the values of the record we have to use command READ. In CHAIN command the pointer is on the record, which satisfies the criteria. In SETLL the pointer is above the record satisfying the criteria. E g, if there are 3 records '56', '57', '58' and 57th record is to be searched: CHAIN points to record no. 57 directly. SETLL points between 56 and 57 and with the next read statement the pointer points to 57th record.

Page 4 of 21

SDI: 1) How to define data area Data Structure? IPDS and Enter Press F4 for help Data Struct Name: Type data structure name Option: U Type U if this is a data area data structure. 2) How to define 2 files with the same format? In f spec rename record format 3) What is CL command to Create DTAARA? Ans: CRTDTAARA and press F4. Give the data area name and the type (Char, Dec) and press enter. 4) What is CL command to Retrieve DTAARA? Ans: RTVDTAARA 5) What is CL command to Del DTAARA? Ans: RMVDTAARA 6) What is CL command to Lock DTAARA? Ans: Factor1 Operation Factor2 *Lock IN DATA01 (Name of data area) Result

7) What is Diff bet DOW & DOU? Ans: DOW is a Do While Loop which 1st checks for the condition and then enters the loop. DOU is a Do Until Loop, which loops at least once and then checks for the condition. 8) What is Level Check? Programs are dependent on receiving, at run time, an externally described file whose format agrees with what was copied into the program at compilation time. For this reason, the system provides a level-check function that ensures that the format is the same. The RPG compiler always provides the information required by level checking when an externally described DISK, WORKSTN, or PRINTER file is used. The level-check function can be requested on the create, change, and override file commands. The default on the create file command is to request level checking. Level checking occurs on a record-format basis when the file is opened unless you specify LVLCHK (*NO) when you issue a file override command or create a file. If the level-check values do not match, the program is notified of the error. 9) What are Diff Opcodes in RPG? CHAIN, READ, READC, READP, MOVE, MOVEL, Z-ADD, OPEN, CLOSE etc. 10) How to control open & close of file in RPG? There are two opcodes OPEN to open a file and CLOSE to close a File. 11) What are Diff arrays? 1) Compile time arrays: Loaded when the program is compiled. 2) Runtime Arrays: Loaded when the program is executing. 3) Pre runtime arrays: Loaded when the program begins running before any input, calculation, or output. 12) How to save the spool file?

Page 5 of 21

Use WRKSPLF command to see all the spool files, then to save a particular spool file use option 2=Change and press F10 and give the parameter Save File *YES. 13) What is RPG cycle? I) Start 1) Perform heading and detail lines 2) Get input record 3) Perform total calculations 4) Perform total output 5) LR On 6) If LR On then end program 7) If LR not On then move fields 8) Perform detail calculations 9) Go to STEP 1. II)

RPG PROGRAM CYCLE STEP 1. If the conditioning indicators are satisfied, RPG performs the heading or detail output (those lines having an H or D in column 15 of the output specifications). STEP 2. RPG turns off all control level and record identifying indicators. STEP 3. RPG reads a record and turns on the appropriate record identifying indicator. STEP 4. RPG determines whether a control break occurred. (A control break occurs when the control field of the record just read differs from the control field of the previous record.) STEP 5. If a control break has occurred, RPG turns on the proper control level indicator and all lower control level indicators except L0, which is always on. STEP 6. If this is the first cycle, RPG goes to step 9. STEP 7. RPG performs total calculation operations (those conditioned by control level indicators in columns 7 and 8 of the calculation specifications) if the appropriate control level indicators are on. STEP 8. RPG performs total output operations (those lines having a T in column 15 of the output specifications) according to output specifications. STEP 9. RPG determines whether the LR indicator is on. If it is, all records have been processed, and the program ends. STEP 10. RPG makes data from the record read at the beginning of the cycle (step 3) available for use in detail calculation and output operations. STEP 11. RPG performs all detail calculation operations (those not conditioned by control level indicators in columns 7 and 8 of the calculation specifications) on the data from the record read at the beginning of the cycle.

Page 6 of 21

The first and last cycles of a program differ somewhat from the other cycles. Before the first record is read in the first cycle, the program prints lines conditioned by the 1P (first page) indicator and also performs any heading or detail output operations having no conditioning indicators or all negative conditioning indicators. Heading lines printed before the first record is read might consist of constant or page heading information or fields for reserved words, such as PAGE and UDATE. In addition, the program bypasses total calculations and total output steps. During the last program cycle, when no more records are available, the LR (last record) indicator turns on, automatically causing all control level indicators to turn on. The program performs the total calculations and total output, and the program ends.

14) What is *INZSR? *INZSR is an Initialization Subroutine. The initialization subroutine allows you to process calculation specifications before IP output. It is declared like any other subroutine, but with the special name *INZSR in factor 1. This subroutine will be automatically invoked at the end of the initialization step in the RPG/400 program before IP output. 15) What is the order of initialization in RPG? 1) Global data structure initialization SDS (System Status DS), DS (Program status DS) 2) Subfield value initialization 3) Compile time array initialization 4) Pre run time array initialization 5) *INZSR 16) What is Subfile? A subfile is a group of records that have the same record format and are read from and written to a display device in one operation. 17) What are the errors you encounter in Compile time arrays? Following errors are encountered: 1. Size of Array too large 2. Index is Invalid, defaults to 1 if index is greater than array elements 18) What are the limitations in RPG/400? Ans:

19) What are the datatypes not supported in RPG/400? Following datatypes are not supported in RPG/400 : 1. Long 2. Single 3. Float 6. Int 20) Can you use recursive calls in RPG/400? No

4. Double

5. Date

Page 7 of 21

21) What is Jobd? A job description is a set of characteristics that are used by the system to process a job.( A job is a unit of work on the AS/400 system) Attributes specified in the job description instruct the system to run the job the way you want. All jobs started on the system must have an associated job description. Some of the characteristics supplied by a job description are: Job queue where submitted jobs are placed Priority of submitted job Output queue where job output is placed Priority of job output placed on an output queue Job message logging level User profile to be used for the job They are used ,when you want to determine how system will process one or more job.

22) What is SNDF used for? The Send File (SNDF) command is used by a CL program to send a record to a display device that is being used by an interactive user. The Receive File (RCVF) command is used by a CL program to receive data from a display device or database file. The command reads a record from the file and puts the data from the record into one or more CL variables. The Send/Receive File (SNDRCVF) command is used by a CL program to send data to and receive data from a device that is being used interactively by a user. 23) How would you send a message through a CL pgm? SNDMSG The Send Message (SNDMSG) command is used by a display station user to send an immediate message from his display station to one or more message queues. (An immediate message is a message that is not predefined and is not stored in a message file.) 24) What is a Field Reference File? How is it used? Ans :

25) How do you open & close files explicity in RPG/400? Yes by mentioning the File Condition as UC(User Control) If UC is Blank The file can be used by the program. UC Type UC if the programmer is to have control of the first open. If a file is to be opened by the OPEN operation in the calculation specifications 26) What do you mean by record locking in RPG/400? When a record is read by a program, it is read in one of two modes: input or update. If a program reads a record for update, a lock is placed on that record. Another program cannot read the same record for update until the first program releases that lock. If a program reads a record for input, no lock is placed on the record. A record that is locked by one program can be read for input by another program.

Page 8 of 21

27) What do you mean by file locking in RPG/400? The OS/400 system allows a lock state (exclusive, exclusive allow read, shared for update, shared no update, or shared for read) to be placed on a file used during a job. Programs within a job are not affected by file lock states. A file lock state applies only when a program in another job tries to use the file concurrently. The file lock state can be allocated with the CL command ALCOBJ (Allocate Object) 28) Can you update a file through CL program, if yes how? No 29) How will you display a subfile? Ans . EXFMT the controller name for that subfile. 30) What are the different record formats in a subfile? Ans : 1. RECORD 2. WINDOW 3. WDWSFL 6. USRDFN 7. PULDWN 8. PDNSFL 4. SFL 9. MNUBAR 5. SFLMSG

Page 9 of 21

Sony Music: 1) What are the opcode use in file operation. WRITE, UPDAT, DELET, READ, READE, READP, REDPE, CHAIN, SETLL, SETGT 2) For what purpose we use open query file. This command is used to do any combination of the following database functions: o Join records from more than one file, member, and record format. The join may be either equal or non-equal in nature. o Calculate new field values using numeric and character operations on field values and constants. o Group records by like values of one or more fields, and calculate aggregate functions, such as minimum field value and average field value, for each group. o Select a subset of the available records, with selection both before and after grouping the records. o Arrange result records by the value of one or more key fields. 3) Whether we can debug batch program. YES

4) If program is running in batch and in between it get terminate due to some problem. How you going to handle it.

5) What type of report you create.

11) How to define data array in RPG and in CL

12) How to show two subfiles in one screen no using overlay .show subfiles side by side On control type 8 for Select Keywords and In Subfile Display Layout Mention some value in Spaces Between Records to display

13) How to break in a report other than coding in RPG

Page 10 of 21

14) What is dataqueue

16) How to send a spool file to a specific printer in CL The Change Spooled File Attributes (CHGSPLFA) command allows you to change attributes of a spooled file while it is on an output queue. These changes affect only the current processing of the file. The next time the job runs and the file is produced, the file attributes are derived from the device file description, the program, and any override commands. The Send TCP/IP Spooled File (SNDTCPSPLF) command sends a spooled file to be printed on a remote system. The remote system must be running TCP/IP. The SNDTCPSPLF command is the AS/400 version of the TCP/IP LPR (Line Printer Requester) command.

Page 11 of 21

Hexaware: 1. What is the need for Journalling? Journalling allows the recording of changes to a data base member. It is used For monitoring Add, update, and delete transactions to a data base file Eliminates the loss of file updates if a file is damaged. Serves as an audit trail and activity reporting. Debugging & Security by tracking transactions from program, DFU etc. Recovering database up to a specific change. Changes can be removed from a data base file from the time of a specific change. Decreases the time required to backup the data base. 2. How to do Journalling? Create journal receiver Create journal attach journal receiver to it Start journaling of PF 3. What is the scope of Data Area? Data Area has session level scope 4. How to declare Data Area in RPG program? *NAMVAR DEFN 5. Which keywords are related to Data Area? IN OUT LOCK UNLCK 6. What is Data Structure? Data Structure is a set of variables 7. What are different types of Data Structure? User Defined Data Structure File Information Data Structure Program Status Data Structure 8. What is File Information Data Structure? Gives information about the file opened in RPG program. Declare Data Structure in file spec with particular file using IPFK prompt and INFDS keyword. 9. What are different types of Array? Compile Time Array Pre-run Time Array Run Time Array 10. How to start report layout utility? STRRLU 11. How to declare field in report? F11 12. How to declare constant in report? F11 twice

Page 12 of 21

13. What are different types of Subfile? Elastic Subfile Non-elastic Subfile 14. Explain all keywords used with Subfile? Subfile Clear Subfile Display Subfile Control Display Subfile Initialize Subfile End Subfile next Change Subfile Record Number

15. What is use of Message Subfile? Can display more than one message at a time 16. How to declare Relative Record Number in RPG Program? What is the attribute of the variable used for Relative Record Number? In file spec declare RRN with display file. RRN variable should be 4,0 17. Which libraries does IBM supply? QTEMP QGPL 18. What is the scope of QTEMP library? Session level 19. What is the scope of QGPL library? Global 20. What is the use of Copy Book? Renaming field names, which are exceeding 6 characters limit or containing special characters like _ 21. What is basic structure of CL Program? PGM (Receive Parameters if any) Declare File If Any Declare Variables Logic ENDPGM 22. What is transfer control? Transfer Control command calls program specified on the command and passes control to it. This command removes transferring program from the return stack. 23. What are advantages of transfer control over call? Transfer control removes calling program from the call stack and starts another process while call statement does not remove calling program from call stack and starts another thread. 24. How to rename the record format in RPG Program? In f spec rename record format

Page 13 of 21

25. Can you override database file member? Yes 26. What is open query file? Open query file will display the records of file which satisfy the query condition. 27. What is scope of override database file? Till you Delete override using command DLTOVR Override to same file again will delete previous override 28. How to delete override? DLTOVR 29. What is Data Queue? Data Queue is a communication between two jobs 30. What is a library list? OS/400 searches a object for its first occurrence until found. The libraries that are searched & the order the object is searched is determined by a search list called library list. 31. What is a jobd? A job description is a set of characteristics that are used by the system to process a job.( A job is a unit of work on the AS/400 system) Attributes specified in the job description instruct the system to run the job the way you want. All jobs started on the system must have an associated job description. Some of the characteristics supplied by a job description are: Job queue where submitted jobs are placed Priority of submitted job Output queue where job output is placed Priority of job output placed on an output queue Job message logging level User profile to be used for the job They are used ,when you want to determine how system will process one or more job.

Page 14 of 21

General : 1> Minimum number of line of RPG program for successful compilation 1 line SETON LR 2> Maximum number of records of physical file 20 crore 3> Maximum number of members of physical file The number of members that can be added to the physical file is limited to the number specified in the MAXMBRS parameter of the associated CRTPF command. 4> Compulsary attributes for subfile SUBFILE DISPLAY SFLDSP SUBFILE CONTROL DISP SPFDSPCTL SUBFILE CLEAR SFLCLR SUBFILE SIZE SFLSIZ SUBFILE PAGE SFLPAG 5> What is RAID Disastrous recovery Mirror imaging 6> What are objects Compile version 7> Specs in RPG program HFELICO 8> Keywords in order for defining physical file File , Record , Field , Key , Select/Omit 9> What does keyword JDFTVAL do Indicates that the system will provide default values for fields when a join operation to a secondary file produces no records. 10> How is SQL statements written in RPG EXEC SQL Write SQL statement END-EXEC 11> How many nested IF can you specify 100 12> What does ITER do Returns to the start of the loop 13> How to get the System Command Prompt from RPG Program Call QCMDEXC Define one array named CMD. CALL 'QCMDEXC' PLST ** CMD CLRPFM FILE(*LIBL/EDIT)

Page 15 of 21

14> How to transfer data to to excel from CL STRPCO(*NO) Start PC organiser MONMSG MSGID(IWS4010) EXEC(GOTO CMDLBL(EXCEL)) If Organiser already active STRPCCMD PCCMD(:\progra~1\micros~1\office\excel.exe + \\653gkwm\qdls\download\chqlist.xlt) 15> How to use ftp command 16> What are logical files A description of how data is to be presented to or received from a program. This type of database file contains no data, but it defines record formats for one or more physical files. Join logical files: A logical file that combines (in one record format) fields from two or more physical files. 17> How to find related logical file DSPDBR 18> How do you use commitment control 19>Why overrides ? The first member of any database file is accessed when that file is opened, if you wish to access any other member than an override is required. IF SECURE parameter is used with *YES, all the previous overrides on that file are ignored. 20>OPM : Original Programming Model.

Page 16 of 21

1.

What is the difference between command function & command attention keys (CA and CF)? CA: In DDS, a keyboard key that can be specified with the CA keyword to request the function specified by the keyword. Data is not returned to the system. CF: In DDS, a keyboard key that can be specified with the CF keyword to request the function specified by the keyword. Data is returned to the system. What are the essential keywords used in implementation of a subfile program ? SFLDSP, SFLDSPCTL, SFLCLR, SFLSIZ, SFLPAG. What are the difference between externally described and internally described files ? Externally: A file in which the records and fields are described to the system when the file is created, and used by the program when the file is processed. Program described file: A file for which the fields in the records are described only in the programs that process the file. To the operating system, the record appears as a character string. What are indicators ? What is the indicator used to Terminate an RPG program ?

2. 3.

4.

(1) A 1-character or 2-character code that is used by a program to test a field or record or to tell when certain operations are to be performed. (2) An internal switch used by a program to remember when a certain event occurs and what to do when that event occurs. (3) In the COBOL licensed program, a 2-character code that is used by a program to test a field or record or to tell when certain operations are to be performed. (4) In the RPG licensed program, a 2-character code that is used as a logical variable or statement label.
5. 6. 7. 8. What are the different specifications that make-up an RPG prg? HFELICO How do you rename a field in an RPG prg.? How do you define a composite key? What is the PLIST opcode used for ? A list of values that provide a means of associating addressability of data defined in a called program with data in the calling program. It contains parameter names and the order in which they are to be associated in the calling and called program. How do you access a particular record in an indexed file? CHAIN

9.

10. Give difference between SETLL & SETGT? Set Lower Limit , Set Greater Than 11. What are sub files ? Explain all subfile keywords?

A group of records of the same record format that can be displayed at the same time at a display station. The system sends the entire group of records to the display in a single operation and receives the group from the display in another operation.

Page 17 of 21

12. What is spool file? Differentiate it from an OUTQ? A file that holds output data waiting to be processed, such as information waiting to be printed. Also known as spooled output file. OUTQ: An object that contains a list of spooled files to be written to an output device, such as a printer or a diskette. The system-recognized identifier for the object type is *OUTQ. 13. What is Library, Source Physical File, Member, Object? Source physical File: In Client Access, a file that stores text or source statements instead of data. Library: A system object that serves as a directory to other objects. A library groups related objects, and allows the user to find objects by name. The system-recognized identifier for the object type is *LIB. Member: Different sets of data, each with the same format, within one database file. Object:

(1) A named storage space that consists of a set of characteristics that describe itself and, in some cases, data. An object is anything that exists in and occupies space in storage and on which operations can be performed. Some examples of objects are programs, files, libraries, and folders. (2) A visual part of the interface that the user can work with to perform a task. Icons and text are examples of objects. (3) In MQSeries, objects define the attributes of queue managers, queues, and process definitions. (4) In DB2 UDB for AS/400, anything that can be created or manipulated with SQL statements, such as databases, tables, views, or indexes. (5) In object-oriented programming, a software entity consisting of instance data and the methods that can be performed on that data. An object is an instance of a class.
14. Can you have more than one object with the same name in library if yes how; if no why? Yes. Same object name is allowed but with different object type. 15. Name a few different types of objects? *FILE, *PGM, *DTAARA, *QRYDFN, *MENU 16. Explain OVRDBF and its parameter

(1) To specify attributes at run time that change the attributes specified in the file description or in the program.
(2) The attributes specified at run time that change the attributes specified in the file description or in the program. 17. How to convert a string of alphanumeric digits to numeric e.g. 0123? 18. How do you call a CL program from a RPG and vice-versa? CALL

Page 18 of 21

19. What is access path? Explain *IMMED in it? Access path is the order in which records in one or more database files are organized for processing by a program. Arrival sequence access path: An access path to a database file that is arranged according to the order in which records are stored in the physical file. Keyed sequence access path: An access path to a database file that is arranged according to the contents of key fields contained in the individual records. The possible values are: *IMMED The access path is updated each time a record is changed, added, or deleted from a member. *IMMED must be specified for files that require unique keys. *REBLD The access path is completely rebuilt each time a file member is opened. The access path is maintained until the member is closed; then the access path is deleted. *REBLD cannot be specified for files that require unique keys. *DLY The maintenance of the access path is delayed until the physical file member is opened for use. Then, the access path is changed only for records that have been added, deleted, or changed since the file was last opened. While the file is open, changes made to its members are immediately reflected in the access paths of those members, no matter what is specified for MAINT. To prevent a lengthy rebuild time when the file is opened, *DLY should be specified only when the number of changes to the access path between successive opens are small; that is, when the file is opened frequently or when the key fields in records for this access path change infrequently. *DLY is not valid for access paths that require unique key values. If the number of changes between a close and the next open reaches approximately 10 percent of the access path size, the system stops saving changes and the access path is completely rebuilt the next time the file is opened. 20. What are the different modes in which a file can be opened? I Input (for reading) O Output (for writing) U Update (for Updating) C Combine (for reading as well as for writing) 21. Can u add a record when a file is opened in UPDATE mode if No Why, If Yes How ? 22. What is the maximumm size of variable name in RPG? If an externally described file has a variable name longer than 6 characters then how do u handle it. 23. Explain Editword and Editcode? Editword: A user-defined word with a specific format that indicates how editing should be done. Editcode: A letter or number indicating that editing should be done according to a defined pattern before a field is displayed or printed. 24. How do you call a screen in a CL Prg? SNDRCVF 25. Explain the difference between SNDF and SNDRCVF command? 26. Explain EXFMT opcode? Write/Then Read Format 27. Explain MONMSG command? Monitor message 28. Explain RETRN opcode?

Page 19 of 21

Return to Caller 29. Explain Data Areas and Data Queues? Data Area: A system object used to communicate data, such as CL variable values between the programs within a job and between jobs. The system-recognized identifier for the data area is *DTAARA. Data Queues: An object that is used to communicate and store data used by several programs in a job or between jobs. The system-recognized identifier is *DTAQ. 30. Is member is an object? 31. What is library list? A list that indicates which libraries are to be searched and the order in which they are to be searched. The systemrecognized identifier is *LIBL. 32. What is INZSR? Initialization routine 33. How do you populate values from one array to another array? MOVEA 34. What is JLF and how to create it? Join logical file: The record format name must be different from the record format names of various PF used in the JLF. File level keyword used is JFILE. JFILE contains the list of PFILES to be joined. It must be continued with keyword JOIN, which contains files to be joined. It must be continued with keyword JFLD, which contains fields to be joined. A A A A A A A A R USRJFM J J USRID DEPTNM COMPNM JFILE(SUSER USRDPT TEMP) JOIN(SUSER USRDPT) JFLD(USRID USID) JOIN(SUSER TEMP) JFLD(USRID USSID) JREF(SUSER)

Note: J denotes Join specifications. JFILE Specifies the physical files used by the join logical file. JOIN Specifies the pair of files joined by the Join Specification. JFLD Specifies the join fields in a Join Specification. JREF Specifies the physical file containing the field.

Page 20 of 21

35. What is journalling?

Journal:A system object that identifies the objects being journaled, the current journal receiver, and all the journal receivers on the system for the journal. The system-recognized identifier for the object type is *JRN. Journaling: The process of recording, in a journal, the changes made to objects, such as physical file members or access paths, or the depositing of journal entries by system or user functions. Journal receiver :A system object that contains journal entries added when events occur that are journaled, such as changes to a database file, changes to other journaled objects, or securityrelevant events. The object type is *JRNRCV. How to do journalling:
Create journal receiver Create journal attach journal receiver to it Start journaling of PF

36. If 4 files are getting updated, two in program A and two in program B, program B is called from program A. If program A updates 2 files properly, and program B does not update files.How do you use commit control.? 37. If job ends abnormally, what will you do? 38. Can two record formats be incorporated in PF and LF? 39.

Page 21 of 21

You might also like