DDS for display files


SFLPGMQ (Subfile Program Message Queue) keyword for display files

Use this field-level keyword on the second (and last) field in the subfile record format for a message subfile. This field contains the name of the program message queue used by the OS/400 program to build a message subfile. In addition, SFLPGMQ can be specified on the subfile control record format when the SFLINZ keyword is specified on the subfile control record format.

The format of the keyword is:

SFLPGMQ([10] | [276])

When 10 is specified, SFLPGMQ generates a 10-byte field. 10 is the default.

When 276 is specified, SFLPGMQ generates a 276-byte field.

This field is predefined as a character data type, hidden field. The following rules apply:

For Integrated Language Environment* (ILE*) programs using the 276-byte parameter value, the format of the field data must be as follows:

This field is required on the subfile record format (identified by the SFL keyword) to build the subfile one message at a time through multiple output operations to the subfile record format.

You can also specify this field on the subfile control record format (identified by the SFLCTL keyword) to build the subfile all at once through a single output operation to the subfile control record. Specify option indicators with the SFLINZ keyword to control the way the subfile is built.

Multiple output operation:

If you specify the field name and SFLPGMQ on the subfile record, you build the subfile one message at a time with separate output operations to the subfile record format. For each output operation, the message reference key must be in the first field of the record (SFLMSGKEY keyword), and the name of the program message queue must be in the second field. At the time of the output operation, the OS/400 program retrieves the identified message from the queue and places it in the subfile as a record.

Note:
A CL program cannot be used for a multiple output operation. The relative record number required each time a message is built is not supported for CL.

Single output operation:

If you specify SFLPGMQ (with its named field) and the SFLINZ keyword on the subfile control record format, you build the entire subfile with one output operation directed to the subfile control record format. On the output operation, the OS/400 program initializes the subfile with all messages that are on the program message queue whose name is in the SFLPGMQ field. If necessary, the OS/400 program extends the subfile to contain all messages on the queue. For this function, the SFLMSGRCD, SFLMSGKEY, and SFLPGMQ keywords must be specified with the subfile record format (SFL keyword). The SFLPGMQ and SFLMSGKEY keywords are ignored for this function and your program need not set the values of their fields.

Special value:

The SFLPGMQ field can contain a special value, * (asterisk), instead of a program message queue name. If the program moves an asterisk to the SFLPGMQ field, the OS/400 program uses the message queue of the program issuing the output operation. You cannot use an asterisk if your program is a CL program.

Both multiple and single output operations:

If you specify SFLPGMQ with both the subfile record format and subfile control record format, you can use the single operation function one time and the multiple operation function some other time. Do this by setting indicators before issuing the output operation; however, all operations to a particular subfile must be consistent (multiple or single, but not intermixed) when preparing for a single display of the subfile.

Option indicators and display size condition names are not valid for this keyword.

Example:

The following example shows how to specify the SFLPGMQ keyword.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A          R RCDMSGILE                 SFL SFLMSGRCD(3)
00020A            FLDKEY                    SFLMSGKEY
00030A            FLDPGM                    SFLPGMQ(276)
00040A          R SFLCTLILE                 SFLCTL(RCDMSG)
00050A  01                                  SFLINZ
00060A                                      SFLPAG(17)
00070A                                      SFLSIZ(17)
00080A                                      SFLDSP SFLDSPCTL
     A            :
     A            :
00110A            FLDPGM                    SFLPGMQ(276)
     A          R RCDMSGOPM                 SFL SFLMSGRCD(3)
     A            FLDKEY                    SFLMSGKEY
     A            FLDPGM                    SFLPGMQ
     A          R SFLCTLOPM                 SFLCTL(RCDMSG)
     A  02                                  SFLINZ
     A                                      SFLPAG(17)
     A                                      SFLSIZ(17)
     A                                      SFLDSP SFLDSPCTL
     A              :
     A              :
     A            FLDPGM                    SFLPGMQ(10)
     A

In this example, the program can build the subfile with more than one output operation (indicator 01 off) or a single output operation (indicator 01 on) to the subfile control record format.

In the first record, the name of the subfile program queue can be as long as 276 bytes, while the name of the subfile program queue in the third record format can only be 10 bytes long.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]