REXX/CICS Server Exec Example
/* EXAMPLE REXX/CICS 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
High-level Client/Server Support
Chapter 23. REXX/CICS High-level Client/Server Support 293