      INTEGER RD1(884),RD2(884),RD3(884),RD4(884)
      INTEGER ERRS,AP,LASTAP,I1,I2,I,J,POS2
      INTEGER FX1(40),FX2(40)
      INTEGER ROW3(500),ROW4(500),BUF(500)
      INTEGER RPN(200),CBUF(500)
      INTEGER GETARG,LOADRD,GETROW,ISATTY,EVAL,PARSE,ADDFI0
      INTEGER GETNA0,FINDF0,FINDQ0
      INTEGER ARG(128),OLDNA0(128),NEWNA0(17)
      INTEGER * 4 M
      INTEGER * 4 MARKF
      INTEGER AAAAA0(19)
      INTEGER AAAAB0(23)
      INTEGER AAAAC0(30)
      INTEGER AAAAD0(28)
      INTEGER AAAAE0(30)
      DATA AAAAA0/170,243,186,160,233,238,246,225,236,233,228,160,238,22
     *5,237,229,170,238,0/
      DATA AAAAB0/170,243,186,160,228,239,237,225,233,238,160,238,239,24
     *4,160,230,239,245,238,228,170,238,0/
      DATA AAAAC0/170,243,186,160,228,245,240,236,233,227,225,244,229,16
     *0,239,245,244,240,245,244,160,228,239,237,225,233,238,170,238,0/
      DATA AAAAD0/170,243,186,160,227,225,238,238,239,244,160,225,228,22
     *8,160,238,229,247,160,228,239,237,225,233,238,170,238,0/
      DATA AAAAE0/170,243,186,160,228,245,240,236,233,227,225,244,229,16
     *0,239,245,244,240,245,244,160,228,239,237,225,233,238,170,238,0/
      IF((LOADRD(RD1,-10).EQ.-2))GOTO 10000
        CALL ERROR('Cannot load input relation 1.')
10000 IF((LOADRD(RD2,-12).EQ.-2))GOTO 10001
        CALL ERROR('Cannot load input relation 2.')
10001 CALL MOVE$(RD1,RD3,RD1(1))
      I=3+1
      POS2=ADDFI0(RD3,RD2(I),RD2(I+1),RD2(I+5))
      IF((POS2.NE.0))GOTO 10002
        CALL ERROR('Resulting relation has too many domains.')
10002 I=I+22
      GOTO 10005
10003 I=I+22
10005 IF((I.GT.RD2(2)))GOTO 10004
        IF((ADDFI0(RD3,RD2(I),RD2(I+1),RD2(I+5)).NE.0))GOTO 10006
          CALL ERROR('Resulting relation has too many domains.')
10006 GOTO 10003
10004 IF((GETARG(1,ARG,128).NE.-1))GOTO 10007
        CALL ERROR('Usage: rdjoin <selection expr> { <domain> }.')
10007 IF((PARSE(RD3,POS2,ARG,RPN,CBUF).EQ.-2))GOTO 10008
        CALL SWT
10008 ERRS=0
      RD4(1)=3
      RD4(2)=3-22+1
      RD4(3)=0
      AP=1
      GOTO 10011
10009 AP=AP+(1)
10011 IF((GETARG(AP+1,ARG,128).EQ.-1))GOTO 10010
        IF((AP.LE.40))GOTO 10012
          CALL ERROR('Too many fields in new relation.')
10012   IF((GETNA0(ARG,OLDNA0,NEWNA0).EQ.-2))GOTO 10013
          CALL PRINT(-15,AAAAA0,ARG)
          ERRS=ERRS+(1)
          GOTO 10009
10013   I1=FINDQ0(RD3,OLDNA0,POS2)
        IF((I1.NE.0))GOTO 10014
          CALL PRINT(-15,AAAAB0,OLDNA0)
          ERRS=ERRS+(1)
          GOTO 10009
10014   IF((FINDF0(RD4,NEWNA0).EQ.0))GOTO 10015
          CALL PRINT(-15,AAAAC0,NEWNA0)
          ERRS=ERRS+(1)
          GOTO 10009
10015   I2=ADDFI0(RD4,RD3(I1),RD3(I1+1),NEWNA0)
        IF((I2.NE.0))GOTO 10016
          CALL PRINT(-15,AAAAD0,NEWNA0)
          ERRS=ERRS+(1)
          GOTO 10009
10016   FX1(AP)=I1
        FX2(AP)=I2
      GOTO 10009
10010 IF((AP.LE.1))GOTO 10017
        LASTAP=AP-1
        GOTO 10018
10017   J=1
        I=3+1
        GOTO 10021
10019   J=J+(1)
        I=I+22
10021   IF((I.GT.RD3(2)))GOTO 10020
          IF((FINDF0(RD4,RD3(I+5)).EQ.0))GOTO 10022
            CALL PRINT(-15,AAAAE0,RD3(I+5))
            ERRS=ERRS+(1)
10022     IF((ADDFI0(RD4,RD3(I),RD3(I+1),RD3(I+5)).NE.0))GOTO 10023
            CALL ERROR('can''t add new domain!!.')
10023     FX1(J)=I
          FX2(J)=I
        GOTO 10019
10020   LASTAP=J-1
10018 IF((ERRS.LE.0))GOTO 10024
        CALL SWT
10024 CALL SAVERD(RD4,-11)
      IF((ISATTY(-11).NE.1))GOTO 10025
        CALL PRINT0(RD4,-11)
10025 M=MARKF(-10)
10026 IF((GETROW(RD2,-12,ROW3(RD1(3)+1)).EQ.-1))GOTO 10027
        CALL SEEKF(M,-10)
10028   IF((GETROW(RD1,-10,ROW3).EQ.-1))GOTO 10029
          IF((EVAL(RD3,ROW3,RPN,CBUF).NE.1))GOTO 10030
            AP=1
            GOTO 10033
10031       AP=AP+(1)
10033       IF((AP.GT.LASTAP))GOTO 10032
              CALL GETDA0(RD3,FX1(AP),ROW3,BUF)
              CALL PUTDA0(RD4,FX2(AP),ROW4,BUF)
            GOTO 10031
10032       CALL PUTROW(RD4,-11,ROW4)
10030   GOTO 10028
10029 GOTO 10026
10027 IF((ISATTY(-11).NE.1))GOTO 10034
        CALL PRINU0(RD4,-11)
10034 CALL SWT
      END
      INTEGER FUNCTION GETNA0(ARG,OLDNA0,NEWNA0)
      INTEGER ARG(1),OLDNA0(128),NEWNA0(17)
      INTEGER I,J
      NEWNA0(1)=0
      OLDNA0(1)=0
      IF((193.GT.ARG(1)))GOTO 10036
      IF((ARG(1).GT.218))GOTO 10036
      GOTO 10035
10036 IF((225.GT.ARG(1)))GOTO 10037
      IF((ARG(1).GT.250))GOTO 10037
      GOTO 10035
10037   GETNA0=-3
        RETURN
10035 OLDNA0(1)=ARG(1)
      I=2
      GOTO 10040
10038 I=I+(1)
10040 IF((ARG(I).EQ.0))GOTO 10039
      IF((ARG(I).EQ.189))GOTO 10039
      IF((I.GE.128))GOTO 10039
        IF((193.GT.ARG(I)))GOTO 10042
        IF((ARG(I).GT.218))GOTO 10042
        GOTO 10041
10042   IF((225.GT.ARG(I)))GOTO 10043
        IF((ARG(I).GT.250))GOTO 10043
        GOTO 10041
10043   IF((176.GT.ARG(I)))GOTO 10044
        IF((ARG(I).GT.185))GOTO 10044
        GOTO 10041
10044   IF((ARG(I).EQ.223))GOTO 10041
        IF((ARG(I).EQ.174))GOTO 10041
          OLDNA0(1)=0
          GETNA0=-3
          RETURN
10041   OLDNA0(I)=ARG(I)
      GOTO 10038
10039 OLDNA0(I)=0
      IF((ARG(I).NE.0))GOTO 10045
        I=1
        GOTO 10048
10046   I=I+(1)
10048   IF((ARG(I).EQ.174))GOTO 10047
        IF((ARG(I).EQ.0))GOTO 10047
        IF((I.GE.17))GOTO 10047
          NEWNA0(I)=ARG(I)
        GOTO 10046
10047   NEWNA0(I)=0
        GOTO 10049
10045   IF((ARG(I).NE.189))GOTO 10050
          I=I+(1)
          IF((193.GT.ARG(I)))GOTO 10052
          IF((ARG(I).GT.218))GOTO 10052
          GOTO 10051
10052     IF((225.GT.ARG(I)))GOTO 10053
          IF((ARG(I).GT.250))GOTO 10053
          GOTO 10051
10053       GETNA0=-3
            RETURN
10051     NEWNA0(1)=ARG(I)
          J=2
          I=I+(1)
          GOTO 10056
10054     J=J+(1)
          I=I+(1)
10056     IF((ARG(I).EQ.0))GOTO 10055
          IF((J.GE.17))GOTO 10055
            IF((193.GT.ARG(I)))GOTO 10058
            IF((ARG(I).GT.218))GOTO 10058
            GOTO 10057
10058       IF((225.GT.ARG(I)))GOTO 10059
            IF((ARG(I).GT.250))GOTO 10059
            GOTO 10057
10059       IF((176.GT.ARG(I)))GOTO 10060
            IF((ARG(I).GT.185))GOTO 10060
            GOTO 10057
10060       IF((ARG(I).EQ.223))GOTO 10057
              NEWNA0(1)=0
              GETNA0=-3
              RETURN
10057       NEWNA0(J)=ARG(I)
          GOTO 10054
10055     NEWNA0(J)=0
          IF((ARG(I).EQ.0))GOTO 10061
            GETNA0=-3
            RETURN
10061     GOTO 10062
10050     GETNA0=-3
          RETURN
10062 CONTINUE
10049 GETNA0=-2
      RETURN
      END
      INTEGER FUNCTION PARSE(RD,POS2,ARG,RPN,CBUF)
      INTEGER RD(884)
      INTEGER POS2
      INTEGER ARG(1)
      INTEGER RPN(200),CBUF(500)
      INTEGER RDAAA0(884)
      INTEGER ARGAA0(128)
      INTEGER APAAA0,POS2A0
      INTEGER RPNAA0(200),RPNLE0
      INTEGER SYMTY0,SYMTE0(128)
      INTEGER CBUFA0(500),CBUFL0
      REAL * 8 ERRLA0
      COMMON /RSLCOM/RDAAA0,ARGAA0,APAAA0,RPNAA0,RPNLE0,SYMTY0,SYMTE0,CB
     *UFA0,CBUFL0,ERRLA0,POS2A0
      INTEGER AAAAF0(19)
      DATA AAAAF0/201,238,246,225,236,233,228,160,229,248,240,242,229,24
     *3,243,233,239,238,0/
      CALL MKLB$F($1,ERRLA0)
      CALL MOVE$(RD,RDAAA0,RD(1))
      POS2A0=POS2
      CALL CTOC(ARG,ARGAA0,128)
      APAAA0=1
      RPNLE0=1
      CBUFL0=1
      CALL GETSYM
      CALL EXPR
      IF((ARGAA0(APAAA0).EQ.0))GOTO 10063
        CALL PSYNER(AAAAF0,1)
10063 CALL PUSH(0)
      CALL MOVE$(RPNAA0,RPN,RPNLE0)
      CALL MOVE$(CBUFA0,CBUF,CBUFL0)
      PARSE=-2
      RETURN
1     PARSE=-3
      RETURN
      END
      SUBROUTINE EXPR
      INTEGER RDAAA0(884)
      INTEGER ARGAA0(128)
      INTEGER APAAA0,POS2A0
      INTEGER RPNAA0(200),RPNLE0
      INTEGER SYMTY0,SYMTE0(128)
      INTEGER CBUFA0(500),CBUFL0
      REAL * 8 ERRLA0
      COMMON /RSLCOM/RDAAA0,ARGAA0,APAAA0,RPNAA0,RPNLE0,SYMTY0,SYMTE0,CB
     *UFA0,CBUFL0,ERRLA0,POS2A0
      CALL TERM
10064 IF((SYMTY0.NE.252))GOTO 10065
        CALL GETSYM
        CALL TERM
        CALL PUSH(252)
      GOTO 10064
10065 RETURN
      END
      SUBROUTINE TERM
      INTEGER RDAAA0(884)
      INTEGER ARGAA0(128)
      INTEGER APAAA0,POS2A0
      INTEGER RPNAA0(200),RPNLE0
      INTEGER SYMTY0,SYMTE0(128)
      INTEGER CBUFA0(500),CBUFL0
      REAL * 8 ERRLA0
      COMMON /RSLCOM/RDAAA0,ARGAA0,APAAA0,RPNAA0,RPNLE0,SYMTY0,SYMTE0,CB
     *UFA0,CBUFL0,ERRLA0,POS2A0
      CALL FACTOR
10066 IF((SYMTY0.NE.166))GOTO 10067
        CALL GETSYM
        CALL FACTOR
        CALL PUSH(166)
      GOTO 10066
10067 RETURN
      END
      SUBROUTINE FACTOR
      INTEGER RDAAA0(884)
      INTEGER ARGAA0(128)
      INTEGER APAAA0,POS2A0
      INTEGER RPNAA0(200),RPNLE0
      INTEGER SYMTY0,SYMTE0(128)
      INTEGER CBUFA0(500),CBUFL0
      REAL * 8 ERRLA0
      COMMON /RSLCOM/RDAAA0,ARGAA0,APAAA0,RPNAA0,RPNLE0,SYMTY0,SYMTE0,CB
     *UFA0,CBUFL0,ERRLA0,POS2A0
      IF((SYMTY0.NE.254))GOTO 10068
        CALL GETSYM
        CALL FACTOR
        CALL PUSH(254)
        GOTO 10069
10068   CALL PRIMA0
10069 RETURN
      END
      SUBROUTINE PRIMA0
      INTEGER RDAAA0(884)
      INTEGER ARGAA0(128)
      INTEGER APAAA0,POS2A0
      INTEGER RPNAA0(200),RPNLE0
      INTEGER SYMTY0,SYMTE0(128)
      INTEGER CBUFA0(500),CBUFL0
      REAL * 8 ERRLA0
      COMMON /RSLCOM/RDAAA0,ARGAA0,APAAA0,RPNAA0,RPNLE0,SYMTY0,SYMTE0,CB
     *UFA0,CBUFL0,ERRLA0,POS2A0
      INTEGER FT1,FT2,P1,P2,OP,TYPE1,TYPE2
      INTEGER GETQU0,CONVE0
      INTEGER S1(102),S2(102)
      INTEGER AAAAG0(23)
      INTEGER AAAAH0(28)
      INTEGER AAAAI0
      INTEGER AAAAJ0
      INTEGER AAAAK0
      INTEGER AAAAL0(33)
      INTEGER AAAAM0
      INTEGER AAAAN0(33)
      INTEGER AAAAO0(40)
      DATA AAAAG0/245,238,226,225,236,225,238,227,229,228,160,240,225,24
     *2,229,238,244,232,229,243,229,243,0/
      DATA AAAAH0/237,233,243,243,233,238,231,160,242,229,236,225,244,23
     *3,239,238,225,236,160,239,240,229,242,225,244,239,242,0/
      DATA AAAAL0/195,239,237,240,225,242,233,238,231,160,244,247,239,16
     *0,236,233,244,229,242,225,236,243,160,233,243,160,226,239,231,245,
     *243,161,0/
      DATA AAAAN0/195,239,237,240,225,242,233,238,231,160,244,247,239,16
     *0,236,233,244,229,242,225,236,243,160,233,243,160,226,239,231,245,
     *243,161,0/
      DATA AAAAO0/244,249,240,229,243,160,244,239,160,226,229,160,227,23
     *9,237,240,225,242,229,228,160,225,242,229,160,238,239,244,160,227,
     *239,237,240,225,244,233,226,236,229,0/
      IF((SYMTY0.NE.168))GOTO 10070
        CALL GETSYM
        CALL EXPR
        IF((SYMTY0.EQ.169))GOTO 10071
          CALL PSYNER(AAAAG0,1)
10071   CALL GETSYM
        GOTO 10072
10070   CALL FIELD(FT1,S1)
        IF((SYMTY0.EQ.188))GOTO 10073
        IF((SYMTY0.EQ.190))GOTO 10073
        IF((SYMTY0.EQ.220))GOTO 10073
        IF((SYMTY0.EQ.175))GOTO 10073
        IF((SYMTY0.EQ.222))GOTO 10073
        IF((SYMTY0.EQ.189))GOTO 10073
          CALL PSYNER(AAAAH0,1)
10073   OP=SYMTY0
        CALL GETSYM
        CALL FIELD(FT2,S2)
        TYPE1=3
        TYPE2=3
        AAAAI0=FT1
        GOTO 10074
10075     P1=GETQU0(S1)
          TYPE1=RDAAA0(P1)
          AAAAJ0=FT2
          GOTO 10076
10077       P2=GETQU0(S2)
            TYPE2=RDAAA0(P2)
          GOTO 10078
10079       P2=CONVE0(S2,TYPE1)
            TYPE2=TYPE1
          GOTO 10078
10080       TYPE2=3
            P2=CONVE0(S2,3)
          GOTO 10078
10076     IF(AAAAJ0.EQ.162)GOTO 10080
          IF(AAAAJ0.EQ.176)GOTO 10079
          IF(AAAAJ0.EQ.193)GOTO 10077
10078   GOTO 10081
10082     AAAAK0=FT2
          GOTO 10083
10084       P2=GETQU0(S2)
            TYPE2=RDAAA0(P2)
            TYPE1=RDAAA0(P2)
            P1=CONVE0(S1,TYPE1)
          GOTO 10085
10086       CALL PSYNER(AAAAL0,1)
          GOTO 10085
10083     IF(AAAAK0.EQ.162)GOTO 10086
          IF(AAAAK0.EQ.176)GOTO 10086
          IF(AAAAK0.EQ.193)GOTO 10084
10085   GOTO 10081
10087     TYPE1=3
          P1=CONVE0(S1,3)
          AAAAM0=FT2
          GOTO 10088
10089       P2=GETQU0(S2)
            TYPE2=RDAAA0(P2)
          GOTO 10090
10091       CALL PSYNER(AAAAN0,1)
          GOTO 10090
10088     IF(AAAAM0.EQ.162)GOTO 10091
          IF(AAAAM0.EQ.176)GOTO 10091
          IF(AAAAM0.EQ.193)GOTO 10089
10090   GOTO 10081
10074   IF(AAAAI0.EQ.162)GOTO 10087
        IF(AAAAI0.EQ.176)GOTO 10082
        IF(AAAAI0.EQ.193)GOTO 10075
10081   IF((TYPE1.EQ.TYPE2))GOTO 10092
          CALL PSYNER(AAAAO0,1)
10092   CALL PUSH(OP)
        CALL PUSH(FT1)
        CALL PUSH(P1)
        CALL PUSH(FT2)
        CALL PUSH(P2)
10072 RETURN
      END
      SUBROUTINE FIELD(FT,S)
      INTEGER FT
      INTEGER S(102)
      INTEGER RDAAA0(884)
      INTEGER ARGAA0(128)
      INTEGER APAAA0,POS2A0
      INTEGER RPNAA0(200),RPNLE0
      INTEGER SYMTY0,SYMTE0(128)
      INTEGER CBUFA0(500),CBUFL0
      REAL * 8 ERRLA0
      COMMON /RSLCOM/RDAAA0,ARGAA0,APAAA0,RPNAA0,RPNLE0,SYMTY0,SYMTE0,CB
     *UFA0,CBUFL0,ERRLA0,POS2A0
      INTEGER AAAAP0(32)
      DATA AAAAP0/229,248,240,229,227,244,229,228,160,228,239,237,225,23
     *3,238,160,238,225,237,229,160,239,242,160,236,233,244,229,242,225,
     *236,0/
      IF((SYMTY0.EQ.193))GOTO 10093
      IF((SYMTY0.EQ.176))GOTO 10093
      IF((SYMTY0.EQ.162))GOTO 10093
        CALL PSYNER(AAAAP0,1)
10093 FT=SYMTY0
      CALL CTOC(SYMTE0,S,102)
      CALL GETSYM
      RETURN
      END
      INTEGER FUNCTION GETQU0(NAME)
      INTEGER NAME(1)
      INTEGER RDAAA0(884)
      INTEGER ARGAA0(128)
      INTEGER APAAA0,POS2A0
      INTEGER RPNAA0(200),RPNLE0
      INTEGER SYMTY0,SYMTE0(128)
      INTEGER CBUFA0(500),CBUFL0
      REAL * 8 ERRLA0
      COMMON /RSLCOM/RDAAA0,ARGAA0,APAAA0,RPNAA0,RPNLE0,SYMTY0,SYMTE0,CB
     *UFA0,CBUFL0,ERRLA0,POS2A0
      INTEGER I
      INTEGER FINDQ0
      INTEGER AAAAQ0(32)
      DATA AAAAQ0/186,160,228,239,237,225,233,238,160,238,239,244,160,23
     *0,239,245,238,228,160,239,242,160,225,237,226,233,231,245,239,245,
     *243,0/
      I=FINDQ0(RDAAA0,NAME,POS2A0)
      IF((I.NE.0))GOTO 10094
        CALL PRINT(-15,'*s.',NAME)
        CALL PSYNER(AAAAQ0,0)
10094 GETQU0=I
      RETURN
      END
      INTEGER FUNCTION FINDQ0(RD,NAME,POS2)
      INTEGER RD(884)
      INTEGER NAME(1)
      INTEGER POS2
      INTEGER P,I
      INTEGER EQUAL
      INTEGER RNAME(17)
      INTEGER AAAAR0(3)
      INTEGER AAAAS0(3)
      DATA AAAAR0/174,177,0/
      DATA AAAAS0/174,178,0/
      I=1
      GOTO 10097
10095 I=I+(1)
10097 IF((NAME(I).EQ.0))GOTO 10096
      IF((NAME(I).EQ.174))GOTO 10096
      IF((I.GE.17))GOTO 10096
        RNAME(I)=NAME(I)
      GOTO 10095
10096 RNAME(I)=0
      P=0
      IF((NAME(I).EQ.0))GOTO 10099
      IF((POS2.EQ.0))GOTO 10099
      GOTO 10098
10099   I=3+1
        GOTO 10102
10100   I=I+22
10102   IF((I.GT.RD(2)))GOTO 10101
          IF((EQUAL(RNAME,RD(I+5)).NE.1))GOTO 10103
            IF((P.NE.0))GOTO 10104
              P=I
              GOTO 10105
10104         P=0
              GOTO 10101
10105     CONTINUE
10103   GOTO 10100
10101   GOTO 10106
10098   IF((EQUAL(NAME(I),AAAAR0).NE.1))GOTO 10107
          I=3+1
          GOTO 10110
10108     I=I+22
10110     IF((I.EQ.POS2))GOTO 10109
            IF((EQUAL(RNAME,RD(I+5)).NE.1))GOTO 10111
              P=I
              GOTO 10109
10111     GOTO 10108
10109     GOTO 10112
10107     IF((EQUAL(NAME(I),AAAAS0).NE.1))GOTO 10113
            I=POS2
            GOTO 10116
10114       I=I+22
10116       IF((I.GT.RD(2)))GOTO 10115
              IF((EQUAL(RNAME,RD(I+5)).NE.1))GOTO 10117
                P=I
                GOTO 10115
10117       GOTO 10114
10115     CONTINUE
10113   CONTINUE
10112 CONTINUE
10106 FINDQ0=P
      RETURN
      END
      INTEGER FUNCTION CONVE0(S,TYPE)
      INTEGER S(1)
      INTEGER TYPE,P
      INTEGER RDAAA0(884)
      INTEGER ARGAA0(128)
      INTEGER APAAA0,POS2A0
      INTEGER RPNAA0(200),RPNLE0
      INTEGER SYMTY0,SYMTE0(128)
      INTEGER CBUFA0(500),CBUFL0
      REAL * 8 ERRLA0
      COMMON /RSLCOM/RDAAA0,ARGAA0,APAAA0,RPNAA0,RPNLE0,SYMTY0,SYMTE0,CB
     *UFA0,CBUFL0,ERRLA0,POS2A0
      INTEGER I,P
      INTEGER LENGTH
      INTEGER * 4 L
      INTEGER * 4 GCTOL
      REAL * 8 D
      REAL * 8 CTOD
      INTEGER AAAAT0
      INTEGER AAAAU0(18)
      INTEGER AAAAV0(3)
      INTEGER AAAAW0(25)
      INTEGER AAAAX0(18)
      INTEGER AAAAY0(3)
      INTEGER AAAAZ0(22)
      INTEGER AAABA0(18)
      DATA AAAAU0/212,239,239,160,237,225,238,249,160,236,233,244,229,24
     *2,225,236,243,0/
      DATA AAAAV0/170,243,0/
      DATA AAAAW0/201,238,246,225,236,233,228,160,233,238,244,229,231,22
     *9,242,160,227,239,238,243,244,225,238,244,0/
      DATA AAAAX0/212,239,239,160,237,225,238,249,160,236,233,244,229,24
     *2,225,236,243,0/
      DATA AAAAY0/170,243,0/
      DATA AAAAZ0/201,238,246,225,236,233,228,160,242,229,225,236,160,22
     *7,239,238,243,244,225,238,244,0/
      DATA AAABA0/212,239,239,160,237,225,238,249,160,236,233,244,229,24
     *2,225,236,243,0/
      P=CBUFL0
      AAAAT0=TYPE
      GOTO 10118
10119   CBUFL0=CBUFL0+(2)
        IF((CBUFL0.LE.500))GOTO 10120
          CALL PSYNER(AAAAU0,1)
10120   I=1
        L=GCTOL(S,I,10)
        IF((S(I).EQ.0))GOTO 10121
          CALL PRINT(-15,AAAAV0,S)
          CALL PSYNER(AAAAW0,0)
10121   CALL MOVE$(L,CBUFA0(P),2)
      GOTO 10122
10123   CBUFL0=CBUFL0+(4)
        IF((CBUFL0.LE.500))GOTO 10124
          CALL PSYNER(AAAAX0,1)
10124   I=1
        D=CTOD(S,I)
        IF((S(I).EQ.0))GOTO 10125
          CALL PRINT(-15,AAAAY0,S)
          CALL PSYNER(AAAAZ0,0)
10125   CALL MOVE$(D,CBUFA0(P),4)
      GOTO 10122
10126   I=LENGTH(S)+1
        CBUFL0=CBUFL0+(I)
        IF((CBUFL0.LE.500))GOTO 10127
          CALL PSYNER(AAABA0,1)
10127   CALL MOVE$(S,CBUFA0(P),I)
      GOTO 10122
10118 GOTO(10119,10123,10126),AAAAT0
10122 CONVE0=P
      RETURN
      END
      SUBROUTINE GETSYM
      INTEGER RDAAA0(884)
      INTEGER ARGAA0(128)
      INTEGER APAAA0,POS2A0
      INTEGER RPNAA0(200),RPNLE0
      INTEGER SYMTY0,SYMTE0(128)
      INTEGER CBUFA0(500),CBUFL0
      REAL * 8 ERRLA0
      COMMON /RSLCOM/RDAAA0,ARGAA0,APAAA0,RPNAA0,RPNLE0,SYMTY0,SYMTE0,CB
     *UFA0,CBUFL0,ERRLA0,POS2A0
      INTEGER L
      INTEGER QUOTE
      INTEGER AAABB0
      INTEGER AAABC0(14)
      INTEGER AAABD0
      INTEGER AAABE0
      INTEGER AAABF0
      INTEGER AAABG0
      INTEGER AAABH0
      INTEGER AAABI0
      INTEGER AAABJ0
      INTEGER AAABK0(18)
      DATA AAABC0/205,233,243,243,233,238,231,160,241,245,239,244,229,0/
      DATA AAABK0/201,236,236,229,231,225,236,160,227,232,225,242,225,22
     *7,244,229,242,0/
10128 IF((ARGAA0(APAAA0).NE.160))GOTO 10129
        APAAA0=APAAA0+(1)
      GOTO 10128
10129 L=1
      AAABB0=ARGAA0(APAAA0)
      GOTO 10130
10131   SYMTE0(L)=ARGAA0(APAAA0)
        APAAA0=APAAA0+(1)
        L=L+(1)
        GOTO 10134
10132   APAAA0=APAAA0+(1)
        L=L+(1)
10134   IF((193.GT.ARGAA0(APAAA0)))GOTO 10136
        IF((ARGAA0(APAAA0).GT.218))GOTO 10136
        GOTO 10135
10136   IF((225.GT.ARGAA0(APAAA0)))GOTO 10137
        IF((ARGAA0(APAAA0).GT.250))GOTO 10137
        GOTO 10135
10137   IF((176.GT.ARGAA0(APAAA0)))GOTO 10138
        IF((ARGAA0(APAAA0).GT.185))GOTO 10138
        GOTO 10135
10138   IF((ARGAA0(APAAA0).EQ.223))GOTO 10135
        IF((ARGAA0(APAAA0).EQ.174))GOTO 10135
        GOTO 10133
10135     SYMTE0(L)=ARGAA0(APAAA0)
        GOTO 10132
10133   SYMTY0=193
      GOTO 10139
10140   SYMTE0(L)=ARGAA0(APAAA0)
        APAAA0=APAAA0+(1)
        L=L+(1)
        GOTO 10143
10141   APAAA0=APAAA0+(1)
        L=L+(1)
10143   IF((176.GT.ARGAA0(APAAA0)))GOTO 10145
        IF((ARGAA0(APAAA0).GT.185))GOTO 10145
        GOTO 10144
10145   IF((ARGAA0(APAAA0).EQ.174))GOTO 10144
        IF((ARGAA0(APAAA0).EQ.171))GOTO 10144
        IF((ARGAA0(APAAA0).EQ.173))GOTO 10144
        IF((ARGAA0(APAAA0).EQ.229))GOTO 10144
        IF((ARGAA0(APAAA0).EQ.197))GOTO 10144
        IF((ARGAA0(APAAA0).EQ.242))GOTO 10144
        IF((ARGAA0(APAAA0).EQ.210))GOTO 10144
        GOTO 10142
10144     SYMTE0(L)=ARGAA0(APAAA0)
        GOTO 10141
10142   SYMTY0=176
      GOTO 10139
10146   QUOTE=ARGAA0(APAAA0)
        APAAA0=APAAA0+(1)
        L=1
        GOTO 10149
10147   APAAA0=APAAA0+(1)
        L=L+(1)
10149   IF((ARGAA0(APAAA0).EQ.0))GOTO 10148
        IF((ARGAA0(APAAA0).EQ.QUOTE))GOTO 10148
          SYMTE0(L)=ARGAA0(APAAA0)
        GOTO 10147
10148   SYMTE0(L)=0
        IF((ARGAA0(APAAA0).NE.0))GOTO 10150
          CALL PSYNER(AAABC0,1)
          GOTO 10151
10150     APAAA0=APAAA0+(1)
10151   SYMTY0=162
      GOTO 10139
10152   SYMTY0=ARGAA0(APAAA0)
        SYMTE0(1)=ARGAA0(APAAA0)
        APAAA0=APAAA0+(1)
        L=L+(1)
      GOTO 10139
10153   SYMTE0(1)=188
        APAAA0=APAAA0+(1)
        L=L+(1)
        AAABD0=ARGAA0(APAAA0)
        GOTO 10154
10155     SYMTY0=222
        GOTO 10156
10157     SYMTY0=175
        GOTO 10156
10156     SYMTE0(2)=ARGAA0(APAAA0)
          APAAA0=APAAA0+(1)
          L=L+(1)
        GOTO 10158
10154   AAABE0=AAABD0-188
        GOTO(10157,10155),AAABE0
          SYMTY0=188
10158 GOTO 10139
10159   SYMTE0(1)=190
        APAAA0=APAAA0+(1)
        L=L+(1)
        AAABF0=ARGAA0(APAAA0)
        GOTO 10160
10161     SYMTY0=222
        GOTO 10162
10163     SYMTY0=220
        GOTO 10162
10162     SYMTE0(2)=ARGAA0(APAAA0)
          APAAA0=APAAA0+(1)
          L=L+(1)
        GOTO 10164
10160   AAABG0=AAABF0-187
        GOTO(10161,10163),AAABG0
          SYMTY0=190
10164 GOTO 10139
10165   SYMTE0(1)=189
        APAAA0=APAAA0+(1)
        L=L+(1)
        AAABH0=ARGAA0(APAAA0)
        GOTO 10166
10167     SYMTY0=189
        GOTO 10168
10169     SYMTY0=220
        GOTO 10168
10170     SYMTY0=175
        GOTO 10168
10168     SYMTE0(2)=ARGAA0(APAAA0)
          APAAA0=APAAA0+(1)
          L=L+(1)
        GOTO 10171
10166   AAABI0=AAABH0-187
        GOTO(10170,10167,10169),AAABI0
          SYMTY0=189
10171 GOTO 10139
10172   SYMTE0(1)=254
        APAAA0=APAAA0+(1)
        L=L+(1)
        IF((ARGAA0(APAAA0).NE.189))GOTO 10173
          SYMTY0=222
          SYMTE0(2)=189
          APAAA0=APAAA0+(1)
          L=L+(1)
          GOTO 10174
10173     SYMTY0=254
10174 GOTO 10139
10175   SYMTY0=0
      GOTO 10139
10130 IF(AAABB0.EQ.0)GOTO 10175
      AAABJ0=AAABB0-161
      GOTO(10146,10176,10176,10176,10152,10146,10152,10152,10176,10140,1
     *0176,10140,10152,10176,10140,10140,10140,10140,10140,10140,10140,1
     *0140,10140,10140,10176,10176,10153,10165,10159,10176,10176,10131,1
     *0131,10131,10131,10131,10131,10131,10131,10131,10131,10131,10131,1
     *0131,10131,10131,10131,10131,10131,10131,10131,10131,10131,10131,1
     *0131,10131,10131,10176,10176,10176,10176,10176,10176,10131,10131,1
     *0131,10131,10131,10131,10131,10131,10131,10131,10131,10131,10131,1
     *0131,10131,10131,10131,10131,10131,10131,10131,10131,10131,10131,1
     *0131,10131,10176,10152,10176,10172),AAABJ0
10176   CALL PSYNER(AAABK0,1)
10139 SYMTE0(L)=0
      RETURN
      END
      SUBROUTINE PUSH(W)
      INTEGER W
      INTEGER RDAAA0(884)
      INTEGER ARGAA0(128)
      INTEGER APAAA0,POS2A0
      INTEGER RPNAA0(200),RPNLE0
      INTEGER SYMTY0,SYMTE0(128)
      INTEGER CBUFA0(500),CBUFL0
      REAL * 8 ERRLA0
      COMMON /RSLCOM/RDAAA0,ARGAA0,APAAA0,RPNAA0,RPNLE0,SYMTY0,SYMTE0,CB
     *UFA0,CBUFL0,ERRLA0,POS2A0
      INTEGER AAABL0(37)
      DATA AAABL0/211,229,236,229,227,244,233,239,238,160,229,248,240,24
     *2,229,243,243,233,239,238,160,244,239,239,160,227,239,237,240,236,
     *233,227,225,244,229,228,0/
      IF((RPNLE0.LT.200))GOTO 10177
        CALL PSYNER(AAABL0,1)
        GOTO 10178
10177   RPNAA0(RPNLE0)=W
        RPNLE0=RPNLE0+(1)
10178 RETURN
      END
      SUBROUTINE PSYNER(M,C)
      INTEGER M(1)
      INTEGER C
      INTEGER RDAAA0(884)
      INTEGER ARGAA0(128)
      INTEGER APAAA0,POS2A0
      INTEGER RPNAA0(200),RPNLE0
      INTEGER SYMTY0,SYMTE0(128)
      INTEGER CBUFA0(500),CBUFL0
      REAL * 8 ERRLA0
      COMMON /RSLCOM/RDAAA0,ARGAA0,APAAA0,RPNAA0,RPNLE0,SYMTY0,SYMTE0,CB
     *UFA0,CBUFL0,ERRLA0,POS2A0
      INTEGER AAABM0(15)
      INTEGER AAABN0(5)
      DATA AAABM0/170,243,186,160,170,243,170,238,170,163,248,222,170,23
     *8,0/
      DATA AAABN0/170,243,170,238,0/
      IF((C.NE.1))GOTO 10179
        CALL PRINT(-15,AAABM0,ARGAA0,M,APAAA0-2)
        GOTO 10180
10179   CALL PRINT(-15,AAABN0,M)
10180 CALL PL1$NL(ERRLA0)
      END
      INTEGER FUNCTION EVAL(RD,ROW,RPN,CBUF)
      INTEGER RD(884)
      INTEGER ROW(1),RPN(1),CBUF(500)
      INTEGER SP,RP,I1,I2,R
      INTEGER BUF1(102),BUF2(102),STACK(200)
      INTEGER EVALR0
      INTEGER P1,P2
      INTEGER AAABO0
      INTEGER AAABP0
      INTEGER AAABQ0(30)
      DATA AAABQ0/233,238,160,229,246,225,236,186,160,243,244,225,227,23
     *5,160,237,229,243,243,229,228,160,245,240,160,170,233,170,238,0/
      SP=0
      RP=1
      GOTO 10183
10181 RP=RP+(1)
10183 IF((RPN(RP).EQ.0))GOTO 10182
        AAABO0=RPN(RP)
        GOTO 10184
10185     IF((STACK(SP).NE.1))GOTO 10186
          IF((STACK(SP-1).NE.1))GOTO 10186
            STACK(SP-1)=1
            GOTO 10187
10186       STACK(SP-1)=0
10187     SP=SP-(1)
        GOTO 10188
10189     IF((STACK(SP).EQ.1))GOTO 10191
          IF((STACK(SP-1).EQ.1))GOTO 10191
          GOTO 10190
10191       STACK(SP-1)=1
            GOTO 10192
10190       STACK(SP-1)=0
10192     SP=SP-(1)
        GOTO 10188
10193     IF((STACK(SP).NE.1))GOTO 10194
            STACK(SP)=0
            GOTO 10195
10194       STACK(SP)=1
10195   GOTO 10188
10184   IF(AAABO0.EQ.166)GOTO 10185
        AAABP0=AAABO0-251
        GOTO(10189,10196,10193),AAABP0
10196     I1=RPN(RP+1)
          P1=RPN(RP+2)
          I2=RPN(RP+3)
          P2=RPN(RP+4)
          IF((I1.NE.193))GOTO 10197
          IF((I2.NE.193))GOTO 10197
            CALL GETDA0(RD,P1,ROW,BUF1)
            CALL GETDA0(RD,P2,ROW,BUF2)
            R=EVALR0(RPN(RP),RD(P1),BUF1,BUF2)
            GOTO 10198
10197       IF((I1.NE.193))GOTO 10199
              CALL GETDA0(RD,P1,ROW,BUF1)
              R=EVALR0(RPN(RP),RD(P1),BUF1,CBUF(P2))
              GOTO 10200
10199         IF((I2.NE.193))GOTO 10201
                CALL GETDA0(RD,P2,ROW,BUF2)
                R=EVALR0(RPN(RP),RD(P2),CBUF(P1),BUF2)
                GOTO 10202
10201           R=EVALR0(RPN(RP),0,CBUF(P1),CBUF(P2))
10202       CONTINUE
10200     CONTINUE
10198     SP=SP+(1)
          STACK(SP)=R
          RP=RP+(4)
10188 GOTO 10181
10182 IF((SP.EQ.1))GOTO 10203
        CALL PRINT(-15,AAABQ0,SP)
10203 EVAL=STACK(1)
      RETURN
      END
      INTEGER FUNCTION EVALR0(OP,TYPE,BUF1,BUF2)
      INTEGER OP,TYPE,BUF1(1),BUF2(1)
      INTEGER R
      INTEGER COMPA0
      INTEGER AAABR0
      INTEGER AAABS0
      INTEGER AAABT0(30)
      DATA AAABT0/233,238,160,229,246,225,236,223,242,229,236,186,160,22
     *6,239,231,245,243,160,229,238,244,242,249,160,170,233,170,238,0/
      AAABR0=OP
      GOTO 10204
10205   IF((COMPA0(TYPE,BUF1,BUF2).NE.1))GOTO 10206
          R=1
          GOTO 10207
10206     R=0
10207 GOTO 10208
10209   IF((COMPA0(TYPE,BUF1,BUF2).NE.2))GOTO 10210
          R=1
          GOTO 10211
10210     R=0
10211 GOTO 10208
10212   IF((COMPA0(TYPE,BUF1,BUF2).NE.3))GOTO 10213
          R=1
          GOTO 10214
10213     R=0
10214 GOTO 10208
10215   IF((COMPA0(TYPE,BUF1,BUF2).EQ.3))GOTO 10216
          R=1
          GOTO 10217
10216     R=0
10217 GOTO 10208
10218   IF((COMPA0(TYPE,BUF1,BUF2).EQ.2))GOTO 10219
          R=1
          GOTO 10220
10219     R=0
10220 GOTO 10208
10221   IF((COMPA0(TYPE,BUF1,BUF2).EQ.1))GOTO 10222
          R=1
          GOTO 10223
10222     R=0
10223 GOTO 10208
10204 IF(AAABR0.EQ.175)GOTO 10215
      AAABS0=AAABR0-187
      GOTO(10205,10209,10212),AAABS0
      AAABS0=AAABR0-219
      GOTO(10221,10224,10218),AAABS0
10224   CALL PRINT(-15,AAABT0,OP)
10208 EVALR0=R
      RETURN
      END
      INTEGER FUNCTION LOADRD(RD,FD)
      INTEGER RD(884)
      INTEGER FD
      INTEGER ISATTY,READF
      IF((ISATTY(FD).NE.1))GOTO 10225
        CALL REMARK('Sorry, a relation can''t be read from the terminal.
     *')
        LOADRD=-3
        RETURN
10225 IF((READF(RD(1),1,FD).NE.-1))GOTO 10226
        LOADRD=-3
        RETURN
10226 IF((READF(RD(2),RD(1)-1,FD).NE.-1))GOTO 10227
        CALL REMARK('relation is corrupted!!.')
        LOADRD=-3
        RETURN
10227 LOADRD=-2
      RETURN
      END
      SUBROUTINE SAVERD(RD,FD)
      INTEGER RD(884)
      INTEGER FD
      INTEGER ISATTY
      IF((ISATTY(FD).NE.1))GOTO 10228
        CALL PRINV0(RD,FD)
        GOTO 10229
10228   CALL WRITEF(RD,RD(1),FD)
10229 RETURN
      END
      SUBROUTINE PRINV0(RD,FD)
      INTEGER RD(884)
      INTEGER FD
      INTEGER I
      INTEGER TYPE(102)
      INTEGER AAABU0(10)
      INTEGER AAABV0(33)
      INTEGER AAABW0(10)
      INTEGER AAABX0
      INTEGER AAABY0(8)
      INTEGER AAABZ0(5)
      INTEGER AAACA0(7)
      INTEGER AAACB0(24)
      INTEGER AAACC0(10)
      DATA AAABU0/170,179,185,172,172,173,248,170,238,0/
      DATA AAABV0/252,160,244,249,240,229,160,160,160,160,252,160,236,22
     *9,238,231,244,232,160,252,160,238,225,237,229,170,177,179,248,252,
     *170,238,0/
      DATA AAABW0/170,179,185,172,172,173,248,170,238,0/
      DATA AAABY0/233,238,244,229,231,229,242,0/
      DATA AAABZ0/242,229,225,236,0/
      DATA AAACA0/243,244,242,233,238,231,0/
      DATA AAACB0/252,160,170,183,243,160,252,160,170,181,233,160,160,25
     *2,160,170,177,182,243,160,252,170,238,0/
      DATA AAACC0/170,179,185,172,172,173,248,170,238,0/
      CALL PRINT(FD,AAABU0)
      CALL PRINT(FD,AAABV0)
      CALL PRINT(FD,AAABW0)
      I=3+1
      GOTO 10232
10230 I=I+22
10232 IF((I.GT.RD(2)))GOTO 10231
        AAABX0=RD(I)
        GOTO 10233
10234     CALL CTOC(AAABY0,TYPE,102)
        GOTO 10235
10236     CALL CTOC(AAABZ0,TYPE,102)
        GOTO 10235
10237     CALL CTOC(AAACA0,TYPE,102)
        GOTO 10235
10233   GOTO(10234,10236,10237),AAABX0
10235   CALL PRINT(FD,AAACB0,TYPE,RD(I+1),RD(I+5))
      GOTO 10230
10231 CALL PRINT(FD,AAACC0)
      RETURN
      END
      INTEGER FUNCTION ADDFI0(RD,TYPE,LEN,NAME)
      INTEGER RD(884)
      INTEGER TYPE,LEN
      INTEGER NAME(1)
      INTEGER I
      INTEGER AAACD0
      I=RD(2)+22
      IF((I+22-1.LE.884))GOTO 10238
        ADDFI0=0
        RETURN
10238 RD(I)=TYPE
      RD(I+4)=LENGTH(NAME)
      AAACD0=TYPE
      GOTO 10239
10240   RD(I+1)=2
        RD(I+4)=MAX0(RD(I+4),10)
      GOTO 10241
10242   RD(I+1)=4
        RD(I+4)=MAX0(RD(I+4),15)
      GOTO 10241
10243   RD(I+1)=LEN
        RD(I+4)=MAX0(RD(I+4),LEN)
      GOTO 10241
10239 GOTO(10240,10242,10243),AAACD0
        CALL ERROR('in add_field_to_rd: bogus type passed.')
10241 RD(I+2)=RD(3)+1
      RD(I+3)=RD(3)+RD(I+1)
      CALL CTOC(NAME,RD(I+5),17)
      RD(1)=RD(1)+(22)
      RD(2)=RD(2)+(22)
      RD(3)=RD(3)+(RD(I+1))
      IF((RD(3).LE.500))GOTO 10244
        ADDFI0=0
        RETURN
10244 ADDFI0=I
      RETURN
      END
      INTEGER FUNCTION FINDF0(RD,NAME)
      INTEGER RD(884)
      INTEGER NAME(1)
      INTEGER I
      INTEGER EQUAL
      I=3+1
      GOTO 10247
10245 I=I+22
10247 IF((I.GT.RD(2)))GOTO 10246
        IF((EQUAL(RD(I+5),NAME).NE.1))GOTO 10248
          FINDF0=I
          RETURN
10248 GOTO 10245
10246 FINDF0=0
      RETURN
      END
      INTEGER FUNCTION COMPA0(TYPE,BUF1,BUF2)
      INTEGER TYPE
      INTEGER BUF1(500),BUF2(500)
      INTEGER R
      INTEGER COMPB0,COMPC0,COMPD0
      INTEGER AAACE0
      INTEGER AAACF0(34)
      DATA AAACF0/233,238,160,227,239,237,240,225,242,229,223,230,233,22
     *9,236,228,186,160,226,239,231,245,243,160,244,249,240,229,160,170,
     *233,170,238,0/
      AAACE0=TYPE
      GOTO 10249
10250   R=COMPB0(BUF1,BUF2)
      GOTO 10251
10252   R=COMPC0(BUF1,BUF2)
      GOTO 10251
10253   R=COMPD0(BUF1,BUF2)
      GOTO 10251
10249 GOTO(10250,10252,10253),AAACE0
        CALL PRINT(-15,AAACF0,TYPE)
        R=2
10251 COMPA0=R
      RETURN
      END
      INTEGER FUNCTION COMPB0(I1,I2)
      INTEGER * 4 I1,I2
      IF((I1.GE.I2))GOTO 10254
        COMPB0=1
        RETURN
10254 IF((I1.LE.I2))GOTO 10255
        COMPB0=3
        RETURN
10255 COMPB0=2
      RETURN
      END
      INTEGER FUNCTION COMPC0(D1,D2)
      REAL * 8 D1,D2
      IF((D1.GE.D2))GOTO 10256
        COMPC0=1
        RETURN
10256 IF((D1.LE.D2))GOTO 10257
        COMPC0=3
        RETURN
10257 COMPC0=2
      RETURN
      END
      INTEGER FUNCTION COMPD0(S1,S2)
      INTEGER S1(1),S2(1)
      INTEGER I
      I=1
      GOTO 10260
10258 I=I+(1)
10260 IF((S1(I).NE.S2(I)))GOTO 10259
      IF((S1(I).EQ.0))GOTO 10259
      GOTO 10258
10259 IF((S1(I).NE.S2(I)))GOTO 10261
        COMPD0=2
        RETURN
10261 IF((S1(I).EQ.0))GOTO 10263
      IF((S1(I).LT.S2(I)))GOTO 10263
      GOTO 10262
10263   COMPD0=1
        RETURN
10262 COMPD0=3
      RETURN
      END
      SUBROUTINE PRINT0(RD,FD)
      INTEGER RD(884)
      INTEGER FD
      INTEGER I
      INTEGER AAACG0(2)
      INTEGER AAACH0(7)
      INTEGER AAACI0(3)
      INTEGER AAACJ0(2)
      INTEGER AAACK0(7)
      INTEGER AAACL0(3)
      INTEGER AAACM0(2)
      INTEGER AAACN0(7)
      INTEGER AAACO0(3)
      DATA AAACG0/173,0/
      DATA AAACH0/170,163,172,172,173,248,0/
      DATA AAACI0/170,238,0/
      DATA AAACJ0/252,0/
      DATA AAACK0/160,170,163,243,160,252,0/
      DATA AAACL0/170,238,0/
      DATA AAACM0/173,0/
      DATA AAACN0/170,163,172,172,173,248,0/
      DATA AAACO0/170,238,0/
      CALL PRINT(FD,AAACG0)
      I=3+1
      GOTO 10266
10264 I=I+22
10266 IF((I.GT.RD(2)))GOTO 10265
        CALL PRINT(FD,AAACH0,RD(I+4)+3)
      GOTO 10264
10265 CALL PRINT(FD,AAACI0)
      CALL PRINT(FD,AAACJ0)
      I=3+1
      GOTO 10269
10267 I=I+22
10269 IF((I.GT.RD(2)))GOTO 10268
        CALL PRINT(FD,AAACK0,RD(I+4),RD(I+5))
      GOTO 10267
10268 CALL PRINT(FD,AAACL0)
      CALL PRINT(FD,AAACM0)
      I=3+1
      GOTO 10272
10270 I=I+22
10272 IF((I.GT.RD(2)))GOTO 10271
        CALL PRINT(FD,AAACN0,RD(I+4)+3)
      GOTO 10270
10271 CALL PRINT(FD,AAACO0)
      RETURN
      END
      SUBROUTINE PRINU0(RD,FD)
      INTEGER RD(884)
      INTEGER FD
      INTEGER I
      INTEGER AAACP0(2)
      INTEGER AAACQ0(7)
      INTEGER AAACR0(3)
      DATA AAACP0/173,0/
      DATA AAACQ0/170,163,172,172,173,248,0/
      DATA AAACR0/170,238,0/
      CALL PRINT(FD,AAACP0)
      I=3+1
      GOTO 10275
10273 I=I+22
10275 IF((I.GT.RD(2)))GOTO 10274
        CALL PRINT(FD,AAACQ0,RD(I+4)+3)
      GOTO 10273
10274 CALL PRINT(FD,AAACR0)
      RETURN
      END
      SUBROUTINE PRINW0(RD,FD,BUF)
      INTEGER RD(884)
      INTEGER FD
      INTEGER BUF(500)
      INTEGER I
      INTEGER AAACS0(2)
      INTEGER AAACT0
      INTEGER AAACU0(7)
      INTEGER AAACV0(7)
      INTEGER AAACW0(9)
      INTEGER AAACX0(3)
      DATA AAACS0/252,0/
      DATA AAACU0/160,170,163,236,160,252,0/
      DATA AAACV0/160,170,163,228,160,252,0/
      DATA AAACW0/160,170,163,172,163,243,160,252,0/
      DATA AAACX0/170,238,0/
      CALL PRINT(FD,AAACS0)
      I=3+1
      GOTO 10278
10276 I=I+22
10278 IF((I.GT.RD(2)))GOTO 10277
        AAACT0=RD(I)
        GOTO 10279
10280     CALL PRINT(FD,AAACU0,RD(I+4),BUF(RD(I+2)))
        GOTO 10281
10282     CALL PRINT(FD,AAACV0,RD(I+4),BUF(RD(I+2)))
        GOTO 10281
10283     CALL PRINT(FD,AAACW0,RD(I+4),RD(I+1),BUF(RD(I+2)))
        GOTO 10281
10279   GOTO(10280,10282,10283),AAACT0
10281 GOTO 10276
10277 CALL PRINT(FD,AAACX0)
      RETURN
      END
      INTEGER FUNCTION GETROW(RD,FD,BUF)
      INTEGER RD(884)
      INTEGER FD
      INTEGER BUF(500),I
      INTEGER READF
      I=READF(BUF,RD(3),FD)
      GETROW=I
      RETURN
      END
      SUBROUTINE PUTROW(RD,FD,BUF)
      INTEGER RD(884)
      INTEGER FD
      INTEGER BUF(500)
      INTEGER ISATTY
      IF((ISATTY(FD).NE.1))GOTO 10284
        CALL PRINW0(RD,FD,BUF)
        GOTO 10285
10284   CALL WRITEF(BUF,RD(3),FD)
10285 RETURN
      END
      SUBROUTINE GETDA0(RD,I,BUF,DEST)
      INTEGER RD(884)
      INTEGER I,BUF(1),DEST(102)
      INTEGER J,K
      INTEGER AAACY0
      AAACY0=RD(I)
      GOTO 10286
10287   J=RD(I+2)
        DEST(1)=BUF(J)
        DEST(2)=BUF(J+1)
      GOTO 10288
10289   J=RD(I+2)
        DEST(1)=BUF(J)
        DEST(2)=BUF(J+1)
        DEST(3)=BUF(J+2)
        DEST(4)=BUF(J+3)
      GOTO 10288
10290   J=RD(I+3)
        K=RD(I+1)
        GOTO 10293
10291   J=J-(1)
        K=K-(1)
10293   IF((K.LE.0))GOTO 10292
        IF((BUF(J).NE.160))GOTO 10292
        GOTO 10291
10292   DEST(K+1)=0
        GOTO 10296
10294   J=J-(1)
        K=K-(1)
10296   IF((K.LE.0))GOTO 10295
          DEST(K)=BUF(J)
        GOTO 10294
10295 GOTO 10288
10286 GOTO(10287,10289,10290),AAACY0
10288 RETURN
      END
      SUBROUTINE PUTDA0(RD,I,BUF,SRC)
      INTEGER RD(884)
      INTEGER I,BUF(1),SRC(102)
      INTEGER J,K
      INTEGER AAACZ0
      AAACZ0=RD(I)
      GOTO 10297
10298   J=RD(I+2)
        BUF(J)=SRC(1)
        BUF(J+1)=SRC(2)
      GOTO 10299
10300   J=RD(I+2)
        BUF(J)=SRC(1)
        BUF(J+1)=SRC(2)
        BUF(J+2)=SRC(3)
        BUF(J+3)=SRC(4)
      GOTO 10299
10301   J=RD(I+2)
        K=1
        GOTO 10304
10302   J=J+(1)
        K=K+(1)
10304   IF((SRC(K).EQ.0))GOTO 10303
        IF((K.GT.RD(I+1)))GOTO 10303
          BUF(J)=SRC(K)
        GOTO 10302
10303   GOTO 10307
10305   K=K+(1)
        J=J+(1)
10307   IF((K.GT.RD(I+1)))GOTO 10306
          BUF(J)=160
        GOTO 10305
10306 GOTO 10299
10297 GOTO(10298,10300,10301),AAACZ0
10299 RETURN
      END
      INTEGER FUNCTION COMPE0(RD,ROW1,ROW2)
      INTEGER RD(884)
      INTEGER ROW1(500),ROW2(500)
      INTEGER BUF1(500),BUF2(500)
      INTEGER R,I
      INTEGER COMPA0
      I=3+1
      GOTO 10310
10308 I=I+22
10310 IF((I.GT.RD(2)))GOTO 10309
        CALL GETDA0(RD,I,ROW1,BUF1)
        CALL GETDA0(RD,I,ROW2,BUF2)
        R=COMPA0(RD(I),BUF1,BUF2)
        IF((R.EQ.2))GOTO 10311
          COMPE0=R
          RETURN
10311 GOTO 10308
10309 COMPE0=2
      RETURN
      END
C ---- Long Name Map ----
C Rpn                            rpnaa0
C comparefield                   compa0
C printheader                    print0
C comparerow                     compe0
C Ap                             apaaa0
C Rd                             rdaaa0
C Pos2                           pos2a0
C Cbuflen                        cbufl0
C newname                        newna0
C evalrel                        evalr0
C printtrailer                   prinu0
C getqualfield                   getqu0
C Rpnlen                         rpnle0
C putdata                        putda0
C compareinteger                 compb0
C comparestring                  compd0
C findfield                      findf0
C Arg                            argaa0
C findqualfield                  findq0
C Symtype                        symty0
C Symtext                        symte0
C convert                        conve0
C printrd                        prinv0
C printrow                       prinw0
C primary                        prima0
C comparereal                    compc0
C getdata                        getda0
C Errlab                         errla0
C Cbuf                           cbufa0
C addfieldtord                   addfi0
C oldname                        oldna0
C getname                        getna0