Você está na página 1de 4

What is the sequence when using CURSOR?

Ans: Define Cursor ,Declare Cursor ,Open Cursor ,Fetch record ,Processing ,Close Cursor

Different type of Cursor? Ans: Two types of Cursor Simple / Serial Cursor A serial cursor is one defined without SCROLL key word For serial cursor each row is fetched only once per OPEN When it is opened it is positioned before the first row in the table. To use serial cursor we have to re-issue OPEN Scrollable Cursor which is defined with SCROLL key word. Cursor defined with SCROLL key word Rows of cursor can be fetched many times When it is opened it is positioned before the first row in the table. When the FETCH is issued , the cursor is positioned to the row of the table that is specified by the POSITION option. (FIRST, LAST, PREV, NEXT, RELATIVE)

What is OVERLAY? Ans:It allows a record format to be displayed on screen retaining the previous displayed record formats.

Which are the four keywords supported by Program Status Data Structure? Ans:*STATUS, *PARM, *ROUTINE & *PROGRAM

Difference between SFLRCDNBR and SFLNXTCHG Ans:SFLRCDNBR will give the RRN of the First record displayed on the screen at a given time. Whenever a record is changed on display file. An MDT is set ON. If an indicator is associated with SLFNXTCHG and it is SETON then READC will read only the changed record. And if the indicator is not associated and it is seton it READC reads all the records from sub-file

SFLPAG : it is an attribute which specifies the number of records that can be displayed in a screen. SFLSIZ : it is an attribute which specifies the number of records can be stored in the subfile.

What is the purpose of Overrides? Ans:The basic purpose of Overrides is to temporarily change the attributes of a file. So you don't have to create permanent files for every combination of attributes your application might need. Overrides gives you the flexibility to use existing model files and dynamically change their attributes.

List and explain the different type of data structures? Ans: * Data area data structure When the data area is defined in an RPG/400 program as a data area data structure, its data is implicitly retrieved for processing and written back at the end of the program. In the data area data structure, letter "U" must be entered to define the data structure as a data area data structure. * File information data structure A file information data structure provides exception/error information that may be occurred when processing a file during program execution. This type of data structure contains pre defined sub fields that identify * The name of the file for which the error occurred * The record processed when the error occurred * The operation being processed when the error occurred * The status code number * The RPG/400 routine in which the error occurred. Exception errors may be controlled by testing for an error code in the *STATUS field which is included in a file information data structure. Specifically, keywords including *FILE, *RECORD, *OPCODE, *STATUS, *ROUTINE provide the previously named information. * Program status data structure Program status data structure however identity exception/errors that are generated in the program by RPG/400 operations and not by a file. Note that any code greater than 00099 is flagged as an exception/error. Four keywords - *STATUS, *ROUTINE, *PROGRAM, *PARMS are supported by a program status data structure.

What is the 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.

What is the difference between SKIPB (2) & SPACEB (2)? Ans:SKIPB (2) skips 1 page & on the next page after skipping 2 lines space print next while SPACEB (2) skips 2 lines space before printing.

What are the different types of Data Areas? Ans: The different types of Data Areas are general data area, local data area, group data area, pip (program initialization parameter data area) data area. *General Data Area - It can be created by user implicitely or explicitly It can be referred by any other jobs. It can be associated with a library. It can be created, deleted by the user. * Local Data Area - It can not be referred by any other job. It is automatically created and deleted by the system. It is not associated with any library. *Group Data Area - It is automatically created and deleted by the system

We can access the group data area value through clp. It is meant for group jobs. *Pip Data Area - It is meant for pre start jobs.

What 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. 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:512 Maximum number of subfiles that can Defined in a RPG program for one display file is Ans:24 Maximum number of subfiles that can be active for a single file is? Ans:12 Can 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.

Você também pode gostar