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

AZLPTLAB.m

Go to the documentation of this file.
AZLPTLAB ;PROGRAM TO LOAD LAB CODES TO GLOBAL FILE [ 12/10/85  1:25 PM ]
 ;READS TAPE FROM LAB LIBRARIAN FILE TBLEF04 (DPSC,DFM)
 D INIT
 C UDEV
 O UDEV:("EFU":81:81)
 U UDEV W *5
 ;READ TO SKIP TAPE MARK
 U UDEV R REC
 F I=0:0 D RD1 Q:REC=""
 U 0 W !!,"E N D  O F  B U I L D "
 U 0 W !,"NUMBER OF RECORDS READ= ",RI
 U 0 W !,"BEGINING COUNT-RECORDS IN GLOBAL",DFN
 U 0 W !,"RECORDS ADDED TO GLOBAL",RTG
 C UDEV
 W !!,"TOTAL RECORDS IN GLOBAL= ",DA
 I NEXT>0 W !,"ERRORS HAVE OCCURED, D ^%GL FOR ^DFMELAB"
 K F1,F2,BC1,BC2,EC1,EC2,RI,REC,UDEV,DFN,RG,GCD,DG,RTG,NEXT
 Q
RD1 U UDEV R REC
 S RI=RI+1
 Q:REC=""
 I $E(REC,3,4)'="DC" G RD1
 S V1=$E(REC,BC1,EC1)
 U 0 W !,"CURRENT TAPE CODE",V2
 S V2=$E(REC,BC2,EC2)
ESPCS ; ELIMINATE TRAILING SPACES AND LEADING ZEROES
 F I=$L(V1):-1:1 I $E(V1,I)'=" " S V1=$E(V1,1,I) S:V1=" " V1="" Q
 I V2<GCD G WGLOBL
 I V2=GCD U 0 W !,"SKIP CODE ALREADY ON FILE",GCD G RD1
 F I2=0:0 D RDG Q:GCD'<V2
 I V2=GCD U 0 W !,"SKIP CODE ALREADY ON FILE",GCD G RD1
WGLOBL ; ADD NEW CODE TO GLOBAL
 S DA=DA+1,RTG=RTG+1
 S DR=F1_V1_F2_V2
 D ^DIE
 D:$D(Y)'=0 ERROR
 U 0 W !,"RECORD INSERTED ",$E(REC,8,42)
 Q
RDG ;READ NEXT GLOBAL RECORD
 I RG>DFN S GCD=999999 Q
 S RG=RG+1,GCD=$P(^AUTTLAB(RG,0),"^",2)
 U 0 W !,"CURRENT GLOBAL CODE",GCD
 Q
ERROR ; THIS ROUTINE WILL LOAD AN ERROR GLOBAL
 S NEXT=NEXT+1,^DFMELAB(NEXT)=REC
 Q
INIT ;ROUTINE TO SET UP VARIABLES
 K F1,F2,F3,F4,BC1,BC2,BC3,BC4,EC1,EC2,EC3,RI,REC,NEXT,UDEV,DFN,DG,GCD,RTG,^DFMELAB
 S BC1=13,EC1=42,BC2=8,EC2=12
 S F1=".01///",F2=";.02///"
 S DFN=$P(^AUTTLAB(0),"^",4),DG=0,RG=1,RTG=0,GCD="",RI=0,DA=DFN,NEXT=0
 S UDEV=48
 S DIE="^AUTTLAB("
 Q