RCXVCHK ;DAOU/ALA-Check for bad records ;26-DEC-2004
;;4.5;Accounts Receivable;**227**;Mar 20, 1995
;
;**Program Description**
; This program checks for records in the queue which
; does not have a bill number
;
EN ; Entry point
K ^TMP("RCXVBREC",$J)
S ^TMP("RCXVBREC",$J,0)=0
S BTN=0
BT S BTN=$O(^RCXV(BTN)) G EXIT:'BTN
S BIL=0
BL S BIL=$O(^RCXV(BTN,1,BIL)) G BT:'BIL
I $P($G(^PRCA(430,BIL,0)),"^",1)="" D
. NEW CT
. S CT=$G(^TMP("RCXVBREC",$J,0))+1,^TMP("RCXVBREC",$J,0)=CT
. S ^TMP("RCXVBREC",$J,CT,0)="Bill IEN: "_BIL_" does not have a Bill Number in File #430."
. S DA(1)=BTN,DA=BIL
. S DIK="^RCXV("_DA(1)_",1,"
. D ^DIK
. S $P(^RCXV(BTN,0),"^",7)=$P(^RCXV(BTN,0),"^",7)-1
G BL
;
EXIT K BTN,BIL,DA,DIK,RCXMGRP
Q
;
MSG ; Send mail message about bad record
I $G(^TMP("RCXVBREC",$J,0))=""!($G(^TMP("RCXVBREC",$J,0))=0) Q
S RCXMGRP=$$GET1^DIQ(342,"1,",20.02,"E")
I RCXMGRP="" S RCXMGRP="IRM"
S RCXMGRP="G."_RCXMGRP
S XMDUZ="CBO DATA EXTRACT",XMY(RCXMGRP)=""
S XMSUB="BAD RECORD(S) FOUND"
S XMTEXT="^TMP(""RCXVBREC"",$J,"
D ^XMD
K XMDUN,XMDUZ,XMZ,XMY,XMSUB,XMTEXT
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRCXVCHK 1139 printed Nov 22, 2024@16:59:40 Page 2
RCXVCHK ;DAOU/ALA-Check for bad records ;26-DEC-2004
+1 ;;4.5;Accounts Receivable;**227**;Mar 20, 1995
+2 ;
+3 ;**Program Description**
+4 ; This program checks for records in the queue which
+5 ; does not have a bill number
+6 ;
EN ; Entry point
+1 KILL ^TMP("RCXVBREC",$JOB)
+2 SET ^TMP("RCXVBREC",$JOB,0)=0
+3 SET BTN=0
BT SET BTN=$ORDER(^RCXV(BTN))
if 'BTN
GOTO EXIT
+1 SET BIL=0
BL SET BIL=$ORDER(^RCXV(BTN,1,BIL))
if 'BIL
GOTO BT
+1 IF $PIECE($GET(^PRCA(430,BIL,0)),"^",1)=""
Begin DoDot:1
+2 NEW CT
+3 SET CT=$GET(^TMP("RCXVBREC",$JOB,0))+1
SET ^TMP("RCXVBREC",$JOB,0)=CT
+4 SET ^TMP("RCXVBREC",$JOB,CT,0)="Bill IEN: "_BIL_" does not have a Bill Number in File #430."
+5 SET DA(1)=BTN
SET DA=BIL
+6 SET DIK="^RCXV("_DA(1)_",1,"
+7 DO ^DIK
+8 SET $PIECE(^RCXV(BTN,0),"^",7)=$PIECE(^RCXV(BTN,0),"^",7)-1
End DoDot:1
+9 GOTO BL
+10 ;
EXIT KILL BTN,BIL,DA,DIK,RCXMGRP
+1 QUIT
+2 ;
MSG ; Send mail message about bad record
+1 IF $GET(^TMP("RCXVBREC",$JOB,0))=""!($GET(^TMP("RCXVBREC",$JOB,0))=0)
QUIT
+2 SET RCXMGRP=$$GET1^DIQ(342,"1,",20.02,"E")
+3 IF RCXMGRP=""
SET RCXMGRP="IRM"
+4 SET RCXMGRP="G."_RCXMGRP
+5 SET XMDUZ="CBO DATA EXTRACT"
SET XMY(RCXMGRP)=""
+6 SET XMSUB="BAD RECORD(S) FOUND"
+7 SET XMTEXT="^TMP(""RCXVBREC"",$J,"
+8 DO ^XMD
+9 KILL XMDUN,XMDUZ,XMZ,XMY,XMSUB,XMTEXT
+10 QUIT