REXX for CICS TS: High-level client/server support
REXX for CICS® TS introduces REXX language Client/Server support. REXX for CICS TS provides a high-level client/server capability.
- High-level, natural, transparent REXX client interface
- Support for REXX-based application clients and servers
- The ability to effectively integrate the strengths of z/OS® systems, mini-computers, and workstations in a transparent fashion.
- The ability to incrementally scale the size of computers' systems up or down (right-sizing).
- The simplification of complex application systems by breaking them down into manageable sets of clients and servers.
- Applications and data can be distributed throughout a network for better performance, integrity, or security.
- The ability for enterprise-wide access to data and applications, wherever they reside in the network, from a variety of unlike computer systems or workstations.
High-level, natural, transparent REXX client interface
REXX for CICS TS supports a high-level, easy to use interface from client REXX execs to application servers through the ADDRESS keyword instruction in REXX.
The ADDRESS instruction includes an external environment name that is used to determine the name of the external procedure that is called to process subsequent REXX command strings.
REXX for CICS TS provides the optional ability for the environment name (specified in the ADDRESS instruction) to be the name of an application server. This capability is provided by the REXX DEFCMD and DEFSCMD commands.
The DEFCMD command provides the ability to define (or redefine) REXX commands and environments, and it provides the ability to specify whether an environment-command combination is to be handled by a traditional CALLed routine or by an REXX application server.
Support for REXX-based application clients and servers
In addition to the REXX client interface, several facilities provide support for the use of application servers written in REXX.
One facility is the WAITREQ command, which is used by servers to wait for requests from clients. Another facility, the C2S and S2C commands, provide the ability for servers to fetch or set the contents of client variables. Another capability, Automatic Server Initiation (ASI) provides for servers to be started automatically when a request arrives from a client.
Here are some advantages of using REXX for implementing client/server solutions:
- The availability of REXX interpreter support under REXX for CICS TS with its quick development cycle and source-based interactive debugging allows the rapid prototyping and development of complex systems.
- The high-level client/server interfaces in REXX for CICS TS can improve development productivity and lower maintenance costs.
- Because REXX for CICS TS allows REXX clients and servers to be recoded in non-REXX languages, performance intensive parts of an application system can be selectively rewritten, if needed.
The FLST and EDIT commands that REXX for CICS TS provides are examples of client/server environments.
REXX client exec example
/* EXAMPLE REXX EXEC */
TRACE 'O' /* turn off source tracing */
ARG parm1 parm2 parm3
"CICS READQ TS QUEUE(MYQ) INTO(DATA) ITEM(5) NUMITEMS(1)"
if rc ¬= 0 then EXIT 100
SAY 'TSQ Data=' data
"CICS SEND TEXT FROM(DATA) ERASE"
/* Define the SERVER EXEC as a REXX command */
'DEFCMD REXXCICS SERVER = = SERVER1 (REXX'
/* example of directing a subcommand to a server */
/* named SERVER1, which is written in REXX also */
DATA = 1
'SERVER COMMAND1 DATA'
say data /* ==> 2 */
if rc ¬= 0 then SAY 'Request to SERVER1 failed, RC=' rc
EXIT
REXX server exec example
/* EXAMPLE REXX SERVER1 EXEC */
TRACE 'O' /* turn off source tracing */
/*----------------------------------------*/
/* Loop waiting on requests from clients */
/*----------------------------------------*/
Do Forever
'WAITREQ'
parse var request cmd varname
Select
When request = 'COMMAND1' then CALL command1
When request = 'COMMAND2' then CALL command2
When request = 'STOP' then CALL stop_server
Otherwise
End /* Select */
End /* Do Forever */
exit
/* subroutine to process command1 */
Command1:
'C2S' varname 'WORK'
WORK = WORK + 1
'S2C WORK' varname
return
/* subroutine to process command2 */
Command2:
return
/* routine to shut down this server */
stop_server:
say 'The Server is stopping'
exit