3270 Data Stream Programming

 

Introduction

Like most IBM mainframe devices the IBM 3270 terminal offers a rich set of functionality to the programmer.  The problem with a lot of functionality is the corresponding complexity.  I will attempt to break down the complex data stream so that it can be more easily understood.  For now I will only concentrate on the basic 3270 model 2 that ruled the world when MVS 3.8 was alive and well.  I will also focus on the basics for now but reserve that right to add some of the advanced functionality at a later date

Data Stream Overview

The 3270 expects to see the following data presented in the proper sequence:

The Write Control Character (WCC) is a one byte command that is always the first byte of the data stream sent to the 3270.  It has the following format:

* Reset

Printout

Format

Start

Print

Sound

Alarm

Keyboard

Restore

Reset

MDT

0

1 2 3 4 5 6 7
Bit Meaning
0 The value of this bit is determined by the value of the other seven bits
1 Reset
2 Bits 2, 3 and 4 are used for controlling printing
3 since we are not concerned with printing right now we can
4 ignore these bits and always set them to zero
5 Will sound the alarm (make the terminal beep)
6 Unlocks the keyboard
7 Resets the Modified Data Tag bit for all input bits

A very common WCC to use is x'C3' or B'11000011'.  This WCC instructs the terminal to unlock the keyboard and clear the MDT for all input fields.

 

Next Page