AIBCVT6 ;IHS/DDPS/DFM-IBM STAT RECORD ERROR/EOJ [ 02/01/89 8:54 AM ]
;1.3; 9/23/88 RESTRUCTURE, ALLOW FOR REGISTRATION ELIGIBILITY FILE
;1.0; 3/28/88
;1.1; 5/30/88 ; ADD DSM LOGIC
ERRMSG ;PRINT ERROR MESSAGE TO CONSOLE AND PRINTER
U AIBCDV W !,AIBMSG
ERRMSP ; WRITE ERROR MESSAGE TO PRINTER ONLY
G:'$D(AIBPDV) RETURN U AIBPDV W !,AIBMSG S AIBMSG="" G RETURN
OPCANCL ;OPERATOR CANCLED JOB
D:$L(AIBMSG)>0 ERRMSG S AIBMSG="Operator Canceled Job"
G ABEND
MTERR ;ERROR WRITEING MAGTAPE
S AIBMSG="Write Error" D ERRMSG
ABEND ;ABNORMAL END OF JOB
D:$L(AIBMSG)>0 ERRMSG S AIBMSG="ABNORMAL END OF JOB"
D ERRMSG S AIBOK="N" G RETURN
CLOSEND ;EOJ OF JOB PROCESSING
D DATIME W ! S AIBMSG="Processing Ended "_AIBDT_" "_AIBTI D ERRMSG
G:'$D(AIBT1) CLOSPRNT I AIBOS="M" S AIBMSG="File Created : "_AIBT1 D ERRMSG
CLOSPRNT ;
U AIBCDV S (IO,AIBDEV)=AIBPDV D CLOSE^AIBSDEV
G:AIBTDV="" KILLALL S (IO,AIBDEV)=AIBTDV D CLOSE^AIBSDEV
KILLALL ;KILL ALL LOCAL VARIABLES AND INPUT DATA GLOBAL
K:'$D(AIBOK) @AIBGBL
K AIB2ND,AIBA,AIBAGI,AIBAGO,AIBB,AIBB1,AIBB2,AIBB3
K AIBC,AIBCDV,AIBCF,AIBCF1,AIBCF2,AIBCF3,AIBCK,AIBCL
K AIBCN1,AIBCN2,AIBCN3,AIBCNM,AIBCRG1,AIBCS
K AIBCT2,AIBCTB,AIBCTE,AIBCTH,AIBCTI,AIBCTJ,AIBCTO,AIBCTW
K AIBD0,AIBDIR,AIBDSH,AIBDT,AIBE,AIBED,AIBER
K AIBFNR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88 RESTRUCTURE, ALLOW FOR REGISTRATION ELIGIBILITY FILE
+2 ;1.0; 3/28/88
+3 ;1.1; 5/30/88 ; ADD DSM LOGIC
ERRMSG ;PRINT ERROR MESSAGE TO CONSOLE AND PRINTER
+1 USE AIBCDV
WRITE !,AIBMSG
ERRMSP ; WRITE ERROR MESSAGE TO PRINTER ONLY
+1 IF '$DATA(AIBPDV)
GOTO RETURN
USE AIBPDV
WRITE !,AIBMSG
SET AIBMSG=""
GOTO RETURN
OPCANCL ;OPERATOR CANCLED JOB
+1 IF $LENGTH(AIBMSG)>0
DO ERRMSG
SET AIBMSG="Operator Canceled Job"
+2 GOTO ABEND
MTERR ;ERROR WRITEING MAGTAPE
+1 SET AIBMSG="Write Error"
DO ERRMSG
ABEND ;ABNORMAL END OF JOB
+1 IF $LENGTH(AIBMSG)>0
DO ERRMSG
SET AIBMSG="ABNORMAL END OF JOB"
+2 DO ERRMSG
SET AIBOK="N"
GOTO RETURN
CLOSEND ;EOJ OF JOB PROCESSING
+1 DO DATIME
WRITE !
SET AIBMSG="Processing Ended "_AIBDT_" "_AIBTI
DO ERRMSG
+2 IF '$DATA(AIBT1)
GOTO CLOSPRNT
IF AIBOS="M"
SET AIBMSG="File Created : "_AIBT1
DO ERRMSG
CLOSPRNT ;
+1 USE AIBCDV
SET (IO,AIBDEV)=AIBPDV
DO CLOSE^AIBSDEV
+2 IF AIBTDV=""
GOTO KILLALL
SET (IO,AIBDEV)=AIBTDV
DO CLOSE^AIBSDEV
KILLALL ;KILL ALL LOCAL VARIABLES AND INPUT DATA GLOBAL
+1 IF '$DATA(AIBOK)
KILL @AIBGBL
+2 KILL AIB2ND,AIBA,AIBAGI,AIBAGO,AIBB,AIBB1,AIBB2,AIBB3
+3 KILL AIBC,AIBCDV,AIBCF,AIBCF1,AIBCF2,AIBCF3,AIBCK,AIBCL
+4 KILL AIBCN1,AIBCN2,AIBCN3,AIBCNM,AIBCRG1,AIBCS
+5 KILL AIBCT2,AIBCTB,AIBCT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