Sample TSO Client API program
The following sample program outlines the use of TSOC API functions. This sample program was invoked from another REXX™ program (not shown). You can find both the full sample program and the driver program to invoke the sample program in hlq.TSCRX.
The following steps were used to run the program:
- Invoke RCCUALOC(‘CREATE') to create and allocate required data sets and DD names.
- Invoke RCCTSTC to verify the connection to the distributed system.
- Invoke RCCGETDIR to get the directory where TSO Client is installed on the distributed system (if the information is needed by other APIs that are invoked).
- Invoke API functions required by the application.
- Invoke RCCUALOC(‘FREE') to free the DD names allocated.
/* parse the input arguments */
Parse Arg platform,CCtype,viewType,host,port
/* call RCCUALOC to create datasets and allocate DD names required */
Parse Value RCCUALOC(‘ALLOCATE') With rccret rccrsn rccmsg 1
/* call RCCTSTC to validate the connection to the distributed system */
Parse Value RCCTSTC(host,port) With rccret rccrsn rccmsg 2
/* call RCCGTDIR to get the current directory on the distributed system */
Parse Value RCCGTDIR(platform,CCtype,viewType,host,port,distributedUserName)
With rccret rccrsn rccmsg 3
< ----- Perform main functions of the application ------ > 4
/* call RCCUALOC to free DD names allocated */
Parse Value RCCUALOC(‘FREE') With rccret rccrsn rccmsg 5
Exit