TRANSFER Programming Manual

Sample Client Code
Designing and Writing a Client
069138, Update 1 to 040970 Tandem Computers Incorporated 9–47
632 * function by setting key-value to 8. *
633 *********************************************************************
634
635 DISPLAY OVERLAY logon-screen AT overlay-area.
636
637 logon-display-data.
638
639 DISPLAY logon-screen.
640
641 logon-accept-data.
642
643 ACCEPT logon-screen
644 UNTIL
645 logon-key, f2, read-mail, discard-mail,
646 compose-mail, post-mail, return-key
647 ESCAPE ON
648 logoff-key.
649
650 MOVE TERMINATION-STATUS TO key-pressed.
651
652
653 IF logoff-request
654 GO TO logon-section-exit.
655
656 IF NOT logon-request
657 MOVE "FUNCTION KEY PRESSED IS NOT ALLOWED" TO ws-error
658 DISPLAY TEMP error-line of base-screen
659 GO TO logon-accept-data.
660
661 DISPLAY TEMP "LOGGING ON" in msg.
662
663 *********************************************************************
664 * (1) SETS UP THE IPC HEADER IN PREPARATION FOR STARTING A *
665 * SESSION. A client must establish a session as the first *
666 * act performed. The SESSION-ID field must be set to binary *
667 * zero for the TRANSFER delivery system to grant a session. *
668 *********************************************************************
669
670 MOVE -3 TO ih-request-code.
671 MOVE LOW-VALUES TO ih-session-id.
672 MOVE 1 TO ih-uows-to-process.
673
674 * To trace errors, set this field to "Y". For
675 * normal operation, set to "N".
676
677 MOVE "N" TO ih-log-this-ipc.
678
679 MOVE "START-SESSION" TO error-name.
680 MOVE ZERO TO uow-ss-applic-id.
681 MOVE 19 TO uow-ss-century.
682 ACCEPT uow-ss-accept-date FROM DATE.
683 ACCEPT accept-time FROM TIME.
684 MOVE accept-time1 TO uow-ss-accept-time.
685
686 BEGIN-TRANSACTION.
687
688 * A -3 in the IPC header forces the TRANSFER delivery system to process all UOWs
689 * passed. However, if the ipc header is not valid, the reply will
690 * contain only the ipc-hdr.
691
692 *********************************************************************
693 * (2) SENDS THE IPC TO START A SESSION (within a TMF transaction) *
694
695 *********************************************************************
696
697 SEND ipc-hdr, start-session-uow
698 TO "TISERV"
699 REPLY CODE 0, 1, 2 YIELDS ipc-hdr, start-session-rsp
700 CODE 3 YIELDS ipc-hdr