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

AZLPTBLD.m

Go to the documentation of this file.
AZLPTBLD ;PROGRAM TO LOAD ADA CODES TO GLOBAL FILE [ 12/20/85  2:27 PM ]
 ;READS TAPE FROM DEN LIBRARIAN FILE TBLDPR2 (DPSC,DFM)
 D INIT
 C UDEV
 O UDEV:("EFU":81:81)
 U UDEV W *5
 ;READ TO SKIP TAPE MARK
 U UDEV R REC 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
 C UDEV
 W !!,"RECORDS TO GLOBAL= ",DA
 I NEXT>0 W !,"ERRORS HAVE OCCURED, D ^%GL FOR ^DFMEADA"
 S ^AUTTADA(0)="ADA CODE^9999999.31I^"_DA_"^"_DA
 K F1,F2,F3,F4,BC1,BC2,BC3,BC4,EC1,EC2,EC3,RI,REC,UDEV,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)
 S V2=$E(REC,BC2,EC2)
 I $E(REC,60)'="T" S V3=$E(REC,62,66),V4=$E(REC,54) G ESPCS
 S V3=$E(REC,BC3,EC3)
 S V4=$E(REC,BC4)
ESPCS ; ELIMINATE TRAILING SPACES AND LEADING ZEROES
 F I=$L(V2):-1:1 I $E(V2,I)'=" " S V2=$E(V2,1,I) S:V2=" " V2="" Q
 S STP=$L(V3)
 F I=1:1:STP Q:$E(V3,1,1)'="0"  S LV3=$L(V3) S V3=$E(V3,2,LV3) 
 S:V3="0" V3=""
 S:V4=" " V4=""
 S DA=DA+1
 S DR=F1_V1_F2_V2_F3_V3_F4_V4
 D ^DIE
 D:$D(Y)'=0 ERROR
 U 0 W !,"RECORD INSERTED ",$E(REC,8,61)
 Q
ERROR ; THIS ROUTINE WILL LOAD AN ERROR GLOBAL
 S NEXT=NEXT+1,^DFMEADA(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,^AUTTADA,^DFMEADA
 S ^AUTTADA(0)="ADA CODE^9999999.31I^"
 S BC1=8,EC1=11,BC2=12,EC2=51,BC3=61,EC3=65,BC4=53
 S F1=".01///",F2=";.02///",F3=";.04///",F4=";.05///"
 S RI=0,DA=0,NEXT=0
 S UDEV=48
 S DIE="^AUTTADA("
 Q