home *** CD-ROM | disk | FTP | other *** search
- /* */
- /* REXX/APPC transaction program sample (requester) */
- /* */
- trace off
- /* */
- /* Tell Rexx that there is a new function available */
- /* */
-
- CALL RXFUNCADD APPC,SAAAPPC,APPCSRV
-
- /* */
- /* start a Transaction Pgm (i.e., tell APPC we're here and running)*/
- /* */
-
- rc=appc('Tp_started',,'TP1','Lu1s.')
-
- if rc=0 then do
-
- tpid=lu1s.0 /* save the transaction pgm id */
-
- /* */
- /* Open (allocate) a conversation with Transaction pgm (TP) TP2 */
- /* which is located on Node prompted for */
- /* Note the Userid and Password data format. */
- /* */
-
- say 'Enter Partner LU name'
- pull plu .
- rc=appc('Allocate',lu1s.0,plu,'#BATCH','TP2','MAPPED','A','N', 'N','Lu1P.')
-
- if rc=0 then do
-
- convid=lu1p.1 /* save the conversation id */
-
- /* */
- /* Lets send some data ('Hello from tp1') to our partner */
- /* */
- /* Note: as this is a 'Mapped' conversations, the length info */
- /* is NOT part of the actual data. */
- /* */
-
- rc=appc('Send_data',tpid,convid,'Mapped','Hello from tp1')
-
- /* */
- /* Now Lets receive send some data from our partner */
- /* Our partner will have to turn the conversation around */
- /* */
-
- rc=appc('Receive_wait',tpid,convid,'Mapped','data.',1000)
- say data.2
-
-
- end
- else Say 'Allocate failed rc=' c2x(Lu1P.2) 'Secondary rc=' c2x(Lu1P.3) 'Sense=' c2x(Lu1p.4)
-
- /* */
- /* Well, we're done now. So tell APPC we're done. APPC */
- /* will close the conversation. */
- /* */
- rc=appc('Tp_ended',tpid)
- end
- else do
- say 'Communications manager has not been started'
- say 'or is not configured for APPC'
- end