For item #2 you could try the following variables.
&SYSLTERM and &SYSWTERM
Last Updated: 2026-04-29
&SYSLTERM provides the number of lines available for applications on your
terminal screen. &SYSWTERM provides the width of the screen.
&SYSLTERM and &SYSWTERM can be used when a CLIST reformats the screen using
Session Manager commands. For example, a CLIST called HORZNTL splits the
terminal screen horizontally based on the number of lines on the screen and its
width. The following section of HORZNTL substitutes the control variables in
the Session Manager commands that define the windows for the reformatted
screen. By using &SYSLTERM and &SYSWTERM instead of explicit screen positions,
HORZNTL makes optimal use of the space available on a given screen.
I believe they are considered to be part of the TSO/E CLIST world but you can
use them in REXX.
I've used them in REXX execs like the following.
/* REXX */
Say '-------------------------------------------------------'
SAY 'Current Date/Time -' DATE('W') '--' DATE() '--' TIME() ;
Say ' '
Say 'User ID --------' SYSVAR(SYSUID)
Say ' '
Say 'Terminal -------' SYSVAR(SYSTERMID)
Say 'Terminal size --' SYSVAR(SYSLTERM) SYSVAR(SYSWTERM)
Say 'TSO logon proc -' SYSVAR(SYSPROC)
Say 'LPAR name ------' MVSVAR('SYSNAME')
Say 'Hardware Name --' MVSVAR('SYMDEF','HRDWNAME')
Say 'Sysplex name ---' MVSVAR('SYSPLEX')
Say 'JES2 Node Name -' SYSVAR(SYSNODE) '-' SYSVAR(SYSJES)
Say 'z/OS level -----' MVSVAR('SYSOPSYS')
Say '-------------------------------------------------------'
EXIT
Paul
-----Original Message-----
From: IBM Mainframe Discussion List <[email protected]> On Behalf Of
Charles Mills
Sent: Wednesday, June 17, 2026 05:16 PM
To: [email protected]
Subject: Two TSO terminal I/O from Rexx questions
1. If one were writing a Rexx exec to run in an interactive TSO environment,
what would be the best way to clear the screen and make the next SAY write to
the first line of the screen? Calling out to a user-written assembler routine
that used the STLINENO macro? Or ... ?
2. From a Rexx exec running in interactive TSO, what would be the best way to
determine the number of lines on the terminal? Basically the number of SAYs
that one could do before the user received a *** prompt?
Any related considerations?
Thanks,
Charles
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to
[email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN