Building a Printer Definition Table (PDT) for PC/3270

This chapter, in combination with Building a Printer Definition Table (PDT) for PC400, explains how to customize a printer definition table (PDT file) for PC/3270. Building a Printer Definition Table (PDT) for PC400 contains basic information about creating and changing PDTs; this chapter contains specific information about creating PC/3270 PDTs. PDTs for PC/3270 and PC400 differ only slightly; if you use a common PDT (used for both PC/3270 and PC400), the additional statements for PC400 are ignored for PC/3270 processing. Similarly, statements unique to PC/3270 are ignored for PC400 processing.

ASCII_PASSTHRU? and EBCDIC_PASSTHRU?

The ASCII_PASSTHRU? and EBCDIC_PASSTHRU? PDF statements are new options available for PC/3270. See Transparent Print Capability for details.

Supplemental Explanation of PDF Statements for PC/3270

The following PDF statements have functions that differ from those for PC400. All statements are listed in Field Names of Printer Definition Files.

MAXIMUM_PAGE_LENGTH
Printed lines per page. If you change this value, you must change the value in the SET_PAGE_LENGTH=SFL value statement (see Session parameters) to be the same.
MAXIMUM_PRINT_POSITION
Printed characters per line.
COMPRESS_LINE_SPACING?
Whether blank or null lines are to be printed if all characters on that line are nulls (for LU 3 only).
FORM_FEED_ANY_POSITION?
Whether a form feed is to be valid in any position. If NO, a form feed will be valid only in the following positions:
OVERRIDE_FORMATTED_PRINT?
Whether nulls are to be printed as blanks.
INTERV_REQ_TIMER
This statement is ignored.
INTERV_TIMER_ON_PE_ONLY?
This statement is ignored.
RESELECT_TIME_EXCPT_5204
This statement is ignored.
ESC/P_LINE_FEED?
If YES, the line feed (LF) function is emulated when the line feed command is received. This is useful when you do not want a line feed accompanied by a carriage return (CR) on a printer using the ESC/P printer language. If NO, the value defined in the LINE_FEED statement is sent to the printer.
IGNORE_FORM_FEED_AT_FIRST_POS?
If YES, the form feed (FF) function is ignored at the first position (for LU 2, LU 3) or at the beginning of the print job (for LU 1 sessions). Using this option eliminates extra blank pages at the beginning of each print job.
FORM_FEED_TAKES_POSITION?
If YES, the form feed (FF) function is effective if followed by data (LU 2, LU 3 only).
ZENKAKU_SPACE
The size (adjustment unit) of a user-defined character and a HANKAKU character. This value cannot be changed.
SBCS_FONT_LOAD
Registration of a HANKAKU GAIJI. This value cannot be changed.
SET_LOCAL_FONT
Set a font set of user-defined characters. Remove it when user-defined characters are not loaded to a printer.
RESET_LOCAL_FONT
Reset a font set of user-defined characters. Remove it when user-defined characters are not loaded to a printer.
ATTRIBUTE_GRID_LINE
Set to grid-line print. This value cannot be changed.
START_DOUBLE_WIDTH_CHARACTER
Set a double-width character.
END_DOUBLE_WIDTH_CHARACTER
Reset a double-width character.

Notes:
  1. When using IBM5577.PDF, change FORM_FEED=EJC to FORM_FEED in the file when a continuous form job does not feed correctly.

SCS TAB Setting

A PC/3270 printer session LU type 1 can accept any number of tab positions, and the host printer session can send any number of tabs to the printer session. However, the workstation printer you are using might support fewer tab positions than the host application sets; for example, the IBM® Proprinter supports 27 tab positions.

If the number of tab positions that the host application sets exceeds the maximum number of positions that the printer supports, your printed output will not look as you expect it to. You can avoid this situation by modifying the PDF file and reconfiguring PC/3270 as follows:

  1. Modify the SET_HORIZONTAL_TABS statement as follows:

    SET_HORIZONTAL_TABS=number

  2. Save the file under a new name.
  3. Convert the PDF file (with the procedure described in Building a Printer Definition Table (PDT) for PC400).
  4. Select the new PDT file created in Step 2.

Printer Color Mixing

Some printers, such as the IBM 5182, compose certain colors by mixing colors. Colors are mixed by printing the text in one color and then printing over the same text in another color on a second pass.

PC/3270 will compose a color if the color is not defined in the printer definition table of a color printer that is capable of mixing colors. Therefore, if you are using a printer that composes some colors by mixing two colors, leave the definition of the composed colors blank in the printer definition file. Only the composite colors defined in Table 1 are created by double-printing the primary colors.

Table 1. Color Mixes
Composite Color Primary Colors
Red yellow, magenta
Green yellow, cyan
Blue magenta, cyan

For example, to create red, you must define yellow and magenta. The primary colors must be defined in the printer definition table.

Printer Session Data Stream Support

3270 Data Stream

The 3270 data stream is a buffer-oriented data stream. The print data is formatted as if it were going to be displayed on a screen. The host system sends commands to format the presentation space. These commands can change the presentation space in any location at any time. Once the host system completes formatting the presentation space, it issues a START PRINT command and the presentation space is printed as accurately as the printer hardware allows.

Table 2 lists the commands that can be sent in the 3270 data stream.

Table 2. 3270 Data Stream Commands
Command Meaning
W Write
EW Erase/Write
EWA Erase/Write Alternate
RB Read Buffer
RM Read Modified
RMA Read Modified All
EAU Erase All Unprotected
WSF Write Structured Field

Table 3 lists the orders that can be sent in the 3270 data stream.

Table 3. 3270 Data Stream Orders
Order Meaning
SBA Start Buffer Address
SF Start Field
IC Insert Cursor
PT Program Tab
RA Repeat to Address
EUA Erase Unprotected to Address
SFE Start Field Extended
SA Set Attribute
MF Modify Field

The last three orders in the preceding table manage the color, extended highlighting, and programmed symbols attributes for fields and individual characters. The programmed symbols attribute is not supported by PC/3270.

In addition to the commands and orders in the two preceding tables, there are special printer formatting control codes that can be included in the 3270 data stream.

The following table lists the control codes that can be sent in the 3270 data stream.

Table 4. 3270 Data Stream Format Control Codes
Code Description
NL New Line control code moves the print position to the left margin and down one line.
CR Carriage Return control code moves the print position to the left margin.
EM End of Message control code ends the print operation.
FF Form Feed control code moves the print position to the left margin at the top of the next page.
Note:
NL, CR, and EM are valid only if a line-length format specified by the WCC is not used. The FF code is valid in any buffer position.

PC/3270 printer support interprets each 3270 attribute and printer control code and translates them into a sequence of one or more workstation printer control codes. For more information about the 3270 data stream, refer to IBM 3270 Information Display Data Stream Programmer’s Reference.

Delimiting Print Jobs

Many print jobs can be sent over a single PC/3270 printer session. PC/3270 allows multiple sessions and applications to share a single workstation printer on a between-jobs basis. PC/3270 needs to know when each print job starts and ends so that printers can be shared properly and begin and end job strings can be sent at the appropriate times. The emulator recognizes a number of different methods of delimiting print jobs:

By Session
PC/3270 printer support assumes, by default, that all print jobs are delimited by sessions. That is, in the absence of all other indicators, PC/3270 assumes that a print job begins when a printer session is started and ends when it is reset.
Time-Out Interval
On DFT sessions, print jobs can be delimited by a user-specified timeout interval. A print job on a DFT printer session begins when the first host-outbound data for that job is received, and ends when no host-outbound data is received for a period of time exceeding the user-specified DFT timeout interval. For PC/3270, this interval is specified during configuration.
Structured Fields
The host can use structured fields to indicate to the device that a new file is beginning or that the current file is completed. PC/3270 delimits print jobs with Begin of File and End of File structured fields (SF) to perform host-directed printing. Structured fields are described in Structured Fields.

Structured Fields

The host uses Begin of File and End of File structured fields to indicate to a device that a file is beginning or ending.

Begin/End of File Query Reply

The Begin/End of File query reply indicates that a device supports Begin of File and End of File to delineate print jobs. The PC/3270 sends a query reply, as shown in Table 5, to the host in response to a Read Partition General query.

Table 5. Begin/End of File Query Reply Format
Byte Contents Description
0-1 X'0005' The length of this structure
2 X'81' Query reply
3 QCODE X'9F' Begin/End of File
4 FLAGS Reserved; must be set to 0’s

Begin/End of File Structured Fields

Begin/End of File structured fields are accepted on either LU 1 or LU 3 sessions. Table 6 shows the format of the Begin/End of File structured fields.

Table 6. Begin/End of File Structured Field Format
Byte Bit Contents Description
0-1   X'0007' The length of this structure
2-3   X'0F85' Begin/End of File
4   PID Partition ID
5
 
0-1
 
 
 
2-7
FLAG11 B'00' B'01' B'10' B'11'
 
Reserved
End of File is being sent
Begin of File is being sent
Reserved
Reserved
6   FLAG2 Reserved; must be set to 0’s.
:

1This byte indicates whether Begin of File or End of File is being sent

Processing Begin or End of File Structured Fields

When the Begin or End of File structured fields are used with brackets or timeout intervals, the Begin or End of File SFs take precedence over the brackets or timeout intervals in determining when a print job begins or ends. See the following examples:

For predictable results, each data block must be enclosed by a Begin of File structured field and an End of File structured field. The following example shows three print jobs all delimited by Begin or End of File structured fields:

Begin Bracket, Begin of File Structured Field, ...Data1...,
End of File Structured Field,(job1)
Begin of File Structured Field, ...Data2..., End of File Structured Field, (job2)
Begin of File Structured Field, ...Data3..., End of File Structured Field,
End Bracket(job3)

PC/3270 always keeps track of brackets and timeout intervals. After the emulator receives a Begin of File structured field, it takes no action on Begin Brackets, End Brackets, or timeout until it receives an End of File structured field. After a valid End of File SF is processed, the emulator defaults to delimiting jobs by brackets or timeout intervals until it receives the next Begin of File structured field.

Begin or End of File Structured Field Error Conditions

PC/3270 does not accept transmission of data belonging to two separate print jobs in the same chain. To be accepted by the emulator, Begin of File structured fields must be the first structured field of a chain and End of File structured fields must be the last structured field of a chain.

PC/3270 rejects transmission in the following instances:

Processing SCS Data Streams

When processing an SCS data stream, PC/3270 treats Begin or End of File structured fields as follows:

Processing 3270 Data Streams

When processing a 3270 data stream, PC/3270 treats Begin or End of File structured fields as follows:

If PC/3270 receives a Begin of File structured field and an End of File structured field without at least one presentation space separating them, it ignores the structured fields.