|
Across the Boards - APPX Peer-to-Peer Communications
APPX Sample ApplicationThe following is a pseudo-code skeleton of a simple cooperative accounting journal inquiry transaction program. The independent PC application asks the user for an account name to query and then for criteria to select line items to return. After the user enters his or her request the PC application retrieves the account data from the mainframe application(s). After displaying the data, the PC application allows the user to enter transactions against the account. These transactions are passed to the mainframe application, which either applies them or rejects them with a message. The PC application allows the user to continue entering transactions or querying accounts as long as desired.
Connecting: The entire process begins when the user opens the application on the PC. The PC program issues an APPX Connect request. This invokes the cooperative CICS transaction, which responds by issuing the answering APPX Connect. The PC is designated the sender after the two APPXs have established the session, and the mainframe immediately issues an APPX Receive and awaits a request from the PC. The query: The PC prompts the user for an account to query and for selection criteria. It builds an Acct_Status_Query record and issues an APPX Send to send it to the mainframe. After making the query request, the PC relinquishes control and becomes the receiver by issuing an APPX Receive. At this point, the record will be physically transmitted to the mainframe. The receive that the mainframe started earlier then completes, and the mainframe responds to the query by sending an Acct_Status_Header record. The header record contains a result code such as "OK", "Not Found", etc. If an error has occurred, the header record is the only record sent by the mainframe. If no error has occurred, the header record is followed by one record for each line item selected. After the last send, the mainframe returns to the top of its loop, issues an APPX Receive and waits for another request from the PC. Records are sent to the PC once the mainframe issues an APPX Receive or when the send buffer is full. The PC's APPX Receive now completes and returns the Acct_Status_Header record. If an error is returned, the PC knows that no other records follow and issues an error message to the user allowing him or her to make another request. If the query was successful, the PC displays the information from the header and retrieves any line items by issuing APPX Receives. After the last line item is received, the next APPX Receive command issued will return a "Turn_Around" status indicating the end of the transmission from the mainframe. The transaction: When an account is successfully retrieved, the PC allows the user to enter transactions against the account. The PC builds and sends a transaction record and then waits for the mainframe's response by issuing an APPX Receive. The mainframe receives the transaction record at the top of its main loop. The mainframe distinguishes a transaction record from an Acct_Status_Query record by a code in the records. The mainframe then attempts to apply the transaction and returns an indication of success or error to the PC. Finally, the mainframe waits for another request by issuing another APPX Receive. The PC now receives the mainframe's response, displays an appropriate message, and allows the user to enter another transaction or end the session. Ending the session: When the user exits the PC application, the program issues an APPX Disconnect and terminates. This disconnect is received by the mainframe while it is waiting for a query from the PC. When the mainframe receives the disconnect, it issues its own APPX Disconnect and terminates. The session is now ended. Across the Boards and APPX provide a reliable and easy to use vehicle for writing cooperative applications. APPX hides the messy details of the physical communications hardware and provides a high level interface to the application. The automatic handling of soft communications errors and data compression helps insure that applications are robust and fast. The extensive device support in Across the Boards virtually guarantees that applications will run on all of your existing communications hardware. APPX also requires minimal PC resources, making it practical to write cooperative applications under PC-DOS, Windows or OS/2.
Simplifications made In addition, APPX application can run in CMS, TSO, batch and other places in addition to CICS. Usually only scripting changes are required on the PC when moving between host environments (for example, the signon sequence to TSO will be different than for CICS), but the APPX portion of the application will remain mostly unchanged. APPX sessions can also be initiated from the host, going to a PC, or even host-to-host. APPX can support encryption and compression, and APPX can support many simultaneous sessions. While these area may require other changes in the application, the APPX portions will remain unchanged.
|