LU 6.2 API Application Programmer's Reference Guide (30294-90008)
Appendix B 169
Sample Programs
COBOL II Program
034800*----------------------------------------------------*
034900 302000-DISPLAY-ERROR-MESSAGE SECTION.
035000*----------------------------------------------------*
035100* This section evaluates the errorcode returned by the
035200* remote TP and writes an error message to the user’s
035300* terminal. The remote TP can return any of 3 error codes:
035400* 001 - The SS# is not in the database.
035500* 002 - The SS# is in the database, but the name does
035600* not match the name sent by the HP 3000.
035700* 003 - Miscellaneous system errors.
035800* Error codes 001 and 002 cause this section to call
035900* QUIT-SCREEN. Error code 003 causes this section to
036000* set QUIT_SW to YES_SW.
036100*
036200 IF ERROR-CODE IS EQUAL TO SYSTEM-ERROR-CD
036300 DISPLAY SYSTEM-ERROR-CD
036400 MOVE YES-SW TO QUIT-SW
036500 GO TO 302099-EXIT.
036600*
036700 IF ERROR-CODE IS EQUAL TO SOCSEC-ERROR-CD
036800 DISPLAY "SS# not on file - CREDIT DENIED"
036900 ELSE
037000 DISPLAY "Invalid Name".
037100*
037200 PERFORM 401000-QUIT-SCREEN.
037300*
037400 302099-EXIT.
037500 EXIT.
037600*
037700*----------------------------------------------------*
037800 401000-QUIT-SCREEN SECTION.
037900*----------------------------------------------------*
038000* This section asks the user if he or she is ready
038100* to quit. If the user responds 'Y', this section
038200* changes QUIT_SW to YES_SW.
038300*
038400 DISPLAY "READY TO QUIT (Y/N)?".
038500 ACCEPT QUIT-SW FREE.
038600*
038700 IF QUIT-SW IS NOT EQUAL TO YES-SW
038800 PERFORM 501000-FULL-SCREEN.
038900*
039000 401099-EXIT.
039100 EXIT.
039200*