WRITE-SPOOL

File 203
Op-Sys z/OS, z/VSE, BS2000/OSD
Statement PROCESS
Task This view makes it possible to write data directly to spool queues (z/OS: JES, z/VSE : POWER). In BS2000/OSD, this view performs a PRINT. See also WRITE-SPOOL Programming Notes at the bottom of this view description.

Common Fields for all Operating Systems

Dictionary Field Name F/L Mu DE Remarks
ERROR-CODE N3      
ERROR-TEXT A58      
NODE N5   D  
NODE-NAME A16   D  
SYSTEM-MESSAGE-CODE A10      
CONTROL A1   D  
COPIES B1   D  
DESTINATION A127   D  
FORM A8   D  
FUNCTION A8   D Required on last request.
RECORD A253   D Required.
RECORD-LENGTH N3   D Required.

Additional Fields Supported for z/OS

Dictionary Field Name F/L Mu DE Remarks
CHARS A64   D  
CLASS A1   D  
DATA-SET-ID A54      
DDNAME A8      
FCB A4   D  
FLASH A4   D  
FSSDATA A127   D  
HOLD A8   D  
IDENTIFIER A8   D Required if multiple update views are executing in parallel.
JOB-ID A8   D  
JOB-NUMBER N7   D  
PORTNO N5   D  
PROGRAM A8   D  
PRTOPTNS A16   D  
PRTQUEUE A127   D  
REMOTE-USERID A8   D  
TRC A3   D  

Additional Fields Supported for z/VSE

Dictionary Field Name F/L Mu DE Remarks
BURST A3   D  
CLASS A1   D  
COMPACT A4   D  
COPY-MODIFY-MODULE A4   D  
COPY-MODIFY-TABLE A4   D  
DISPOSITION A1   D  
FLASH-COUNT N3   D  
JOB-NAME A8   D  
PROGRAM A8   D  
SEGMENTATION-SIZE B4   D  
SEP-PAGES-COPIES A3   D  
SEP-PAGES-COUNT B1   D  
TARGET-NODE A8   D  
UCS A8   D  
UCS-OPTIONS A2   D  
USER-INFO A16   D  

Additional Fields Supported for BS2000/OSD

Dictionary Field Name F/L Mu DE Remarks
SYSTEM-CODE B2      
BINARY A3   D  
CHARS A64   D  
CHARS-MODIFICATION A3   D  
CONTROL-OPTION A16   D  
DEVICE A8   D  
DIA A2   D  
DSNAME A54   D  
ELEMENT A64   D  
ELEMENT-PASSWORD A8   D  
ELEMENT-TYPE A8   D  
ELEMENT-VERSION A24   D  
END-NUMBER N5   D  
FROM-LINE-NUMBER N10   D  
FROM-PAGE-NUMBER N10   D  
HEADER A5   D  
HEADER-NUMBER N10   D  
IDENTIFIER A8   D Required if multiple update views are executing in parallel.
IMAGE A28   D  
JOB-ID A8   D  
JOB-NAME A8   D  
JOB-NUMBER N7   D  
LINES N3   D  
LOCK A3   D  
LOOP A3   D  
PASSWORD A8   D  
RSO-FILE-NAME A28   D  
START-NUMBER N5   D  
TEXT A32   D  
TO-LINE-NUMBER N10   D  
TO-PAGE-NUMBER N10   D  
TRAIL-NUMBER N10   D  
TRANSLATION-TABLE A8   D  
TRAY N1   D  

Relevant Error Codes

Code Text z/OS z/VSE BS2000/OSD
530 Access denied by Security Facility.     X
556 File is in use. X X X
565 Syntax error in dataset name.     X
692 You are not permitted to access member.     X
699 GETVIS failed. X X  
701 DSNAME missing.     X
722 Requested dataset not found.     X
733 User ID does not exist.     X
750 Invalid operand within operand list.     X
798 Task was not started under TSOS.     X
799 Entire System Server internal error.     X
856 Operator unable to mount volume.     X
870 RECORD field not in search buffer. X X  
872 RECFM not supported. X X  
873 Record length missing. X X  
874 RECORD-LENGTH > LRECL. X X  
883 Dataset is full. X   X
889 Permanent I/O error while writing dataset. X X X
900 Dynamic sysout allocation failed. X    
901 Dynamic internal read alloc failed. X    
901 POWER interface is not active.   X  
903 Dynamic allocation failed for temporary dataset.     X
983 LMS not supported by PRINT.     X
985 Access to tape file not allowed.     X
991 Unknown product. X   X
993 Open error. X X  
998 Member not found. X X X

Field Descriptions

Field Name Type/Length Operating System
BINARY (A3) BS2000/OSD

Print in hexadecimal format or not:

Value Explanation
NO  Character
YES  Hexadecimal
Field Name Type/Length Operating System
BURST (A3) z/VSE

Burst option. Possible values:

Value Explanation
NO  Default
YES   
Field Name Type/Length Operating System
CHARS (A64) z/OS, BS2000/OSD

Four groups of four bytes each, taken from the JCL

'(CHARS=(AAAA,BBBB,CCCC,DDDD)'

In BS2000/OSD, it is taken from the CHARS parameter of the PRINT command. Possible values:

  • AAAA

  • AAAABBBB

  • AAAABBBBCCCC

  • AAAABBBBCCCCDDDD

Sixteen groups of four bytes can be specified for RSO printers (maximum 64 bytes).

Field Name Type/Length Operating System
CHARS-MODIFICATION (A3) BS2000/OSD

Possible values:

Value Explanation
YES  Default. All characteristics of character sets are supported.
NO  Only character type, language and near-letter-quality are supported.
Field Name Type/Length Operating System
CLASS (A1) z/OS, z/VSE

SYSOUT class. If omitted, the default class of the Entire System Server node is used.

Field Name Type/Length Operating System
COMPACT (A4) z/VSE

Name of compaction table.

Field Name Type/Length Operating System
CONTROL (A1) z/OS, z/VSE, BS2000/OSD

Carriage control mode:

Value Explanation
n  (BS2000/OSD) number of new lines after each line.
A  Position 1 is ASA code.
E  SPACE=E (BS2000/OSD).
I  SPACE=I (in BS2000/OSD for IBM carriage control characters).
M  Position 1 is machine code.
Field Name Type/Length Operating System
CONTROL-OPTION (A16) BS2000/OSD

Possible values:

  • NO

  • LINEMODE

  • LOGICAL

  • PHYS

  • PHYSICAL

  • TRANSPARENT

For an explanation, see the description of the CONTROL parameter of the BS2000/OSD command PRINT.

Field Name Type/Length Operating System
COPIES (B1) z/OS, z/VSE, BS2000/OSD

Number of SYSOUT copies.

Field Name Type/Length Operating System
COPY-MODIFY-MODULE (A4) z/VSE

Copy modification module name.

Field Name Type/Length Operating System
COPY-MODIFY-TABLE (A4) z/VSE

Character arrangement table for copy modification.

Field Name Type/Length Operating System
DATA-SET-ID (A54) z/OS

Internal dataset name of the SYSOUT file (returned after the CLOSE function).

Field Name Type/Length Operating System
DDNAME (A8) z/OS

The DDNAME of the spool file.

Field Name Type/Length Operating System
DESTINATION (A127) z/OS, z/VSE, BS2000/OSD
  • z/OS: Remote destination of this dataset.

    May also be specified in the form 'IP:ipaddr' which may be used by a functional subsystem that can perform Internet Protocol (IP) transmission (for example, IP PrintWay).

  • z/VSE : Remote destination of this dataset.

  • BS2000/OSD: Device type of printer (ND, HP), if the DEVICE field is specified.

Field Name Type/Length Operating System
DEVICE (A8) BS2000/OSD

RSO printer.

Field Name Type/Length Operating System
DIA (A2) BS2000/OSD

Form DIA name.

Field Name Type/Length Operating System
DISPOSITION (A1) z/VSE

Disposition to be assigned to spool output.

Field Name Type/Length Operating System
DSNAME (A54) BS2000/OSD

Name of the file to be printed out. Note that FUNCTION=CLOSE is required to start the printout.

Field Name Type/Length Operating System
ELEMENT (A64) BS2000/OSD

Name of the LMS element to be written (BS2000/OSD version V10 or above).

Field Name Type/Length Operating System
ELEMENT-PASSWORD (A8) BS2000/OSD

Password for protected LMS element (BS2000/OSD version V10 or above and LMS V2 or above).

Field Name Type/Length Operating System
ELEMENT-TYPE (A8) BS2000/OSD

Type of LMS element to be written (BS2000/OSD version V10 or above).

Field Name Type/Length Operating System
ELEMENT-VERSION (A24) BS2000/OSD

Version of LMS element to be written (BS2000/OSD version V10 or above).

Field Name Type/Length Operating System
END-NUMBER (N5) BS2000/OSD

Number of the last column in the line to be printed. Value range: 1 <= value <= 32767

Field Name Type/Length Operating System
FCB (A4) z/OS, z/VSE

FCB name.

Field Name Type/Length Operating System
FLASH (A4) z/OS, z/VSE

Flash for 3800.

Field Name Type/Length Operating System
FLASH-COUNT (N3) z/VSE

Flash count.

Field Name Type/Length Operating System
FORM (A8) z/OS, z/VSE, BS2000/OSD

SYSOUT form.

Field Name Type/Length Operating System
FROM-LINE-NUMBER (N10) BS2000/OSD

Starting line number of output list.

Field Name Type/Length Operating System
FROM-PAGE-NUMBER (N10) BS2000/OSD

Starting page number of output list.

Field Name Type/Length Operating System
FSSDATA (A127) z/OS

Specifies data to pass to a functional subsystem (FSS) that controls printing (for example, IP PrintWay). See the documentation for the particular subsystem for additional information.

Field Name Type/Length Operating System
FUNCTION (A8) z/OS, z/VSE, BS2000/OSD

Function to be performed. Possible options:

Option Explanation
blank  Write a record.
CLOSE  All records have been written. Specify this on the last request.
SEGMENT  z/VSE only. Create a new POWER segment after writing next line.
Field Name Type/Length Operating System
HEADER (A5) BS2000/OSD

Print a headline on each page. Possible values are:

Value Explanation
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.
Field Name Type/Length Operating System
HEADER-NUMBER (N10) BS2000/OSD

Number of cover pages for the output list. Range of values: 0 <= value <= 2**31 -1

Field Name Type/Length Operating System
HOLD (A8) z/OS

Possible values:

Value Explanation
NO  The SYSOUT dataset is not to be held.
YES  The SYSOUT dataset is to be held.
Field Name Type/Length Operating System
IDENTIFIER (A8) z/OS, BS2000/OSD

Required if multiple update views are executing in parallel, all requests for the same process must have the same identifier.

Field Name Type/Length Operating System
IMAGE (A28) BS2000/OSD

Specifies a user file which includes LOOP records, character sets, etc.

Field Name Type/Length Operating System
JOB-ID (A8) z/OS, BS2000/OSD

Returned for FUNCTION=CLOSE.

z/OS & z/VSE : Job number in alphanumeric format.
BS2000/OSD: TSN of job in alphanumeric format. This field must be used for V10 or above with alphanumeric TSNs.
Field Name Type/Length Operating System
JOB-NAME (A8) z/VSE , BS2000/OSD

Name of the job under which the output is to be printed.

Field Name Type/Length Operating System
JOB-NUMBER (N7) z/OS, BS2000/OSD

Returned for FUNCTION=CLOSE.

z/OS, z/VSE : Job number.

BS2000/OSD: TSN of job.

Field Name Type/Length Operating System
LINES (N3) BS2000/OSD

 Number of lines per page.

Field Name Type/Length Operating System
LOCK (A3) BS2000/OSD

Protect output against modifications during wait as Task Type 4. Possible options:

Option Explanation
NO  Output not protected.
YES  Output protected.
Field Name Type/Length Operating System
LOOP (A3) BS2000/OSD

Name of LOOP record.

Field Name Type/Length Operating System
PASSWORD (A8) z/VSE , BS2000/OSD

z/VSE : Password of job.

BS2000/OSD: Password, if the file is protected.

Field Name Type/Length Operating System
PORTNO (N5) z/OS

Specifies the TCP/IP port number at which a functional subsystem (for example, IP Printway) connects to the printer. See the documentation for the particular subsystem for additional information.

Field Name Type/Length Operating System
PROGRAM (A8) z/OS, z/VSE

Name of writer program to process this dataset.

Field Name Type/Length Operating System
PRTOPTNS (A16) z/OS

Specifies additional print options a functional subsystem can use when printing a DEST='IP:ipaddr' routed dataset. See the documentation of the particular subsystem for additional information.

Field Name Type/Length Operating System
PRTQUEUE (A127) z/OS

Specifies the name of the target print queue on a remote host system. The PRTQUEUE field applies only to datasets processed by a functional subsystem that can perform Internet Protocol (IP) transmission (for example, IP Printway). See the documentation of the particular subsystem for additional information.

Field Name Type/Length Operating System
RECORD (A253) z/OS, z/VSE, BS2000/OSD

Record to be written.

Field Name Type/Length Operating System
RECORD-LENGTH (N3) z/OS, z/VSE, BS2000/OSD

Length of record.

Field Name Type/Length Operating System
REMOTE-USERID (A8) z/OS

User ID for printing at remote destinations.

Field Name Type/Length Operating System
RSO-FILE-NAME (A28) BS2000/OSD

Name of translation table for RSO printer. For detailed information, see the description of the TRANSLATION-TABLE parameter (name2) of the BS2000/OSD command PRINT.

Field Name Type/Length Operating System
SEGMENTATION-SIZE (B4) z/VSE

Size (in lines) of each segment to be written.

Field Name Type/Length Operating System
SEP-PAGES-COPIES (A3) z/VSE

Copy separators required. Possible values:

Value Explanation
NO  Default
YES   
Field Name Type/Length Operating System
SEP-PAGES-COUNT (B1) z/VSE

Number of separator pages.

Field Name Type/Length Operating System
START-NUMBER (N5) BS2000/OSD

Number of first column in line for print. Range of values: 0 <= value <= 32767

Field Name Type/Length Operating System
TARGET-NODE (A8) z/VSE

Name of target node.

Field Name Type/Length Operating System
TEXT (A32) BS2000/OSD

Saved in spool control block (SCB). The first 8 characters are used as text at the header page.

Field Name Type/Length Operating System
TO-LINE-NUMBER (N10) BS2000/OSD

Ending line number of output list.

Field Name Type/Length Operating System
TO-PAGE-NUMBER (N10) BS2000/OSD

Ending page number of output list.

Field Name Type/Length Operating System
TRAIL-NUMBER (N10) BS2000/OSD

Number of trailing pages for the output list. Range of values: 0 <= value <= 2**31 -1

Field Name Type/Length Operating System
TRANSLATION-TABLE (A8) BS2000/OSD

Name of translation table for RSO printer. For detailed information, see the description of the TRANSLATION-TABLE parameter (name1) of the BS2000/OSD command PRINT.

Field Name Type/Length Operating System
TRAY (N1) BS2000/OSD

Specifies the tray number. Possible values: 1 - 9.

Field Name Type/Length Operating System
TRC (A3) z/OS
Value Explanation
YES  Byte 2 in record used for CHARS (3800) (DCB=OPTCB=J specified).
Field Name Type/Length Operating System
UCS (A8) z/VSE

UCB name.

Field Name Type/Length Operating System
UCS-OPTIONS (A2) z/VSE

UCB options. Possible values:

Value Explanation
B  Block data check option.
F  Fold option.
Field Name Type/Length Operating System
USER-INFO (A16) z/VSE

User information.

WRITE-SPOOL Programming Notes

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

The Entire System Server 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 System Server to the calling Natural program.

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