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

BNIGVLU.m

Go to the documentation of this file.
BNIGVLU ; IHS/CMI/LAB - GEN RETR UTILITIES ;
 ;;1.0;BNI CPHD ACTIVITY DATASYSTEM;;DEC 20, 2006
 ;
RZERO(V,L) ;ep right zero fill 
 NEW %,I
 S %=$L(V),Z=L-% F I=1:1:Z S V=V_"0"
 Q V
LZERO(V,L) ;left zero fill
 NEW %,I
 S %=$L(V),Z=L-% F I=1:1:Z S V="0"_V
 Q V
LBLK(V,L) ;left blank fill
 NEW %,I
 S %=$L(V),Z=L-% F I=1:1:Z S V=" "_V
 Q V
XTMP(N,D) ;EP - set xtmp 0 node
 Q:$G(N)=""
 S ^XTMP(N,0)=$$FMADD^XLFDT(DT,14)_"^"_DT_"^"_$G(D)
 Q
PROC ;EP
 NEW BNIGZ,BNIGY,BNIGP
 S BNIGZ=0 F  S BNIGZ=$O(^BNIREC("C",DFN,BNIGZ)) Q:BNIGZ=""  D
 .S BNIGY=$P(^BNIREC(BNIGZ,0),U,12)
 .Q:BNIGY<BNIGBD
 .Q:BNIGY>BNIGED
 .Q:$P(^BNIREC(BNIGZ,0),U,4)=""
 .S X($P(^BNIREC(BNIGZ,0),U,4))=""
 .Q
 K BNIGZ,BNIGY,BNIGP
 Q
CALC ;ENTRY POINT
 I Y=0!(X=0) S Z="**" G COMMA
 S Z=(((X/Y)-1)*100),Z=$FN(Z,"+,",1)
COMMA ;
 S X=$FN(X,",")
 ;S X2=0,X3=$S($L(X)>3:($L(X)+($L(X)\3)),1:$L(X)) D COMMA^%DTC S X=$E(X,1,($L(X)-1))
 Q
DONE ;ENTRY POINT - END OF REPORT TIME DISPLAY
 I $D(BNIGET) S BNIGTS=(86400*($P(BNIGET,",")-$P(BNIGBT,",")))+($P(BNIGET,",",2)-$P(BNIGBT,",",2)),BNIGH=$P(BNIGTS/3600,".") S:BNIGH="" BNIGH=0 D
 .S BNIGTS=BNIGTS-(BNIGH*3600),BNIGM=$P(BNIGTS/60,".") S:BNIGM="" BNIGM=0 S BNIGTS=BNIGTS-(BNIGM*60),BNIGS=BNIGTS W !!,"RUN TIME (H.M.S): ",BNIGH,".",BNIGM,".",BNIGS
 I $E(IOST)="C",IO=IO(0) S DIR(0)="EO",DIR("A")="End of report.  HIT RETURN" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 W:$D(IOF) @IOF
 K BNIGTS,BNIGS,BNIGH,BNIGM,BNIGET
 Q