Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: AUIBMSYS

AUIBMSYS.m

Go to the documentation of this file.
AUIBMSYS ;IBM SYSTEM INTERFACE [ 05/16/85  2:56 PM ]
 ;TOM FISHER
 S %RECORD=0,%HT=1,%ER=0,%PT=80
 S $ZE="ERROR^IBMSYS"
 S %ERRMSG="TRANSMISSION ERROR HAS OCCURED"
 U %PORT:(0::::5),0:(0::::5) B 0
TMEPLX ; WAKEUP TIMEPLEX PORT
 S %RESP=""
 S FUNCT=">>>"
 D PROCIO
TMPLXOK ; WAKEUP COMTEN
 S %RESP="COMTEN"
 S FUNCT="CONNECT COMPLETE"
 D PROCIO
CMTENOK ; WAKEUP CICS
 H %HT
 U %PORT
 W *13
 S %RESP=""
 S FUNCT="invalid-sw-chars"
 D PROCIO
 ; INTERACT WITH CICS
 S %RESP="CICS"
 S FUNCT="INDIAN HEALTH SERVICE "
 D PROCIO
IBMRDY ; MAKE SURE IBM CICS READY
 S %RESP=""
 S FUNCT="READY"
 D PROCIO
TRNSRDY ; SIGNON TO MAINFRAME
 S %RESP="CSSN PS=TPSM,NAME=FISHER"
 S FUNCT="SIGN-ON IS COMPLETE"
 D PROCIO
STRTTRN ; START TRANSACTION
 S %RESP="PCXT"
 S FUNCT="PCXT CONNECT"
 D PROCIO
SEQPCXT ; SEQUENCE SYSTEM WITH REMOTE SYSTEM
 S %RESP="START"
 S FUNCT="PCXT READY"
 D PROCIO
PCXTPRO S %X="" F I=0:0 S %X=$O(^RGTXDATA(%X)) G:%X="" GLOBEND  S %DATA=^RGTXDATA(%X) S %CRC(0)=0 S %CRC=%DATA D CALCRC S %RECORD=%RECORD+1 S %RESP="^D^"_%CRC(0)_%DATA S FUNCT="CRC" D PROCIO U 0
CALCRC ; CALCULATE CRC FOR DATA LINE
 F %CRC(1)=1:1:$L(%DATA) S %CRC(0)=%CRC(0)+$A(%CRC,%CRC(1))
 Q
GLOBEND U 0 W !!,"TOTAL RECORDS SENT  ",%RECORD
 K %RECORD
ENDPCXT ; END TRANSACTION POCISSING
 S %RESP="^*END*^"
 S FUNCT="^STP^"
 D PROCIO
 G LOGOFF
 ; WRITE RECORD NUMBER OF ERROR
EXIT W !!,"TRANSMISSION EROR HAS OCCURED",*7,*7,*7,*7
 W !!,"TRANMISSION MUST BE RESTARTED"
 W !!,"RECORD COUNT SENT BEFORE FAILURE ",%RECORD
LOGOFF ; LOGOFF IBM SYSTEM
 S %RESP="CSSF LOGOFF"
 S FUNCT="SIGN-OFF IS COMPLETE"
 S %ERRMSG="SIGNOFF TO IBM FAILED"
 S %ER=1
 D PROCIO
 G EXIT^AUTRANS
ERROR U 0 W !!,*7,"DISCONNECT FROM SYSTEM"
 G EXIT^AUTRANS
PROCIO ; GENERAL I/O TO PORT
 S %XS="" F L=1:1:700
 S %RT=0
 I %PT>79 W ! S %PT=0
 U 0 W "." S %PT=%PT+1
 U %PORT  W:$L(%RESP) %RESP W *13
PORTIO ;
 U %PORT R %Y:0 S %CR=$ZB
 S %XS=%XS_%Y
 G:%RT=3000 PORTERR  S %RT=%RT+1
 G:%XS[FUNCT PORTOK
 G PORTIO:$L(%RESP),PORTIO:$L(%Y) G PORTIO
PORTOK Q
 ; TIMEOUT ERROR ENTER THIS ROUTINE IF NO RESPONSE
 ; FROM COMMUNICATIONS PORT
PORTERR U 0 W !,%ERRMSG,%XS G:%ER EXIT^AUTRANS G EXIT
END ; END OF ROUTINE