AIBCVT2 ;IHS/DDPS/DFM-IBM STAT RECORDS BALANCING [ 01/12/89 1:09 PM ]
;1.3; 1/13/89 LOGBOOK TOTAL INCLUDES BATCH HEADER REC, HEADER INCLUDES LOOP NAME
;1.3 ;12/31/88 ; LOGBOOK COUNTS,FAC HEADING,RJE COUNTS
;1.3; 9/23/88 RESTRUCTURE, ALLOW FOR REGISTRATION ELIGIBILITY FILE
;1.0; 3/28/88
GBLHEAD ;PROCESS GLOBAL HEADINGS
S AIBGCTH=$P(AIBIN,U,4)
S Y=$P(AIBIN,U,1) X ^DD("DD") S AIBGBD=Y
S Y=$P(AIBIN,U,2) X ^DD("DD") S AIBGED=Y
U AIBPDV W #,?20,AIBCNM_" CONVERSION RUNNING",!
W !,"Global Beginning Date ",AIBGBD
W !,"Global Ending Date ",AIBGED
W !,"Global Header Record Count ",AIBGCTH
D DATIME^AIBCVT6 W !!,"Processing Begun ",AIBDT," ",AIBTI,! G RETURN
FACHEAD ;PRINT NEXT FACILITY HEADINGS
S AIBMSG=AIBCNM_" FOR "_AIBFNR_" PROCESSING - CODE = "_AIBFCD
U AIBPDV W #!!!,?10,AIBMSG
U AIBCDV W !!,AIBMSG," ",! S AIBMSG="" U AIBPDV
W !,"Facility Data Beginning Date ",AIBFBD
W !,"Facility Data Ending Date ",AIBFED
W !,"Facility Header Record Count ",AIBFCT,!
G RETURN
U AIBCDV W !,"Facility Records Created ",AIBCTO+AIBCTB,!
I AIBFILE="ibmjob" W "Facility RJE Data Records Created ",AIBCTW-AIBCTH,!
U AIBPDV W !!!,"Facility Records Read ",AIBCTI+AIBCTE+AIBCT2
S AIBGCTI=AIBGCTI+AIBCTI
I $L(AIBTGBL)=0 G WREJCT
W !,"Facility Records Written To ",AIBTGBL,"GLOB ",AIBCT2
S AIBGCT2=AIBGCT2+AIBCT2
WREJCT ;WRITE REJECTED COUNT
W !,"Facility Records Rejected ",AIBCTE S AIBGCTE=AIBGCTE+AIBCTE
I AIBCTB=0 G WTOTAL
W !,"Facility REG DEL/MRG Batch Header Records Created ",AIBCTB
S AIBGCTB=AIBGCTB+AIBCTB,AIBCTB=0
WTOTAL ;WRITE TOTAL RECORD COUNT
; I AIBFILE="ibmjob" G WRJETOT
W !,"Facility Records Written ",AIBCTO+AIBCTB
S AIBGCTO=AIBGCTO+AIBCTO,AIBCTO=0
G CKBAL
WRJETOT ;WRITE TOTAL CARDS CREATED
W !,"Facility RJE Data Records Created ",AIBCTW-AIBCTH
S AIBCTH=AIBCTW
CKBAL ;CHECK IF TOTALS BALANCE
S AIBCTI=AIBCTI+AIBCTE+AIBCT2
I AIBCTI=AIBFCT W !!,"Facility Counts Balanced" G ZEROUT
S AIBDIF=AIBFCT-AIBCTI
W !!,"********** Facility Counts Don't Balance **********"
W !," Facility Header Count = ",AIBFCT
W !," Input Count = ",AIBCTI
W !,$S(AIBDIF>0:" Over by ",1:" Short by "),AIBDIF K AIBDIF
ZEROUT ;RESET FACILITY COUNTERS
S (AIBCTI,AIBCTE,AIBCT2)=0 G RETURN
EOJ ;END OF JOB PROCESSING
U AIBPDV W #,?20,AIBCNM_" CONVERSION TOTALS",!
U AIBCDV W !,"Global Total Records Written ",AIBGCTO+AIBGCTB U AIBPDV
S AIBAGO=AIBAGO+AIBGCTO+AIBGCTB
S AIBCRG1=AIBGCTI,AIBGCTI=AIBGCTI+AIBGCTE
S AIBAGI=AIBAGI+AIBGCTI,AIBGCTI=AIBGCTI+AIBGCT2
W !!!,"Total Records Read ",AIBGCTI
W !,"Total Records Rejected ",AIBGCTE
I $L(AIBTGBL)=0 G CKDELMRG
W !,"Total Records Written to ",AIBTGBL,"GLOB ",AIBGCT2
S AIBTZ(0)=AIBTZ,AIBTZ=0
S AIBZ=0,AIBZZ=0,$P(@AIBTGLT,U,3)=AIBGCT2,$P(@AIBTGLT,U,4)=AIBGCT2
I $L(AIBTZ(0))=0 G CKDELMRG
S AIBZ=AIBZ(0),$P(@AIBTGFT,U,3)=AIBTZ(0),$P(@AIBTGFT,U,4)=AIBTZ(0)
CKDELMRG ;CHECK REGISTRATION DELETE MERGE PRESENT
I AIBGCTB=0 G GTOTS
W !,"Facility REG DEL/MRG Batch Header Records Created ",AIBGCTB
GTOTS ;GRAND TOTALS
I AIBFILE="keytap" G TAPE
W !,"Total RJE Data Record Count ",AIBCTW
W !,"Total RJE JCL Record Count ",AIBCTJ
W !,"Total RJE Records to Transmit ",AIBCTW+AIBCTJ
W !,"Total Records Written ",AIBGCTO+AIBGCTB
G BAL
TAPE ;TAPE TO BE CREATED
W !,"Total Records Written ",AIBGCTO+AIBGCTB
W !!,"******* Keytape Volume Serial Number To Create ",AIBV," *******"
BAL ;BALANCE LOGIC
I AIBGCTI=AIBGCTH W !!,"Global Counts Balanced" G CKLAST
S AIBDIF=AIBGCTH-AIBGCTI
W !!,"********** Global Counts Out of Balance **********"
W !," Global Header Count = ",AIBGCTH
W !," Input Count = ",AIBGCTI
W !,$S(AIBDIF<0:" Over by ",1:" Short by "),AIBDIF K AIBDIF
CKLAST ;IF REGISTRATION CHECK IF DONE
S (AIBGCTI,AIBGCTO,AIBGCTE,AIBGCT2,AIBGCTB,AIBCRG1)=0
I AIBGBLP'="AGEL" G RETURN
U AIBPDV W #,?17,"REGISTRATION CONVERSION LOGBOOK DATA",!
W !!,"TOTAL TO USE TO BALANCE TO INPUT ",AIBAGI
W !,"TOTAL RECORDS TO BE ENTERED INTO PCIS LOGBOOK ",AIBAGO
S (AIBAGI,AIBAGO)=0
RETURN ;RETURN TO CALLING PROGRAM
Q
AIBCVT2 ;IHS/DDPS/DFM-IBM STAT RECORDS BALANCING [ 01/12/89 1:09 PM ]
+1 ;1.3; 1/13/89 LOGBOOK TOTAL INCLUDES BATCH HEADER REC, HEADER INCLUDES LOOP NAME
+2 ;1.3 ;12/31/88 ; LOGBOOK COUNTS,FAC HEADING,RJE COUNTS
+3 ;1.3; 9/23/88 RESTRUCTURE, ALLOW FOR REGISTRATION ELIGIBILITY FILE
+4 ;1.0; 3/28/88
GBLHEAD ;PROCESS GLOBAL HEADINGS
+1 SET AIBGCTH=$PIECE(AIBIN,U,4)
+2 SET Y=$PIECE(AIBIN,U,1)
XECUTE ^DD("DD")
SET AIBGBD=Y
+3 SET Y=$PIECE(AIBIN,U,2)
XECUTE ^DD("DD")
SET AIBGED=Y
+4 USE AIBPDV
WRITE #,?20,AIBCNM_" CONVERSION RUNNING",!
+5 WRITE !,"Global Beginning Date ",AIBGBD
+6 WRITE !,"Global Ending Date ",AIBGED
+7 WRITE !,"Global Header Record Count ",AIBGCTH
+8 DO DATIME^AIBCVT6
WRITE !!,"Processing Begun ",AIBDT," ",AIBTI,!
GOTO RETURN
FACHEAD ;PRINT NEXT FACILITY HEADINGS
+1 SET AIBMSG=AIBCNM_" FOR "_AIBFNR_" PROCESSING - CODE = "_AIBFCD
+2 USE AIBPDV
WRITE #!!!,?10,AIBMSG
+3 USE AIBCDV
WRITE !!,AIBMSG," ",!
SET AIBMSG=""
USE AIBPDV
+4 WRITE !,"Facility Data Beginning Date ",AIBFBD
+5 WRITE !,"Facility Data Ending Date ",AIBFED
+6 WRITE !,"Facility Header Record Count ",AIBFCT,!
+7 GOTO RETURN
+1 USE AIBCDV
WRITE !,"Facility Records Created ",AIBCTO+AIBCTB,!
+2 IF AIBFILE="ibmjob"
WRITE "Facility RJE Data Records Created ",AIBCTW-AIBCTH,!
+3 USE AIBPDV
WRITE !!!,"Facility Records Read ",AIBCTI+AIBCTE+AIBCT2
+4 SET AIBGCTI=AIBGCTI+AIBCTI
+5 IF $LENGTH(AIBTGBL)=0
GOTO WREJCT
+6 WRITE !,"Facility Records Written To ",AIBTGBL,"GLOB ",AIBCT2
+7 SET AIBGCT2=AIBGCT2+AIBCT2
WREJCT ;WRITE REJECTED COUNT
+1 WRITE !,"Facility Records Rejected ",AIBCTE
SET AIBGCTE=AIBGCTE+AIBCTE
+2 IF AIBCTB=0
GOTO WTOTAL
+3 WRITE !,"Facility REG DEL/MRG Batch Header Records Created ",AIBCTB
+4 SET AIBGCTB=AIBGCTB+AIBCTB
SET AIBCTB=0
WTOTAL ;WRITE TOTAL RECORD COUNT
+1 ; I AIBFILE="ibmjob" G WRJETOT
+2 WRITE !,"Facility Records Written ",AIBCTO+AIBCTB
+3 SET AIBGCTO=AIBGCTO+AIBCTO
SET AIBCTO=0
+4 GOTO CKBAL
WRJETOT ;WRITE TOTAL CARDS CREATED
+1 WRITE !,"Facility RJE Data Records Created ",AIBCTW-AIBCTH
+2 SET AIBCTH=AIBCTW
CKBAL ;CHECK IF TOTALS BALANCE
+1 SET AIBCTI=AIBCTI+AIBCTE+AIBCT2
+2 IF AIBCTI=AIBFCT
WRITE !!,"Facility Counts Balanced"
GOTO ZEROUT
+3 SET AIBDIF=AIBFCT-AIBCTI
+4 WRITE !!,"********** Facility Counts Don't Balance **********"
+5 WRITE !," Facility Header Count = ",AIBFCT
+6 WRITE !," Input Count = ",AIBCTI
+7 WRITE !,$SELECT(AIBDIF>0:" Over by ",1:" Short by "),AIBDIF
KILL AIBDIF
ZEROUT ;RESET FACILITY COUNTERS
+1 SET (AIBCTI,AIBCTE,AIBCT2)=0
GOTO RETURN
EOJ ;END OF JOB PROCESSING
+1 USE AIBPDV
WRITE #,?20,AIBCNM_" CONVERSION TOTALS",!
+2 USE AIBCDV
WRITE !,"Global Total Records Written ",AIBGCTO+AIBGCTB
USE AIBPDV
+3 SET AIBAGO=AIBAGO+AIBGCTO+AIBGCTB
+4 SET AIBCRG1=AIBGCTI
SET AIBGCTI=AIBGCTI+AIBGCTE
+5 SET AIBAGI=AIBAGI+AIBGCTI
SET AIBGCTI=AIBGCTI+AIBGCT2
+6 WRITE !!!,"Total Records Read ",AIBGCTI
+7 WRITE !,"Total Records Rejected ",AIBGCTE
+8 IF $LENGTH(AIBTGBL)=0
GOTO CKDELMRG
+9 WRITE !,"Total Records Written to ",AIBTGBL,"GLOB ",AIBGCT2
+10 SET AIBTZ(0)=AIBTZ
SET AIBTZ=0
+11 SET AIBZ=0
SET AIBZZ=0
SET $PIECE(@AIBTGLT,U,3)=AIBGCT2
SET $PIECE(@AIBTGLT,U,4)=AIBGCT2
+12 IF $LENGTH(AIBTZ(0))=0
GOTO CKDELMRG
+13 SET AIBZ=AIBZ(0)
SET $PIECE(@AIBTGFT,U,3)=AIBTZ(0)
SET $PIECE(@AIBTGFT,U,4)=AIBTZ(0)
CKDELMRG ;CHECK REGISTRATION DELETE MERGE PRESENT
+1 IF AIBGCTB=0
GOTO GTOTS
+2 WRITE !,"Facility REG DEL/MRG Batch Header Records Created ",AIBGCTB
GTOTS ;GRAND TOTALS
+1 IF AIBFILE="keytap"
GOTO TAPE
+2 WRITE !,"Total RJE Data Record Count ",AIBCTW
+3 WRITE !,"Total RJE JCL Record Count ",AIBCTJ
+4 WRITE !,"Total RJE Records to Transmit ",AIBCTW+AIBCTJ
+5 WRITE !,"Total Records Written ",AIBGCTO+AIBGCTB
+6 GOTO BAL
TAPE ;TAPE TO BE CREATED
+1 WRITE !,"Total Records Written ",AIBGCTO+AIBGCTB
+2 WRITE !!,"******* Keytape Volume Serial Number To Create ",AIBV," *******"
BAL ;BALANCE LOGIC
+1 IF AIBGCTI=AIBGCTH
WRITE !!,"Global Counts Balanced"
GOTO CKLAST
+2 SET AIBDIF=AIBGCTH-AIBGCTI
+3 WRITE !!,"********** Global Counts Out of Balance **********"
+4 WRITE !," Global Header Count = ",AIBGCTH
+5 WRITE !," Input Count = ",AIBGCTI
+6 WRITE !,$SELECT(AIBDIF<0:" Over by ",1:" Short by "),AIBDIF
KILL AIBDIF
CKLAST ;IF REGISTRATION CHECK IF DONE
+1 SET (AIBGCTI,AIBGCTO,AIBGCTE,AIBGCT2,AIBGCTB,AIBCRG1)=0
+2 IF AIBGBLP'="AGEL"
GOTO RETURN
+3 USE AIBPDV
WRITE #,?17,"REGISTRATION CONVERSION LOGBOOK DATA",!
+4 WRITE !!,"TOTAL TO USE TO BALANCE TO INPUT ",AIBAGI
+5 WRITE !,"TOTAL RECORDS TO BE ENTERED INTO PCIS LOGBOOK ",AIBAGO
+6 SET (AIBAGI,AIBAGO)=0
RETURN ;RETURN TO CALLING PROGRAM
+1 QUIT