>>-pt3270--fd--option------------------------------------------><
Function
pt3270 invokes
the tcgetattr and tcsetattr callable services to query, set, and reset
3270 passthrough mode.
A REXX program running
under a shell started from the OMVS TSO/E command can use this service
to send and receive a 3270 data stream or issue TSO/E commands.
Parameters
- fd
- The file descriptor for the file.
- option
- A number that identifies the service being requested:
- Number
- Service
- 1
- Query 3270 passthrough support for this file.
Upon return,
RETVAL will contain a code for the current state of the file descriptor,
or -1 if there is an error.
- 0 or -1
- This file cannot support 3270 passthrough mode.
- 1
- This file can support 3270 passthrough mode.
- 3
- This file is currently in 3270 passthrough mode.
- 2
- Set 3270 passthrough support for this file. If this is attempted
on a file that does not support 3270 passthrough mode, upon return
RETVAL contains -1 and ERRNO contains the value for ENOSYS.
- 3
- Reset 3270 passthrough support for this file.
Example
The following is an example of
a REXX program that can accept a TSO/E command as its argument and
issue the command through OMVS using 3270 passthrough mode. This
REXX program would be located in the HFS and run as a command from
the shell.
/* rexx */
parse arg cmd
if cmd=' then return
address syscall
'pt3270 1 2' /* set passthrough mode on stdout */
if retval=-1 then
do
say 'Cannot set passthrough mode' retval errno errnojr
return
end
buf='ff51000000010001'x ||, /* OMVS passthrough command */
d2c(length(cmd),4) || cmd
"write 1 buf" /* send command to OMVS */
"read 1 ibuf 1000" /* discard the response */
'pt3270 1 3' /* reset passthrough mode */
return 0