Google
 

Trailing-Edge - PDP-10 Archives - decus_20tap5_198111 - decus/20-0137/bank/bnk7.ban
There are 3 other files named bnk7.ban in the archive. Click here to see a list.
C                                    *** BANK ***
C
C     SUBROUTINE TO TRANSFORM DATA OR CREATE NEW VARIABLES.  THIS ROUTINE
C     DOES THE WORK, THE TRANSLATION OF WHAT THE USER WISHES HAS 
C     ALREADY BEEN PERFORMED IN BNK2.BAN
C
      SUBROUTINE TRANS
      DIMENSION ID(126,72),D(126,72),LV(125),NNS(18,6),NUMV(50)
      EQUIVALENCE(ID,D),(MISS,AMISS),(LV,NNS)
      COMMON /GEN/ IPROJA,IPROGA,NV,NO,BNKNM,DATCR,NPROJR,NPORGR
      COMMON /DEV/IDLG,ICC,IBNK,IUPGR,ITMPRY
      COMMON /OBS/ LICOB,NHO,IO(2,20)
      COMMON /SEL/ NS,ISEL(5,20),IDATA(20,20)
      COMMON/TRNS/INST(25),IVAR1(25),IVAR2(25),CONST(25),SV(99),ITO(25)
      COMMON /ERROR/ LDBZ,LSQRN,LNL0,LL10,LASN,LIFX,LFLOAT,LALPHA
      COMMON /SET/ NHVSET,IVSET(2,30),   NHOSET,IOSET(2,30)
      DOUBLE PRECISION BNKNM,TMPBK,DATCR
      DATA TMPBK /'TMP.DAT'/
      DATA MISS/"400000000000/
      CALL TIME(J,K)
      CALL SETRAN(K)
      NHV=0
      K=2
      LDBZ=0
      LSQRN=0
      LNL0=0
      LL10=0
      LASN=0
      LIFX=0
      LFLOAT=0
      LALPHA=0
      NOBASE=(NO+124)/125
101   IF(INST(K).EQ.9) GO TO 108
      IF(INST(K).EQ.99) GO TO 107
      IF(IVAR1(K).LE.0) GO TO 104
      IF(NHV.LT.1) GO TO 103
      DO 102 J=1,NHV
      IF(NUMV(J).NE.IVAR1(K)) GO TO 102
      IVAR1(K)=J
      GO TO 104
102   CONTINUE
103   NHV=NHV+1
      NUMV(NHV)=IVAR1(K)
      IVAR1(K)=NHV
104   IF(IVAR2(K).LE.0) GO TO 107
      IF(NHV.LT.1) GO TO 106
      DO 105 J=1,NHV
      IF(NUMV(J).NE.IVAR2(K)) GO TO 105
      IVAR2(K)=J
      GO TO 107
105   CONTINUE
106   NHV=NHV+1
      NUMV(NHV)=IVAR2(K)
      IVAR2(K)=NHV
107   K=K+1
      GO TO 101
108   NINST=K-1
      IF(ITO(K).LE.0) GO TO 109
      NHV=NHV+1
      NUMV(NHV)=ITO(K)
      ITO(K)=NHV
109   IBASE=((NO+124)/125)*NV+1
      IRECO=0
      IF(NHV.LT.1) GO TO 112
      DO 110 J=1,NHV
      K=NUMV(J)
      IF(K.EQ.999999999) GO TO 113
      IREC=(K-1)/6
      IONE=K-IREC*6
      IREC=IREC+IBASE+1
      IF(IREC.EQ.IRECO) GO TO 111
      READ(IBNK#IREC) LV
      IRECO=IREC
111   D(126,J)=NNS(10,IONE)
      GO TO 110
113   D(126,J)=2
110   CONTINUE
112   K=ITO(1)
      IF(K.GT.NV) GO TO 114
      IREC=(K-1)/6
      IONE=K-IREC*6
      IREC=IREC+IBASE+1
      READ(IBNK#IREC) LV
      D(126,71)=NNS(10,IONE)
      NAMES=NNS(1,IONE)
C
C     CHECK TO SEE THAT ALL ALPHAS ARE LEGAL
114   IF(NHV.LT.1) GO TO 121
      DO 116 J=1,NHV
      IF(D(126,J).NE.1) GO TO 116
      IF(NINST.LT.2) GO TO 121
      DO 117 K=2,NINST
      IF(IVAR2(K).NE.J) GO TO 120
119   WRITE(IDLG,118)
118   FORMAT(' ILLEGAL TO USE ALPH VARIABLES FOR CALCULATIONS')
      GO TO 999
120   IF(IVAR1(K).NE.J) GO TO 117
      IF((INST(K).NE.21).AND.(INST(K).NE.22)) GO TO 119
117   CONTINUE
116   CONTINUE
121   IF(ITO(1).GT.NV) GO TO  300
C
C     TRANSFORM EXISTING VARIABLE
C
      MODEFR=D(126,71)
131   MODETO=0
      IF(ITO(NINST+1).GT.0)MODETO=D(126,ITO(NINST+1))
      IF(NINST.LT.2) GO TO 130
      IF(INST(NINST).EQ.21) MODETO=2
      IF(INST(NINST).EQ.23) MODETO=1
130   ISW=0
      IF((MODEFR.EQ.1).AND.(MODETO.NE.1)) ISW=3
      IF((MODEFR.NE.1).AND.(MODETO.EQ.1)) ISW=3
      IF((MODEFR.EQ.0).AND.(MODETO.EQ.2)) ISW=2
      IF((MODEFR.EQ.2).AND.(MODETO.EQ.0)) ISW=1
      NBL=(NO-1)/125+1
C
C
      DO 150 I=1,NOBASE
C
C     RECOVER DATA TO BE USED (IF ANY)
C
      IF(NHV.LT.1) GO TO 170
      DO 161 J=1,NHV
      IF(NUMV(J).EQ.999999999) GO TO 162
      IREC=(NUMV(J)-1)*NOBASE+1+I
      READ(IBNK#IREC) (ID(K,J),K=1,125)
      GO TO 161
162   KVCH=(I-1)*125
      KEND=125
      IF((KVCH+125).GT.NO) KEND=NO-KVCH
      DO 163 K=1,KEND
163   ID(K,J)=KVCH+K
      IF(KEND.EQ.125) GO TO 161
      DO 164 K=KEND+1,125
164   ID(K,J)=MISS
161   CONTINUE
C
C
C 
170   IF(NS.LT.1) GO TO 180
      DO 171 J=1,NS
      IREC=(ISEL(2,J)-1)*NOBASE+1+I
      READ(IBNK#IREC) (ID(K,J+50),K=1,125)
171   CONTINUE
C
C
C
180   IREC=(ITO(1)-1)*NOBASE+1+I
      READ(IBNK#IREC)(ID(K,71),K=1,125)
      IF(ISW.EQ.0) GO TO 190
      IF(ISW.NE.1) GO TO 184
      DO 183K=1,125
      IF(D(K,71).NE.AMISS) D(K,71)=ID(K,71)
183   CONTINUE
      GO TO 190
184   IF(ISW.NE.2) GO TO 196
      DO 185 K=1,125
      IF(D(K,71).NE.AMISS)ID(K,71)=D(K,71)
185   CONTINUE
      GO TO 190
196   DO 186 K=1,125
186   D(K,71)=AMISS
C
C
C
190   DO 191 K=1,125
191   D(K,72)=0
      KMAX=I*125
      KMIN=KMAX-124
      DO 192 L=1,NHO
      ILOW=0
      IUP=0
      IF(IO(1,L).GT.KMAX) GO TO 195
      IF(IO(2,L).LT.KMIN) GO TO 192
      IF(IO(1,L).LE.KMIN) ILOW=1
      IF(IO(2,L).GE.KMAX) IUP=125
      IF(ILOW.EQ.0) ILOW=IO(1,L)-KMIN+1
      IF(IUP.EQ.0) IUP=125-(KMAX-IO(2,L))
      DO 193 K=ILOW,IUP
193   ID(K,72)=1
192   CONTINUE
195   DO 200 K=1,125
      IF(ID(K,72).EQ.0) GO TO 200
      IF(NS.LE.0) GO TO 219
C
C     SELECTION PORTION
C
      J=1
207   IF(ISEL(3,J).NE.1) GO TO 203
      DO 204 M=1,ISEL(5,J)
      IF(IDATA(J,M).EQ.MISS) GO TO 202
204   CONTINUE
203   IF(ID(K,J+50).EQ.MISS) GO TO 206
202   GO TO (211,212,213,214,215,216) ISEL(3,J)
211   DO 205 M=1,ISEL(5,J)
      IF(ID(K,J+50).EQ.IDATA(J,M)) GO TO 201
205   CONTINUE
      GO TO 206
212   IF(ID(K,J+50).LT.IDATA(J,1)) GO TO 201
      GO TO 206
213   IF(ID(K,J+50).LE.IDATA(J,1)) GO TO 201
      GO TO 206
214   IF(ID(K,J+50).GT.IDATA(J,1)) GO TO 201
      GO TO 206
215   IF(ID(K,J+50).GE.IDATA(J,1)) GO TO 201
      GO TO 206
216   IF(ID(K,J+50).NE.IDATA(J,1)) GO TO 201
      GO TO 206
206   J=J+1
      IF(J.GT.NS) GO TO 200
      IF(ISEL(1,J).EQ.ISEL(1,J-1)) GO TO 207
      GO TO 200
201   J=J+1
      IF(J.GT.NS) GO TO 219
      IF(ISEL(1,J).EQ.ISEL(1,J-1)) GO TO 201
      GO TO 207
219   DO 220 J=1,NHV
      IF(ID(K,J).EQ.MISS) GO TO 230
220   CONTINUE
      KK=K
      CALL CALCU(D,KK,MODETO)
      GO TO 200
230   D(K,71)=AMISS
200   CONTINUE
      IREC=(ITO(1)-1)*NOBASE+1+I
      WRITE(IBNK#IREC)(ID(K,71),K=1,125)
150   CONTINUE
      IF(LDBZ.GT.0) WRITE(IDLG,252) LDBZ
252   FORMAT(I4,' OCCURANCES OF DIVISION BY ZERO - MISSING DATA')
      IF(LSQRN.GT.0) WRITE(IDLG,253) LSQRN
253   FORMAT(I4,' OCCURANCES OF SQRT OF A NEGATIVE - MISSING DATA')
      IF(LNL0.GT.0) WRITE(IDLG,254) LNL0
254   FORMAT(I4,' OCCURANCES OF LN OF NON-POSITIVES - MISSING DATA')
      IF(LL10.GT.0) WRITE(IDLG,255) LL10
255   FORMAT(I4,' OCCURANCES OF LOG10 OF NON-POSITIVES - MISSING DATA')
      IF(LASN.GT.0) WRITE(IDLG,256) LASN
256   FORMAT(I4,' OCCURANCES OF ILLEGAL ARCSIN - MISSING DATA')
      IF(LIFX.GT.0) WRITE(IDLG,257)LIFX
257   FORMAT(I4,' PROBLEMS GOING FROM ALPHA TO FIXED - MISSING DATA')
      IF(LFLOAT.GT.0) WRITE(IDLG,258) LFLOAT
258   FORMAT(I4,' PROBLEMS GOING FROM ALPHA TO FLOAT - MISSING DATA')
      IF(LALPHA.GT.0) WRITE(IDLG,259) LALPHA
259   FORMAT(I4,' PROBLEMS GOING FROM NUMERIC TO ALPHA - MISSING DATA')
      IF(MODETO.NE.MODEFR) GO TO 260
      WRITE(IDLG,250) NAMES
250   FORMAT(' VARIABLE: ',A5,' TRANSFORMED')
      RETURN
260   MODT='FLOAT'
      IF(MODETO.EQ.1) MODT='ALPHA'
      IF(MODETO.EQ.2) MODT='FIXED'
      IF(MODEFR.EQ.99) GO TO 262
      MODF='FLOAT'
      IF(MODEFR.EQ.1) MODF='ALPHA'
      IF(MODEFR.EQ.2) MODF='FIXED'
      WRITE(IDLG,251) NAMES,MODF,MODT
251   FORMAT(' VARIABLE: ',A5,' TRANSFORMED, MODE CHANGED FROM '
     1,A5,' TO ',A5)
261   K=ITO(1)
      IREC=(K-1)/6
      IONE=K-IREC*6
      IREC=IREC+IBASE+1
      READ(IBNK#IREC) LV
      NNS(10,IONE)=MODETO
      WRITE(IBNK#IREC) LV
999   RETURN
262   WRITE(IDLG,263) INST(1),MODT
263   FORMAT(' VARIABLE: ',A5,' CREATED HAVING A ',A5,' MODE')
      GO TO 261
C
C
C
C
C     NEW VARIABLE BEING CALCULATED
C
300   MODEFR=99
      IBASE=NOBASE*NV+1
      NMBR=(NV+5)/6
C     NOW MOVE HEADER RECORDS UP
      DO 302 I=NMBR,1,-1
      READ(IBNK#(I+IBASE)) LV
302   WRITE(IBNK#(I+IBASE+NOBASE))LV
C     NOW FILL NEW VARIABLE WITH MISSING DATA
      DO 303 I=1,125
303   LV(I)=MISS
      DO 304 I=1,NOBASE
304   WRITE(IBNK#(IBASE+I)) LV
      IBASE=IBASE+NOBASE
C     NOW ENTER NAME AND DESCRIPTION BLOCK
      MMBR=(NV+6)/6
      IONE=(NV+1)-(MMBR-1)*6
      IF(MMBR.NE.NMBR) GO TO 305
      READ(IBNK#(IBASE+NMBR)) LV
      GO TO 307
305   DO 306 I=1,6
306   NNS(1,I)=' '
307   NNS(1,IONE)=INST(1)
      NNS(2,IONE)='CREAT'
      NNS(3,IONE)='ED BY'
      NNS(4,IONE)=' A TR'
      NNS(5,IONE)='ANSFO'
      NNS(6,IONE)='RMATI'
      NNS(7,IONE)='ON - '
      CALL DATE(NNS(8,IONE))
      NNS(10,IONE)=0
      WRITE(IBNK#(IBASE+MMBR)) LV
      IF(NHVSET.NE.1) GO TO 308
      IF((IVSET(1,1).EQ.1).AND.(IVSET(2,1).EQ.NV)) IVSET(2,1)=
     1IVSET(2,1)+1
308   NV=NV+1
      READ(IBNK#1)LV
      LV(1)=NV
      WRITE(IBNK#1) LV
      GO TO 131
      END
      SUBROUTINE CALCU(D,K,MODETO)
      DIMENSION D(126,72),SEP(5)
      COMMON /TRNS/INST(25),IVAR1(25),IVAR2(25),CONST(25),SV(99),ITO(25)
      COMMON /ERROR/ LDBZ,LSQRN,LNL0,LL10,LASN,LIFX,LFLOAT,LALPHA
      EQUIVALENCE (WORD1,IWORD1),(WORD2,IWORD2),(AMISS,MISS)
      DATA MISS /"400000000000/
      N=1
      ISMD=0
1     N=N+1
      INSOP=INST(N)
      INPUT=ITO(N)
      IF(INSOP.EQ.99) GO TO 1
      GO TO (2,2,30,2,50,60,70,80,90,100,110,120,130,140,150,2,
     12,180,190,200,210,220,230,240,250) ,INSOP
2     WRITE(IDLG,3)
3     FORMAT(' SYS PROB - CONTACT DICK HOUCHARD')
      CALL EXIT
C
C     POWER
C
30    IF(IVAR1(N))31,32,33
31    WORD1=SV(-IVAR1(N))
      GO TO 34
32    WORD1=CONST(N)
      GO TO 34
33    WORD1=D(K,IVAR1(N))
      IF(D(126,IVAR1(N)).EQ.2) WORD1=IWORD1
34    IF(IVAR2(N)) 35,36,37
35    WORD2=SV(-IVAR2(N))
      GOTO 38
36    WORD2=CONST(N)
      GO TO 38
37    WORD2=D(K,IVAR2(N))
      IF(D(126,IVAR2(N)).EQ.2) WORD2=IWORD2
38    SV(INPUT)=WORD1**WORD2
      GO TO 1
C
C     ADD
C
50    IF(IVAR1(N))51,52,53
51    WORD1=SV(-IVAR1(N))
      GO TO 54
52    WORD1=CONST(N)
      GO TO 54
53    WORD1=D(K,IVAR1(N))
      IF(D(126,IVAR1(N)).EQ.2) WORD1=IWORD1
54    IF(IVAR2(N))55,56,57
55    WORD2=SV(-IVAR2(N))
      GO TO 58
56    WORD2=CONST(N)
      GO TO 58
57    WORD2=D(K,IVAR2(N))
      IF(D(126,IVAR2(N)).EQ.2) WORD2=IWORD2
58    SV(INPUT)=WORD1+WORD2
      GO TO 1
C
C     SUBTRACT
C
60    IF(IVAR1(N)) 61,62,63
61    WORD1=SV(-IVAR1(N))
      GO TO 64
62    WORD1=CONST(N)
      GO TO 64
63    WORD1=D(K,IVAR1(N))
      IF(D(126,IVAR1(N)).EQ.2)WORD1=IWORD1
64    IF(IVAR2(N)) 65,66,67
65    WORD2=SV(-IVAR2(N))
      GOTO 68
66    WORD2=CONST(N)
      GOTO 68
67    WORD2=D(K,IVAR2(N))
      IF(D(126,IVAR2(N)).EQ.2) WORD2=IWORD2
68    SV(INPUT)=WORD1-WORD2
      GO TO 1
C
C     DIVIDE
C
70    IF(IVAR1(N)) 71,72,73
71    WORD1=SV(-IVAR1(N))
      GO TO 74
72    WORD1=CONST(N)
      GO TO 74
73    WORD1=D(K,IVAR1(N))
      IF(D(126,IVAR1(N)).EQ.2) WORD1=IWORD1
74    IF(IVAR2(N)) 75,76,77
75    WORD2=SV(-IVAR2(N))
      GO TO 78
76    WORD2=CONST(N)
      GO TO 78
77    WORD2=D(K,IVAR2(N))
      IF(D(126,IVAR2(N)).EQ.2) WORD2=IWORD2
78    IF(WORD2.NE.0) GO TO 79
      D(K,71)=AMISS
      LDBZ=LDBZ+1
      RETURN
79    SV(INPUT)=WORD1/WORD2
      GO TO 1
C
C     MULTIPLY
C
80    IF(IVAR1(N)) 81,82,83
81    WORD1=SV(-IVAR1(N))
      GO TO 84
82    WORD1=CONST(N)
      GO TO 84
83    WORD1=D(K,IVAR1(N))
      IF(D(126,IVAR1(N)).EQ.2) WORD1=IWORD1
84    IF(IVAR2(N)) 85,86,87
85    WORD2=SV(-IVAR2(N))
      GO TO 88
86    WORD2=CONST(N)
      GO TO 88
87    WORD2=D(K,IVAR2(N))
      IF(D(126,IVAR2(N)).EQ.2) WORD2=IWORD2
88    SV(INPUT)=WORD1*WORD2
      GO TO 1
C
C     END OF RUN
C
90    IF(ITO(N)) 91,92,93
91    WORD1=SV(-ITO(N))
      GO TO 94
92    WORD1=CONST(N)
      GO TO 94
93    D(K,71)=D(K,ITO(N))
      RETURN
94    IF(MODETO.EQ.2) IWORD1=WORD1
      D(K,71)=WORD1
      RETURN
C
C     SQRT
C
100   IF(IVAR1(N)) 101,102,103
101   WORD1=SV(-IVAR1(N))
      GO TO 104
102   WORD1=CONST(N)
      GO TO 104
103   WORD1=D(K,IVAR1(N))
      IF(D(126,IVAR1(N)).EQ.2) WORD1=IWORD1
104   IF(WORD1.LT.0) GO TO 105
      SV(INPUT)=SQRT(WORD1)
      GO TO 1
105   LSQRN=LSQRN+1
      D(K,71)=AMISS
      RETURN
C
C     NATURAL LOG
C
110   IF(IVAR1(N)) 111,112,113
111   WORD1=SV(-IVAR1(N))
      GO TO 114
112   WORD1=CONST(N)
      GO TO 114
113   WORD1=D(K,IVAR1(N))
      IF(D(126,IVAR1(N)).EQ.2) WORD1=IWORD1
114   IF(WORD1.LE.0) GO TO 115
      SV(INPUT)=ALOG(WORD1)
      GO TO 1
115   LNL0=LNL0+1
      D(K,71)=AMISS
      RETURN
C
C     EXP
C
120   IF(IVAR1(N)) 121,122,123
121   WORD1=SV(-IVAR1(N))
      GO TO 124
122   WORD1=CONST(N)
      GO TO 124
123   WORD1=D(K,IVAR1(N))
      IF(D(126,IVAR1(N)).EQ.2) WORD=IWORD
124   SV(INPUT)=EXP(WORD1)
      GO TO 1
C
C     LOG10
C
130   IF(IVAR1(N)) 131,132,133
131   WORD1=SV(-IVAR1(N))
      GO TO 134
132   WORD1=CONST(N)
      GO TO 134
133   WORD1=D(K,IVAR1(N))
      IF(D(126,IVAR1(N)).EQ.2) WORD=IWORD
134   IF(WORD1.LE.0) GO TO 135
      SV(INPUT)=ALOG10(WORD1)
      GOTO 1
135   D(K,71)=AMISS
      LL10=LL10+1
      RETURN
C
C     SIN
C
140   IF(IVAR1(N)) 141,142,143
141   WORD1=SV(-IVAR1(N))
      GO TO 144
142   WORD1=CONST(N)
      GOTO 144
143   WORD1=D(K,IVAR1(N))
      IF(D(126,IVAR1(N)).EQ.2) WORD1=IWORD1
144   SV(INPUT)=SIN(WORD1)
      GO TO 1
C
C     COS
C
150   IF(IVAR1(N)) 151,152,153
151   WORD1=SV(-IVAR1(N))
      GO TO 154
152   WORD1=CONST(N)
      GO TO 154
153   WORD1=D(K,IVAR1(N))
      IF(D(126,IVAR1(N)).EQ.2) WORD1=IWORD1
154   SV(INPUT)=COS(WORD1)
      GO TO 1
C
C     ARC TAN
C 
180   IF(IVAR1(N)) 181,182,183
181   WORD1=SV(-IVAR1(N))
      GO TO 184
182   WORD1=CONST(N)
      GO TO 184
183   WORD1=D(K,IVAR1(N))
      IF(D(126,IVAR1(N)).EQ.2) WORD1=IWORD1
184   SV(INPUT)=ATAN(WORD1)
      GO TO 1
C
C     ARC SIN
C
190   IF(IVAR1(N)) 191,192,193
191   WORD1=SV(-IVAR1(N))
      GO TO 194
192   WORD1=CONST(N)
      GO TO 194
193   WORD1=D(K,IVAR1(N))
      IF(D(126,IVAR1(N)).EQ.2) WORD1=IWORD1
194   IF((WORD1.LT.-1).OR.(WORD1.GT.1)) GO TO 195
      SV(INPUT)=ASIN(WORD1)
      GO TO 1
195   D(K,71)=AMISS
      LASN=LASN+1
      RETURN
C
C     ABSOLUTE
C
200   IF(IVAR1(N)) 201,202,203
201   WORD1=SV(-IVAR1(N))
      GO TO 204
202   WORD1=CONST(N)
      GO TO 204
203   WORD1=D(K,IVAR1(N))
      IF(D(126,IVAR1(N)).EQ.2) WORD1=IWORD1
204   SV(INPUT)=WORD1
      IF(WORD1.LT.0) SV(INPUT)=-WORD1
      GO TO 1
C
C     IFIX
C
210   IF(IVAR1(N)) 211,212,213
211   WORD1=SV(-IVAR1(N))
      GO TO 219
212   WORD1=CONST(N)
      GO TO 219
213   WORD1=D(K,IVAR1(N))
      IF(D(126,IVAR1(N)).EQ.0) GO TO 219
      IF(D(126,IVAR1(N)).EQ.1) GO TO 214
      WORD1=IWORD1
      GO TO 219
214   DECODE(5,252,WORD1) SEP
      ISET=0
      WORD1=0
      DO 215 J=1,5
      IF(SEP(J).EQ.'-') GO TO 215
      IF(SEP(J).EQ.' ') GO TO 215
      IF(SEP(J).EQ.'.') GO TO 215
      ISET=1
      IF((SEP(J).GE.'0').AND.(SEP(J).LE.'9')) GO TO 215
      D(K,71)=AMISS
      LIFX=LIFX+1
      RETURN
215   CONTINUE
      IF(ISET.EQ.0) GO TO 219
217   IF(SEP(5).NE.' ') GO TO 218
      DO 216 J=5,2,-1
216   SEP(J)=SEP(J-1)
      SEP(1)=' '
      GO TO 217
218   ENCODE(5,252,WORD2) SEP
      DECODE(5,253,WORD2) WORD1
219   IWORD1=WORD1
      SV(INPUT)=IWORD1
      GO TO 1
C
C
C     FLOAT
C
220   IF(IVAR1(N)) 221,222,223
221   WORD1=SV(-IVAR1(N))
      GO TO 229
222   WORD1=CONST(N)
      GO TO 229
223   WORD1=D(K,IVAR1(N))
      IF(D(126,IVAR1(N)).EQ.0) GO TO 229
      IF(D(126,IVAR1(N)).EQ.1) GO TO 224
      WORD1=IWORD1
      GO TO 229
224   DECODE(5,252,WORD1) SEP
      ISET=0
      WORD1=0
      DO 225 J=1,5
      IF(SEP(J).EQ.'-') GO TO 225
      IF(SEP(J).EQ.' ') GO TO 225
      IF(SEP(J).EQ.'.') GO TO 225
      ISET=1
      IF((SEP(J).GE.'0').AND.(SEP(J).LE.'9')) GO TO 225
      D(K,71)=AMISS
      LFLOAT=LFLOAT+1
      RETURN
225   CONTINUE
      IF(ISET.EQ.0) GO TO 229
227   IF(SEP(5).NE.' ') GO TO 228
      DO 226 J=5,2,-1
226   SEP(J)=SEP(J-1)
      SEP(1)=' '
      GO TO 227
228    ENCODE(5,252,WORD2) SEP
      DECODE(5,253,WORD2) WORD1
229   SV(INPUT)=WORD1
      GO TO 1
C
C     ALPHANUMERIC
C
230   IF(IVAR1(N)) 231,232,233
231   WORD1=SV(-IVAR1(N))
      GO TO 235
232   WORD1=CONST(N)
      GO TO 235
233   WORD1=D(K,IVAR1(N))
      IF(D(126,IVAR1(N)).EQ.1) GO TO 243
      IF(D(126,IVAR1(N)).EQ.0) GO TO 235
236   IF((IWORD1.LT.99999).AND.(IWORD1.GT.-9999)) GO TO 234
      LALPHA=LALPHA+1
      D(K,71)=AMISS
      RETURN
234   WORD2=0
      ENCODE(5,254,WORD2) IWORD1
      GO TO 238
235   IF((WORD1.LT.9999.).AND.(WORD1.GT.-999.)) GO TO 237
      IWORD1=WORD1
      GO TO 236
243   WORD2=WORD1
      GO TO 238
237   WORD2=0
      ENCODE(5,253,WORD2) WORD1
238   DECODE(5,252,WORD2) SEP
239   IF(SEP(1).NE.' ') GO TO 242
      DO 241 J=2,5
241   SEP(J-1)=SEP(J)
      SEP(5)=' '
      GO TO 239
242   ENCODE(5,252,WORD2) SEP
      SV(INPUT)=WORD2
      GO TO 1
C
C     RANDOM NUMBER
240   SV(INPUT)=RAN(X)
      GO TO 1
C
C     NORMALIZED RANDOM NUMBERS
C
250   WORD1=0
      DO 251 J=1,12
251   WORD1=WORD1+RAN(X)
      SV(INPUT)=WORD1-6.
      GO TO 1
252   FORMAT(5A1)
253   FORMAT(F5.0)
254   FORMAT(I5)
      END