Previous Topic: SAM()Next Topic: SCANSTR()


SAYWHAT()

This function direct the output of TRACE and SAY operations to a data set.

Syntax

Form 1:

dcb = SAYWHAT(OPEN,,[lines],[output],[opt1],[head],[class],[opt2],[dest],[ddname])

Form 2:

dcb = SAYWHAT(USE,dcb)

Form 3:

dcb = SAYWHAT(CLOSE,dcb)

Parameters

dcb

Value that identifies a file and an associated internal workspace. The DCB is returned by the OPEN operation and is required for all other functions.

OPEN

Allocates and opens a new file, and returns a dcb.

,,

Argument two is reserved and must be null.

USE

Indicates that the designated file is used for future SAY or TRACE output. You can use this argument to alternate output among multiple files.

Specifying SAYWHAT('USE',0) terminates directed SAY or TRACE output, and causes more SAY or TRACE output to be printed in the ISERVE log file (ISRVLOG).

lines

Number of lines of data per page, not including the lines the page headers used. Null or zero indicates a page of infinite length.

Default: 0

output

Name of an OUTPUT JCL statement to be associated with this file.

opt1

Specify:

CC indicates that you supply an ANSI carriage control character (1, ' ', 0, -, +) for each record you create with a SAY.

NOCC indicates that you do not supply an ANSI carriage control character for each record you create with a SAY. ANSI carriage control characters (single space) are supplied by the system.

head

One or more strings to be used as page headings. Headings are separated from each other by a semicolon (;). Each heading must begin with an ANSI carriage control character. The first header must have a 1 (one) as its carriage control.

If you want one or more blank lines between the headings and data lines, explicitly code a blank heading line.

The following value cannot exceed 256 (not including semicolons):

(Total characters in headings) + (4*(number of headings)) + 2

To print the current page number, code a single occurrence of '@@@@' in your heading. The page number replaces this string.

class

SYSOUT class to be assigned.

Default: The default class that the operating system assigned.

opt2

Specify:

HOLD

Indicates that the spun file is held.

NOHOLD

Indicates that the spun file is not held.

Default: NOHOLD

dest

User ID or node.userid to indicate the destination for routing the file.

ddname

DDname (supplied from JCL or the ALLOC() function) of the file to be used. Overrides the output, class, hold, and dest arguments.

CLOSE

Indicates that the file closes and is spun.

Return Codes

-123

INVALID FILE DCB

101 - 110

ARG n MISSING OR INVALID

122

FILE FAILED TO OPEN

Example

ddname = alloc('RBROWNE.SAYOUT','SHR',,'DD1')  /* Output data set */
dcb = saywhat('open',,,,,,,,,ddname)      /* Tell SAYWHAT about it */
saywhat('use',dcb) == ''                  /* Switch SAY output */
say 'should go to RBROWNE.SAYOUT'
saywhat('use',0) == ''                    /* Switch back, and close file */