WRITE-SPOOL

File 203
Statement PROCESS
Task This view performs a PRINT.

See also WRITE-SPOOL Programming Notes at the bottom of this view description.


Relevant Error Codes

Code Text
530 Access denied by Security Facility.
556 File is in use.
565 Syntax error in dataset name.
692 You are not permitted to access member.
701 DSNAME missing.
722 Requested dataset not found.
733 User ID does not exist.
750 Invalid operand within operand list.
798 Task was not started under TSOS.
799 Entire Systems Management Adapter internal error.
856 Operator unable to mount volume.
883 Dataset is full.
889 Permanent I/O error while writing dataset.
903 Dynamic allocation failed for temporary dataset.
983 LMS not supported by PRINT.
985 Access to tape file not allowed.
991 Unknown product.
998 Member not found.

Field Descriptions

Dictionary Field Name Format/

Length/

Desc/

Mu

Description
BINARY (A3) Print in hexadecimal format:
  D NO Character format
    YES Hexadecimal format
CHARS (A64) Four groups of four bytes each taken from job control: (CHARS=AAAA,BBBB,CCCC,DDDD). It is taken from the CHARS parameter of the PRINT command.
  D Possible values:
    AAAA
    AAAABBBB
    AAAABBBBCCCC
    AAAABBBBCCCCDDDD
    Sixteen groups of four bytes can be specified for RSO printers (maximum 64 bytes).
CHARS-MODIFICATION (A3) Possible values:
  D NO Only character type, language and
    near-letter-quality are supported.
    YES Default. All characteristics of character
    sets are supported.
CONTROL (A1) Carriage control mode:
  D n Number of new lines after each line.
    A Position 1 is ASA code.
    E SPACE=E.
    I SPACE=I (IBM carriage control characters).
    M Position 1 is machine code.
CONTROL-OPTION (A16) CONTROL parameter of spool-out job.
  D Possible values:
    NO
    LINEMODE
    LOGICAL
    PHYS
    PHYSICAL
    TRANSPARENT
    For an explanation, see the description of the CONTROL parameter of command PRINT.
COPIES (B1) Number of SYSOUT copies.
  D  
DESTINATION (A8) Device type of printer (ND, HP), if the DEVICE field is specified.
  D  
DEVICE (A8) Output device.
  D  
DIA (A2) Name of slide for laser printer.
  D  
DSNAME (A54) Name of the file to be printed. Note that FUNCTION=CLOSE is required to start the printout.
  D  
ELEMENT (A64) Name of the LMS element to be printed.
  D  
ELEMENT-PASSWORD (A8) Password for protected LMS element.
  D  
ELEMENT-TYPE (A8) Type of LMS element to be printed.
  D  
ELEMENT-VERSION (A24) Version of LMS element to be printed.
  D  
END-NUMBER (N5) Number of last column in the line to be printed.
  D Value range: 1 <= value <= 32767
FORM (A8) SYSOUT form.
  D  
FROM-LINE-NUMBER (N10) Starting line number of output list.
  D  
FROM-PAGE-NUMBER (N10) Starting page number of output list.
  D  
FUNCTION (A8) Function to be performed. Possible options:
  D Blank Default. Write a print record.
    CLOSE All print records have been written.
    Specify this on the last request.
HEADER (A5) Print a headline on each page. Possible values:
  D D DATE in format YY-MM-DD.
    D,T,P All values are in headline.
    NO No headline.
    P PAGE nnnn.
    T First record is headline.
HEADER-NUMBER (N10) Number of cover pages for output list.
  D Value range: 0 <= value <= 2**31 -1
IDENTIFIER (A8) Required if multiple update views are executing in parallel. All requests for the same view must have the same identifier.
  D  
IMAGE (A28) Specifies a user file which includes LOOP records, character sets, etc.
  D  
JOB-ID (A8) Returned for FUNCTION=CLOSE.
JOB-NAME (A8) Name of the job under which the output is to be printed.
  D  
JOB-NUMBER (N7) This field is returned after a call with FUNCTION=CLOSE. This field contains the TSN of the print job, if the TSN is numeric. In case of error, the field contains 0.
LINES (N3) Number of lines per page.
  D  
LOCK (A3) Protect output against modifications during wait as task type 4. Possible options:
  D NO Output not protected.
    YES Output protected.
LOOP (A3) Name of LOOP record.
  D  
PASSWORD (A8) Password, if the file is protected.
  D  
RECORD (A253) Required. Record to be written.
  D  
RECORD-LENGTH (N3) Required. Length of record.
  D  
RSO-FILE-NAME (A28) Name of translation table for RSO printer. For detailed information, see the description of the TRANSLATION-TABLE parameter (name2) of the command PRINT.
  D  
START-NUMBER (N5) Number of first column in line for print.
  D Value range: 0 <= value <= 32767
TEXT (A32) Saved in spool control block (SCB). The first 8 characters are used as text at the header page.
  D  
TO-LINE-NUMBER (N10) Ending line number of output list.
  D  
TO-PAGE-NUMBER (N10) Ending page number of output list.
  D  
TRAIL-NUMBER (N10) Number of trailing pages for the output list. Value range: 0 <= value <= 2**31 -1
  D  
TRANSLATION-TABLE (A8) Name of translation table for RSO printer. For detailed information, see the description of the TRANSLATION-TABLE parameter (name1) of the command PRINT.
  D  
TRAY (N1) Specifies the tray number. Value range: 1 - 9.
  D  

WRITE-SPOOL Programming Notes

WRITE-SPOOL is an UPDATE view, that is, data is transmitted from the Natural program (client side) to ESA (server side).

The Entire Systems Management Adapter view WRITE-SPOOL returns codes and messages that describe whether the requested operation has been executed successfully or not.

Therefore, the DEFINE DATA section of the Natural program should only contain the fields shown in this example:

1 WRITE-SPOOL VIEW OF WRITE-SPOOL
  2 ERROR-CODE
  2 ERROR-TEXT
  2 SYSTEM-MESSAGE-CODE
  2 SYSTEM-CODE

These fields in DEFINE DATA statement are the fields returned from the WRITE-SPOOL view in Entire Systems Management Adapter to the calling Natural program.

Defining other fields in DDM is not critical, but the access to these fields may lead to unpredictible results.