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

AZSLS03.m

Go to the documentation of this file.
  1. AZSLS03 ; LOAD S03 TABLE INTO PROVIDER/VENDOR [ 12/23/85 1:50 PM ]
  1. K
  1. S U="^",BEEP=$C(7)_$C(7),QFLG=0,INC=0
  1. S DIC=9999999.09,DIC(0)="XLF",DLAYGO=9999999.09,DUZ(0)="@"
  1. U 0 W !,"Opening input file. Please wait."
  1. O 47:("AFU":81:81) U 47 G:$ZA\32768#2 OERR
  1. U 47 W *5
  1. F L=0:0 D PROC Q:QFLG
  1. U 0 W !!,"Records read=",INC,!
  1. I QFLG=1 U 0 W !!,"Error encountered. Job aborted!",!! G EOJ
  1. U 0 W !!,"Load complete!",!!
  1. EOJ ; CLOSE INPUT FILE AND QUIT
  1. C 47
  1. Q
  1. PROC ; PROCESS INPUT RECORDS
  1. D READ
  1. Q:QFLG
  1. S INC=INC+1
  1. S CODE=$E(X,9,11),DISC=$E(X,51,52),NAME=$E(X,25,50) D RMB
  1. I CODE'?3N!(DISC'?2N)!(NAME="") U 0 W !,"Bad data=",X,! S QFLG=1 Q
  1. D SETAFFL
  1. U 0 W !,AFFL," ",DISC," ",CODE," ",NAME
  1. S DIC("DR")=".02///"_""""_AFFL_""""_".03///"_""""_DISC_""""_".04///"_""""_CODE_"""",X=NAME D ^DIC
  1. I Y<0 S QFLG=1 U 0 W !!,X,"/",DR("DR") Q
  1. Q
  1. READ ; READ INPUT FILE
  1. U 47 R X S:$ZA\16384#2 QFLG=2
  1. Q
  1. RMB ; REMOVE LEADING AND TRAILING BLANKS AND BLANK AFTER COMMA
  1. F I=$L(NAME):-1:1 I $E(NAME,I)'=" " S NAME=$E(NAME,1,I) Q
  1. F L=0:0 Q:$E(NAME)'=" " S NAME=$E(NAME,2,99)
  1. S POS=$F(NAME,", ") Q:POS=0
  1. S NAME=$E(NAME,1,POS-2)_$E(NAME,POS,99)
  1. Q
  1. SETAFFL ; SET AFFILIATION
  1. S AFFL=1
  1. I DISC="00" I CODE="090"!(CODE]"095"&(CODE']"099")) S AFFL=9 Q
  1. Q:DISC']"09"
  1. I DISC="10",CODE="754" S AFFL=2 Q
  1. Q:DISC']"12"
  1. I DISC="13" I CODE]"379"&(CODE']"381") S AFFL=9 Q
  1. I DISC="13",CODE="390" S AFFL=2 Q
  1. I DISC="14" S AFFL=4 Q
  1. I DISC="15" S AFFL=9 Q
  1. Q:DISC']"18"
  1. I DISC="19" S AFFL=3 Q
  1. I DISC="20" S AFFL=9 Q
  1. Q:DISC']"50"
  1. I DISC="51" S AFFL=3 Q
  1. I DISC="52",CODE="210" S AFFL=2 Q
  1. I DISC="52",CODE="211" S AFFL=9 Q
  1. I DISC="53" S AFFL=3 Q
  1. I DISC="55" S AFFL=3 Q
  1. I DISC="57",CODE="178" S AFFL=9 Q
  1. Q
  1. OERR ; OPEN ERROR
  1. U 0 W BEEP
  1. W !!,"Open error on input file!",!!
  1. Q