Previous Topic: DOM()

Next Topic: DSNENQ()

DS3270()

Use the DS3270() function to build and decompose IBM 3270 data streams.

Syntax

The DS3270() function has this syntax:

Form 1:

string = DS3270(TO,{RA,[trows],[tcols],row,col,[char]})
                   {SBA,[trows],[tcols],row,col}
                   {SF,[attributes]}

Form 2:

rowcol = DS3270(FROM,SBA,[trows],[tcols],sba)

Form 3:

aid = DS3270(FROM,PARSE,[trows],[tcols],image)

Form 4:

text = DS3270(FROM,FIELD,[trows],[tcols],row,col,image)

Arguments

The DS3270() function takes these arguments:

string

3270 data.

TO

Converts to a 3270 data stream.

SBA

Produces a three-byte SBA sequence.

RA

Produces a four-byte RA sequence (if char is not specified, only 3 bytes are generated).

trows

Total rows on the display screen.

tcols

Total columns on the display screen.

row

Specific row position, 1-based.

col

Specific column position, 1-based.

char

Single character to be repeated to the screen address specified by row, col. This is only valid for an RA operation. The character will be repeated up to but not into the screen position specified by row, col.

SF

Produces a 2-byte SF sequence.

attributes

One or more of the following attributes:

HIGH

Displays the field in high intensity.

MDT

Modified data tag. When set, the field is returned as input. Note that this value can be reset by the terminal operator for unprotected fields, but protected fields cannot be altered by the operator or be prevented from being transmitted.

NODISP

Makes the field invisible on the screen.

NUM

For an input field, only numeric data can be physically entered.

PEN

Makes the field pen-selectable.

PROT

Protects the field.

SKIP

During the course of data entry, when the cursor moves onto a SKIP attribute (protected field only), the cursor immediately skips to the next input field.

Default:The field is available for terminal operator input.

Return Codes

The DS3270() function produces these return codes:

101 - 107

ARG n MISSING OR INVALID

121

FIELD NOT PRESENT

Example

/* This Example processes a logon screen and extracts the input */

input = lu2('sendrec',rpl,screen)
 if rc ^= 0 then signal error_lu2
x = ds3270('from','parse',,,input)
 parse upper var x aid .
 if aid = 'PF3' then exit
limit = queued()
if limit ^= 6  then do
    say 'Invalid field count on logon screen'
    return
    end
parse pull row.1 col.1        /* get coordinates of user ID  */
parse upper pull userid .
 parse pull row.2 col.2        /* get coordinates of password */
parse upper pull password .
 parse pull row.3 col.3        /* get coordinates of program  */
parse upper pull program .
 
return