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

ASUAWXT.m

Go to the documentation of this file.
  1. ASUAWXT ;DSD/DFM - EXTRACT TRANS - CONVERT TO DDPS FORMAT ; [ 04/15/98 3:00 PM ]
  1. ;;3.0;SAMS;**1**;AUG 20, 1993
  1. BEGIN ;EP;FOR RE-EXTRACT//^ASUAWXTW
  1. D:'$D(U) ^XBKVAR
  1. I '$D(IO(0)) S IOP=$I D ^%ZIS
  1. S ASUW("RUN TYPE")=$G(ASUW("RUN TYPE"))
  1. S:ASUW("RUN TYPE")']"" ASUW("RUN TYPE")=0
  1. S ASUW("TYPE LAST RUN")=^ASUTLRUN(1,0)
  1. I $P(ASUW("TYPE LAST RUN"),U,2)=8 G REXT2^ASUAWXTW
  1. S ASUX("EXTRACT DATE")=DT
  1. OPNHFS ;EP;FOR RE-EXTRACT//^ASUAWXTW
  1. S ASUW("SAVE MEDIUM")=$P(ASUW("TYPE LAST RUN"),U,9)
  1. S ASUK("WAREHOUSE")=$G(ASUK("WAREHOUSE"))
  1. I ASUK("WAREHOUSE")<2 D ^ASUAWBTS
  1. K ^ASUPDATA
  1. ;KILL OF UNSUBSCRIPTED GLOBAL - EXTRACT FOR AIB TO DATA CENTER - NEW EACH MONTH
  1. S ASULNPAD=""
  1. S (ASUC(0),ASUC("TOT REC COUNT"),ASUC("ACCUMULATE COUNT"),ASUC("TOT PROC"))=0
  1. F ASUG("FILE NUMBER")=1:1:7 D
  1. .S ASUC(0)=ASUC(0)+1
  1. .S ASUG("SAVE NODE")="^ASUTRSV("_ASUG("FILE NUMBER")_",ASUX(""RECORD #""),"
  1. .S ASUG("TRAN GLOBAL")=U_$P(^ASUXCTRL(ASUG("FILE NUMBER"),0),U,2)
  1. .S ASUG("TRAN CODE PIECE #")=$P(^ASUXCTRL(ASUG("FILE NUMBER"),0),U,4)
  1. .S ASUG("AREA CODE PIECE #")=$P(^ASUXCTRL(ASUG("FILE NUMBER"),0),U,7)
  1. .S ASUG("ZERO NODE")=ASUG("TRAN GLOBAL")_"(0)"
  1. .S DIE=$E($P(@ASUG("ZERO NODE"),U,2),1,10)
  1. .S ASUX("FILE NAME")=$P(@ASUG("ZERO NODE"),U)
  1. .I ASUK("WAREHOUSE")<2 S ASUTRX="W !,""Now Processing "_ASUX("FILE NAME")_" Records"",!" D LOG^ASUAUTIL
  1. .S ASUX("SORT XREF")=$S($P(ASUW("TYPE LAST RUN"),U,2)=8:"AX",1:"C")
  1. .I ASUX("SORT XREF")="AX" D
  1. ..S (ASUX("STATUS"),ASUX("READ STATUS"))=ASUX("EXTRACT DATE")
  1. ..S ASUX("READ STATUS")=ASUX("READ STATUS")-1
  1. .E D
  1. ..S ASUX("READ STATUS")=$S($P(ASUW("TYPE LAST RUN"),U,2)=9:"X",1:"T")
  1. ..S ASUX("STATUS")=$S(ASUX("READ STATUS")="X":"Y",1:"U")
  1. .S ASUX("RECORD #")=""
  1. .S ASUG("FIND STATUS")=ASUG("TRAN GLOBAL")_"(ASUX(""SORT XREF""),ASUX(""READ STATUS""))"
  1. .S ASUG("FIND RECORD")=ASUG("TRAN GLOBAL")_"(ASUX(""SORT XREF""),ASUX(""READ STATUS""),ASUX(""RECORD #""))"
  1. .F S ASUX("READ STATUS")=$O(@ASUG("FIND STATUS")) Q:ASUX("READ STATUS")'=ASUX("STATUS") D
  1. ..F S ASUX("RECORD #")=$O(@ASUG("FIND RECORD")) Q:ASUX("RECORD #")="" D
  1. ...S DA=ASUX("RECORD #"),ASUX("EXTR FLAG")=1
  1. ...I ASUK("WAREHOUSE")<2 D ^ASUAWXT1
  1. ...Q:ASUX("SORT XREF")="AX"
  1. ...S ASUC("TOT PROC")=ASUC("TOT PROC")+1
  1. ...I ASUX("EXTR FLAG") S DR=".09///"_ASUX("EXTRACT DATE")_";.08///X" D ^DIE
  1. .S ASUC(ASUG("FILE NUMBER"))=ASUC("TOT REC COUNT")-ASUC("ACCUMULATE COUNT")
  1. .S $P(^ASUXCTRL(ASUG("FILE NUMBER"),0),U,5)=ASUC(ASUG("FILE NUMBER"))
  1. .S $P(^ASUXCTRL(ASUG("FILE NUMBER"),0),U,6)=ASUX("EXTRACT DATE")
  1. .S ASUC("ACCUMULATE COUNT")=ASUC("TOT REC COUNT")
  1. .I ASUK("WAREHOUSE")<2 S ASUTRX="W !,"""_ASUX("FILE NAME")_" Record Count : "","_$P(^ASUXCTRL(ASUG("FILE NUMBER"),0),U,5) D LOG^ASUAUTIL
  1. S ASUTRX="W !,*7,""Conversion Completed"",*7" D LOG^ASUAUTIL
  1. S ASUTRX="W !,""Total records processed: "","_ASUC("TOT PROC") D LOG^ASUAUTIL
  1. I ASUC("TOT REC COUNT")=0 D
  1. .S ASUTRX="W !,""There were no current records converted"",*7,!"
  1. .D LOG^ASUAUTIL
  1. .I 1
  1. E D
  1. .S ASUTRX="W !,""Total records converted "","_ASUC("TOT REC COUNT")
  1. .D SETAREA^ASUAUARE
  1. .S ^ASUPDATA(0)=ASUK("ASUFAC")_U_ASUK("AREA NAME")_U_ASUX("EXTRACT DATE")_U_ASUX("EXTRACT DATE")_U_ASUX("EXTRACT DATE")_U_U_ASUC("TOT REC COUNT")
  1. .I ASUK("WAREHOUSE") D
  1. ..I ASUW("RUN TYPE") S $P(^ASUTLRUN(1,0),U,8)=ASUX("EXTRACT DATE") D ^ASUAWXT2
  1. .E D
  1. ..S $P(^ASUTLRUN(1,0),U,8)=ASUX("EXTRACT DATE") D ^ASUAWXT2
  1. .S AUMED=$S(ASUW("SAVE MEDIUM")]"":ASUW("SAVE MEDIUM"),1:"F") D SAVE
  1. I $G(ASUK("PRINT QUEUED"))'=1 S DIR(0)="E" D ^DIR
  1. K ASUX,ASU0,ASU1,ASU2,ASUC,ASUG,ASUT,ASUNPAD,ASULNPAD,ASUFTAPE,AUGL
  1. K DA,DR,DIE,DTOUT,DUOUT,DIROUT
  1. K:$G(ASUW("RUN TYPE"))="" ASUV,ASUW
  1. Q
  1. SV1 ;EP ;
  1. S AUMED="F",AUUF="/usr/spool/uucppublic"
  1. S:'$D(ASUK("WAREHOUSE")) ASUK("WAREHOUSE")=1
  1. SAVE ;EP; SAVE GLOBAL
  1. I ASUK("WAREHOUSE")=2 Q
  1. S AUGL="ASUPDATA" D ^AUGSAVE K AUGL
  1. I AUFLG D
  1. .S ASUTRX="W !!,""Save of ASUPDATA Unsucessful - """ D LOG^ASUAUTIL
  1. .F ASU("AUFLG")=1:1 Q:'$D(AUFLG(ASU("AUFLG"))) D
  1. ..S ASUTRX="W """_AUFLG(ASU("AUFLG"))_""",!" D LOG^ASUAUTIL
  1. K AUFLG
  1. Q
  1. S AUGL="ASUTRSV",AUMED="F" D ^AUGSAVE K AUGL
  1. I AUFLG D
  1. .S ASUTRX="W !!,""Save of ASUTRSV Unsucessful - """ D LOG^ASUAUTIL
  1. .F ASU("AUFLG")=1:1 Q:'$D(AUFLG(ASU("AUFLG"))) D
  1. ..S ASUTRX="W """_AUFLG(ASU("AUFLG"))_""",!" D LOG^ASUAUTIL
  1. K AUFLG
  1. Q