Anda di halaman 1dari 4

What are Subfiles

Subfiles are used in display file programming to allow programmers to handle lists of
columnar data more easily.
Why Use Subfiles
Subfile programs are easy to write and maintain is because most of functionality resides
within the display file.
Types of Subfiles
Load - all Method -- Total Number of record 9999
Expanding Subfiles - Total Number of record 9999
Single Page Subfiles -- Unlimited Number of record
SFLEND (Subfile End) : When it is specified, you will get a + pr the MORE
message at the end of your subfile, regardless of whether the controlling indicator is on or
off.
SFLDROP (Subfile Drop) : It tells the subfile program that it should initially be
displayed with only the first subfile line in view. The rest of the subfile record, which
exists on separate lines, should be dropped from view.
SFLCSRRRN (Subfile Cursor Relative Record Number) : Using this keyword, the
subfile will return the relative record number of the subfile record on which the cursor
was positioned.
SFLLIN (Subfile Line) : Using it you can create a horizontal subfile. In other words,
you can cause a subfile to display more than one subfile record per line.
SFLRCDNBR (Subfile Record Number) : Using it you can control which subfile page
the subfile displays when you output the subfile. By placing a value in the subfile record
number keyword field, the subfile will locate the page on which that subfile record
resides. When it finds the page, it displays that page first. Then you can roll up and down
from that point.
SFLCLR (Subfile Clear) : It removes all records out of a subfile. If the user changes the
position-to field, the program needs to clear out all the existing records in the subfile.
Then it can set lower limits on the file and start filling up the subfile up.

SFLENTER (Subfile Enter) : It makes the Enter key act like the roll-up key. You can
then define a function key to act as the Enter key. One reason you might want to do this is
for mouse-controlled terminals.
SFLINZ (Subfile Initialization) : It allows you to initialize the subfile with as many
active records as the value specified in the SFLSIZ keyword. If you specify SFLINZ and
your subfile size is set to 100, your subfile would contain 100 active, but blank, subfile
records.
SFLRNA (Subfile Record Not Active) : It is used in conjunction with the SFLINZ
keyword. When the two are specified together, the subfile is initialized with inactive
records.
SFLNXTCHG (Subfile Next Changed Record) : It is used to flag a subfile record as
changed and if the program displays it again on the screen, not lose that attribute. This
keyword is specified on the subfile format because the SFLNXTCHG information will be
unique to each subfile record. It is actually stored in the record, but cannot be viewed on
the screen, similar to a hidden field.
1) What are two types of record are used in subfile?
Ans:SUBFILE RECORD FORMAT and SUBFILE CONTROL RECORD FORMAT.
2) What are DDS required for SUBFILE?
Ans:SUBFILE DISPLAY (SFLDSP) SUBFILE DISPLAY CONTROL (SFLDSPCTL)
SUBFILE CLEAR (SFLCLR) SUBFILE SIZE (SFLSIZE) SUBFILE PAGE
(SFLPAGE).
3) What is ELASTIC and NON ELASTIC SUBRILE?
Ans:When subfile size is greater then subfile page size it is called elastic subfile and
when subfile size is equal to subfile page size it is called non-elastic subfile.
4) What is SFLINZ and SFLRNA?
Ans:SFLINZ stands for subfile initialize. It initialized all the character field as blanks
and numeric fields as zeros. SFLRNA stands for subfile record not active (It means
records are there in the subfile but active).
5) Can you display a empty subfile?
Ans:Yes by using the keyword SFLINZ and SFLRNA.
6) Why do we use READC? What is SFLNXTCHG?
Ans:READC is to read those records which have changed in the subfile. If you
validate a record in subfile on some condition all the invalid records can display in
reverse image. The first which have changed and made valid and released still
displaying in reverse image. The records have read even it has not been changed
due to SFLNXTCHG.
7) How do you read changed records backward in subfile?

Ans:NOT POSSIBLE.
8) How you will find an error which is not in the first page of the subfile without using
ROLLDOWN key?
Ans:By using keyword SFLRCDNBR.
9) What is SFLROLVAL?
Ans:By using this keyword you can tell system to roll on of records when the user
presses ROLLDOWN key (For this you define a hidden of 4 byte).
10) How you will know whether you are in SFLDROP or SFLFOLD mode?
Ans:By using the keyword SFLMODE.
11) How you get the relative record in a subfile in which cursor is located?
Ans:By using the keyword SFLCUSRRN (Subfile cursor relative record number).
12) What is QCMDEXC?
Ans:It is used to execute a single CL command within the RPG program.
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.
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 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.
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.