DTASTMCMD (Data Stream Command) keyword in printer files

You use this record-level or field-level keyword to store a data stream command or some other piece of information in a spooled file.

This command can be used to determine how to process a record or field on a particular page of the spooled file. DTASTMCMD is valid only for printer files with device type *AFPDS specified.

The format of the keyword is:
DTASTMCMD(text |&text-field);

The text must be enclosed in single quotation marks. If the length of the text is greater than 255 characters, an error message will be signaled at compile time.

The program-to-system field specified must exist in the same record format as the DTASTMCMD keyword. If the length of the program-to-system field is greater than 255 characters, an error message will be signaled at compile time.

User applications or user specified programs that need to know how to process a particular page in the spooled file can search the data stream and retrieve the data stream command. This will be enclosed in an AFPDS (MODCA) NOP command. The NOP will be built into the datastream before any printable data for the record or field containing the keyword. Since this information is just being stored, this keyword will not have a direct effect on the actual file. For more information about the NOP command, refer to the MO:DCA Reference, SC31-6802.

Option indicators are valid for this keyword.

Note: You can specify this keyword only once for each record and once for each field.

Example

The following example shows how to specify the DTASTMCMD keyword.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
     A          R RECORD1                   DTASTMCMD('TEXT(Record 1)')
     A            FIELD1        10A     5  5
     A  01                                  DTASTMCMD('TEXT(Field 1)')
     A            FIELD2        10A    10  5DTASTMCMD(&DATA);
     A            DATA          10A  P
     A

The data stream for the record RECORD1 has the text for DTASTMCMD as TEXT(Record 1). If indicator 01 is optioned on, the data stream for the field FIELD1 has the text for DTASTMCMD as TEXT(Field 1). If indicator 01 is optioned off, no data stream text is generated for DTASTMCMD on FIELD1. FIELD2 will use what is contained in DATA as the text for DTASTMCMD.