STREAM3270 [ SNA IMF Programmer's Reference Manual ] MPE/iX 5.0 Documentation
SNA IMF Programmer's Reference Manual
STREAM3270
STREAM3270emulates typing a series of keystrokes on an IBM 3278 display
station keyboard.
Syntax
__________________________________________________________________
| |
| I I I CA |
| STREAM3270 (terminalid, cursorrow, cursorcolumn, outbuf,|
| |
| I I I |
| outbuflen, numprocessed, result) |
__________________________________________________________________
Parameters
terminalid (input)
Integer identifying the terminal. The terminalid is returned in a call
to the OPEN3270 intrinsic.
cursorrow (input and then output)
Integer indicating the row where the cursor is located:
0 through 11 (480-character screen)
0 through 23 (1920-character screen)
0 through 42 (3440-character screen)
When passed (input), the cursor is placed at the position you specify.
When returned (output), cursorrow is set to the final location of the
cursor after data has been entered. (The cursor moves as data is
entered, as if the data were being typed at a keyboard.)
cursorcolumn (input and then output)
Integer indicating the column where the cursor is located:
0 through 39 (480-character screen)
0 through 79 (1920-character screen)
0 through 79 (3440-character screen)
When passed (input), the cursor is placed at the position you specify.
When returned (output), cursorcolumn is set to the final location of the
cursor after data has been entered. (The cursor moves as data is
entered, as if the data were being typed at a keyboard.)
outbuf (input)
Character array containing simulated keyboard input. The allowable
character codes are as follows:
23 through 176 (octal)
241 through 377 (octal)
13 through 7E (hexadecimal)
A1 through FF (hexadecimal)
An illegal character code causes the remainder of outbuf to be ignored.
Most character codes are data that will be entered into a field.
Remaining character codes manipulate the internal screen image or its
state. If you attempt to enter data into a protected field, the result
parameter returns 10, and input is not disabled.
You can use the end-of-stream character (octal 23)to terminate the outbuf
string before outbuflen characters are put into the internal screen
image. The numprocessed parameter indicates the number of characters in
outbuf that were successfully processed. The end-of-stream character is
not included in the count returned in numprocessed.
Except for the end-of-stream character, each character code is equivalent
to a key on a 3278 keyboard. Table 3-3 lists the hexadecimal and octal
values allowed in the outbuf string, and it gives the equivalent 3278 key
for each value.
Table 3-3. STREAM3270 Character Codes
-------------------------------------------------------------------------------------------
| |
| Hexadecimal Code Octal Code Equivalent 3270 Key |
| |
| 13 23 None; end-of-stream delimiter |
| |
| 14 24 ERASE INPUT |
| |
| 15 25 ERASE EOF |
| |
| 16 26 ->| (tab) |
| |
| 17 27 |<- (back tab) |
| |
| 18 30 <- (back space) |
| |
| 19 31 -> (cursor right) |
| |
| 1A 32 ^ (cursor up) |
| |
| 1B 33 v (cursor down) |
| |
| 1C 34 DUP |
| |
| 1D 35 HOME |
| |
| 1E 36 Field Mark |
| |
| 1F 37 RESET (use as first character of outbuf |
| only) |
| |
| 20-7E 38-176 ASCII graphic characters |
| |
| 7F-A0 177-240 invalid codes |
| |
| A1-FF 241-377 ASCII graphic characters |
| |
-------------------------------------------------------------------------------------------
outbuflen (input)
Integer specifying the length of the outbuf string, in characters.
numprocessed (output)
Integer indicating the number of successfully processed characters in
outbuf. The count does not include the end-of-stream character (octal
23).
result (output)
The following values can be generated by the STREAM3270 intrinsic:
0 = Successful completion.
1 = Device not open.
9 = Host modified screen since last receive
request. (MPE V only)
10 = Attempt made to update a protected field.
12 = Invalid character in field or data stream.
14 = Attempt made to update a field or transmit
from an LU.T3 printer.
16 = Invalid cursor address was specified.
17 = Attempt made to write to a field where input
is inhibited.
22 = BASIC calling sequence error has occurred.
25 = Intrinsic call made while in split stack
mode.
26 = Intrinsic call made with the parameter value
out of bounds.
29 = Called intrinsic with a request already
outstanding. (No-wait I/O only)
30 = Internal error occurred in IMF intrinsic.
38 = Cannot start OUTBUF on an attribute byte.
53 = Invalid intrinsic called for data stream mode
device.
Description
The STREAM3270 intrinsic accepts an array of characters (the outbuf
parameter), interprets it as a series of keystrokes, and applies the
keystrokes to the internal screen image. STREAM3270 lets you enter data
into any unprotected field, erase data, and enable the keyboard.
You can use either STREAM3270 or WRITEFIELD to enter data into your
internal screen image. The WRITEFIELD intrinsic allows you to access a
field by its number and write only to that field. The STREAM3270
intrinsic allows you to move across the internal screen image and enter
data into more than one field with a single intrinsic call.
STREAM3270 does not cause data to be sent to the host; it just modifies
the internal screen image. Use TRAN3270 to send the internal screen
image to the host.
You can move the cursor in two ways: (1) by setting the initial cursor
location in the cursorrow and cursorcolumn parameters, and (2) by using
the octal codes in the outbuf parameter to move the cursor within your
data stream. Because it simulates keyboard input, STREAM3270 moves the
cursor as it enters data into the internal screen image. The cursorrow
and cursorcolumn parameters return the final position of the cursor.
STREAM3270 does not permit you to write over an attribute character or to
update a protected field. You will receive result code 38 if you attempt
to start STREAM3270 on an attribute character. If STREAM3270 finds an
attribute character in outbuf while it is writing into a screen, it
automatically skips over the character. If the next character in outbuf
is a data character, STREAM3270 writes the character in the next field
(assuming it is unprotected). If the field is protected, your program
receives result code 10.
Call the STREAM3270 intrinsic in non-transparent mode.
COBOL Calling Sequence
CALL "CSTREAM3270" USING TERMINALID CURSORROW CURSORCOLUMN OUTBUF
OUTBUFLEN NUMPROCESSED RESULT. (on MPE V and in compatibility mode on MPE
XL)
CALL INTRINSIC "STREAM3270" USING TERMINALID CURSORROW CURSORCOLUMN
OUTBUF OUTBUFLEN NUMPROCESSED RESULT. (in native mode on MPE XL)
All parameters are numeric data items except OUTBUF, which is an
alphanumeric data item.
FORTRAN Calling Sequence
CALL STREAM3270 (TERMINALID, CURSORROW, CURSORCOLUMN, OUTBUF, OUTBUFLEN,
NUMPROCESSED, RESULT)
All parameters are integer variables except for OUTBUF, which is a
character array.
BASIC Calling Sequence
CALL BSTREAM3270 (T, R9, C9, O$, L9, N5, R) (on MPE V and in
compatibility mode on MPE XL)
CALL STREAM3270 (T, R9, C9, O$, L9, N5, R) (in native mode on MPE XL)
All parameters are integer variables except for O$, which is a string
variable.
SPL Calling Sequence
STREAM3270 (TERMINALID, CURSORROW, CURSORCOLUMN, OUTBUF, OUTBUFLEN,
NUMPROCESSED, RESULT)
All parameters are integer variables except OUTBUF, which is a byte
array.
Pascal Calling Sequence
STREAM3270 (TERMINALID, CURSORROW, CURSORCOLUMN, OUTBUF, OUTBUFLEN,
NUMPROCESSED, RESULT);
All parameters are short integer variables except OUTBUF, which is a
packed array of char.
C/XL Calling Sequence
STREAM3270 (&TERMINALID, &CURSORROW, &CURSORCOLUMN, OUTBUF, &OUTBUFLEN,
&NUMPROCESSED, &RESULT);
All parameters are of type short, except OUTBUF, which is an array of
characters (a pointer to a char).
Pascal Program Excerpts
Following are excerpts from a Pascal program that calls SNA IMF
intrinsics. For examples of complete Pascal programs in non-transparent
and transparent modes, see appendix F, "Sample Programs."
{************************** Global Declarations **************************}
type
shortint = -32768..32767; { global type, two bytes (half word) }
.
.
.
var
terminalid : shortint; { value returned by OPEN3270 intrinsic }
result : shortint;
cursorrow : shortint;
cursorcolumn : shortint;
.
.
.
procedure STREAM3270; intrinsic;
.
.
.
{************************** Local Declarations **************************}
var
outbuf : packed array[1..MAXBUFSIZE] of char; { The variables }
outbuflen : shortint; { terminalid, result, cursorrow, }
numprocessed : shortint; { and cursorcolumn are global. }
.
.
.
{************** Variable Initialization and Intrinsic Call **************}
outbuflen := 51;
outbuf := 'logon applid(tso) data(sales/sales) logmode(imf2k) ';
{ Assume that cursorrow and cursorcolumn }
{ are set outside of this local procedure. }
STREAM3270 (terminalid, cursorrow, cursorcolumn, outbuf, outbuflen,
numprocessed, result);
MPE/iX 5.0 Documentation