INTEGER RD1(884),RD2(884) INTEGER I,J INTEGER ROW(500) INTEGER LOADRD,EQUAL,ISATTY,GETROW IF((LOADRD(RD1,-10).EQ.-2))GOTO 10000 CALL ERROR('Can''t access input relation 1.') 10000 IF((LOADRD(RD2,-12).EQ.-2))GOTO 10001 CALL ERROR('Can''t access input relation 2.') 10001 I=3+1 J=3+1 GOTO 10004 10002 I=I+22 J=J+22 10004 IF((I.GT.RD1(2)))GOTO 10003 IF((J.GT.RD2(2)))GOTO 10003 IF((I.NE.J))GOTO 10006 IF((RD1(I).NE.RD2(J)))GOTO 10006 IF((RD1(I+1).NE.RD2(J+1)))GOTO 10006 IF((EQUAL(RD1(I+5),RD2(J+5)).EQ.0))GOTO 10006 GOTO 10005 10006 CALL ERROR('Relations must have identical descriptions.') 10005 GOTO 10002 10003 IF((I.LE.RD1(2)))GOTO 10008 IF((J.LE.RD2(2)))GOTO 10008 GOTO 10007 10008 CALL ERROR('Relations must have identical descriptions.') 10007 CALL SAVERD(RD1,-11) IF((ISATTY(-11).NE.1))GOTO 10009 CALL PRINT0(RD1,-11) 10009 CONTINUE 10010 IF((GETROW(RD1,-10,ROW).EQ.-1))GOTO 10011 CALL PUTROW(RD1,-11,ROW) GOTO 10010 10011 CONTINUE 10012 IF((GETROW(RD2,-12,ROW).EQ.-1))GOTO 10013 CALL PUTROW(RD2,-11,ROW) GOTO 10012 10013 IF((ISATTY(-11).NE.1))GOTO 10014 CALL PRINU0(RD1,-11) 10014 CALL SWT END INTEGER FUNCTION LOADRD(RD,FD) INTEGER RD(884) INTEGER FD INTEGER ISATTY,READF IF((ISATTY(FD).NE.1))GOTO 10015 CALL REMARK('Sorry, a relation can''t be read from the terminal. *') LOADRD=-3 RETURN 10015 IF((READF(RD(1),1,FD).NE.-1))GOTO 10016 LOADRD=-3 RETURN 10016 IF((READF(RD(2),RD(1)-1,FD).NE.-1))GOTO 10017 CALL REMARK('relation is corrupted!!.') LOADRD=-3 RETURN 10017 LOADRD=-2 RETURN END SUBROUTINE SAVERD(RD,FD) INTEGER RD(884) INTEGER FD INTEGER ISATTY IF((ISATTY(FD).NE.1))GOTO 10018 CALL PRINV0(RD,FD) GOTO 10019 10018 CALL WRITEF(RD,RD(1),FD) 10019 RETURN END SUBROUTINE PRINV0(RD,FD) INTEGER RD(884) INTEGER FD INTEGER I INTEGER TYPE(102) INTEGER AAAAA0(10) INTEGER AAAAB0(33) INTEGER AAAAC0(10) INTEGER AAAAD0 INTEGER AAAAE0(8) INTEGER AAAAF0(5) INTEGER AAAAG0(7) INTEGER AAAAH0(24) INTEGER AAAAI0(10) DATA AAAAA0/170,179,185,172,172,173,248,170,238,0/ DATA AAAAB0/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 AAAAC0/170,179,185,172,172,173,248,170,238,0/ DATA AAAAE0/233,238,244,229,231,229,242,0/ DATA AAAAF0/242,229,225,236,0/ DATA AAAAG0/243,244,242,233,238,231,0/ DATA AAAAH0/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 AAAAI0/170,179,185,172,172,173,248,170,238,0/ CALL PRINT(FD,AAAAA0) CALL PRINT(FD,AAAAB0) CALL PRINT(FD,AAAAC0) I=3+1 GOTO 10022 10020 I=I+22 10022 IF((I.GT.RD(2)))GOTO 10021 AAAAD0=RD(I) GOTO 10023 10024 CALL CTOC(AAAAE0,TYPE,102) GOTO 10025 10026 CALL CTOC(AAAAF0,TYPE,102) GOTO 10025 10027 CALL CTOC(AAAAG0,TYPE,102) GOTO 10025 10023 GOTO(10024,10026,10027),AAAAD0 10025 CALL PRINT(FD,AAAAH0,TYPE,RD(I+1),RD(I+5)) GOTO 10020 10021 CALL PRINT(FD,AAAAI0) RETURN END INTEGER FUNCTION ADDFI0(RD,TYPE,LEN,NAME) INTEGER RD(884) INTEGER TYPE,LEN INTEGER NAME(1) INTEGER I INTEGER AAAAJ0 I=RD(2)+22 IF((I+22-1.LE.884))GOTO 10028 ADDFI0=0 RETURN 10028 RD(I)=TYPE RD(I+4)=LENGTH(NAME) AAAAJ0=TYPE GOTO 10029 10030 RD(I+1)=2 RD(I+4)=MAX0(RD(I+4),10) GOTO 10031 10032 RD(I+1)=4 RD(I+4)=MAX0(RD(I+4),15) GOTO 10031 10033 RD(I+1)=LEN RD(I+4)=MAX0(RD(I+4),LEN) GOTO 10031 10029 GOTO(10030,10032,10033),AAAAJ0 CALL ERROR('in add_field_to_rd: bogus type passed.') 10031 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 10034 ADDFI0=0 RETURN 10034 ADDFI0=I RETURN END INTEGER FUNCTION FINDF0(RD,NAME) INTEGER RD(884) INTEGER NAME(1) INTEGER I INTEGER EQUAL I=3+1 GOTO 10037 10035 I=I+22 10037 IF((I.GT.RD(2)))GOTO 10036 IF((EQUAL(RD(I+5),NAME).NE.1))GOTO 10038 FINDF0=I RETURN 10038 GOTO 10035 10036 FINDF0=0 RETURN END INTEGER FUNCTION COMPA0(TYPE,BUF1,BUF2) INTEGER TYPE INTEGER BUF1(500),BUF2(500) INTEGER R INTEGER COMPB0,COMPC0,COMPD0 INTEGER AAAAK0 INTEGER AAAAL0(34) DATA AAAAL0/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/ AAAAK0=TYPE GOTO 10039 10040 R=COMPB0(BUF1,BUF2) GOTO 10041 10042 R=COMPC0(BUF1,BUF2) GOTO 10041 10043 R=COMPD0(BUF1,BUF2) GOTO 10041 10039 GOTO(10040,10042,10043),AAAAK0 CALL PRINT(-15,AAAAL0,TYPE) R=2 10041 COMPA0=R RETURN END INTEGER FUNCTION COMPB0(I1,I2) INTEGER * 4 I1,I2 IF((I1.GE.I2))GOTO 10044 COMPB0=1 RETURN 10044 IF((I1.LE.I2))GOTO 10045 COMPB0=3 RETURN 10045 COMPB0=2 RETURN END INTEGER FUNCTION COMPC0(D1,D2) REAL * 8 D1,D2 IF((D1.GE.D2))GOTO 10046 COMPC0=1 RETURN 10046 IF((D1.LE.D2))GOTO 10047 COMPC0=3 RETURN 10047 COMPC0=2 RETURN END INTEGER FUNCTION COMPD0(S1,S2) INTEGER S1(1),S2(1) INTEGER I I=1 GOTO 10050 10048 I=I+(1) 10050 IF((S1(I).NE.S2(I)))GOTO 10049 IF((S1(I).EQ.0))GOTO 10049 GOTO 10048 10049 IF((S1(I).NE.S2(I)))GOTO 10051 COMPD0=2 RETURN 10051 IF((S1(I).EQ.0))GOTO 10053 IF((S1(I).LT.S2(I)))GOTO 10053 GOTO 10052 10053 COMPD0=1 RETURN 10052 COMPD0=3 RETURN END SUBROUTINE PRINT0(RD,FD) INTEGER RD(884) INTEGER FD INTEGER I INTEGER AAAAM0(2) INTEGER AAAAN0(7) INTEGER AAAAO0(3) INTEGER AAAAP0(2) INTEGER AAAAQ0(7) INTEGER AAAAR0(3) INTEGER AAAAS0(2) INTEGER AAAAT0(7) INTEGER AAAAU0(3) DATA AAAAM0/173,0/ DATA AAAAN0/170,163,172,172,173,248,0/ DATA AAAAO0/170,238,0/ DATA AAAAP0/252,0/ DATA AAAAQ0/160,170,163,243,160,252,0/ DATA AAAAR0/170,238,0/ DATA AAAAS0/173,0/ DATA AAAAT0/170,163,172,172,173,248,0/ DATA AAAAU0/170,238,0/ CALL PRINT(FD,AAAAM0) I=3+1 GOTO 10056 10054 I=I+22 10056 IF((I.GT.RD(2)))GOTO 10055 CALL PRINT(FD,AAAAN0,RD(I+4)+3) GOTO 10054 10055 CALL PRINT(FD,AAAAO0) CALL PRINT(FD,AAAAP0) I=3+1 GOTO 10059 10057 I=I+22 10059 IF((I.GT.RD(2)))GOTO 10058 CALL PRINT(FD,AAAAQ0,RD(I+4),RD(I+5)) GOTO 10057 10058 CALL PRINT(FD,AAAAR0) CALL PRINT(FD,AAAAS0) I=3+1 GOTO 10062 10060 I=I+22 10062 IF((I.GT.RD(2)))GOTO 10061 CALL PRINT(FD,AAAAT0,RD(I+4)+3) GOTO 10060 10061 CALL PRINT(FD,AAAAU0) RETURN END SUBROUTINE PRINU0(RD,FD) INTEGER RD(884) INTEGER FD INTEGER I INTEGER AAAAV0(2) INTEGER AAAAW0(7) INTEGER AAAAX0(3) DATA AAAAV0/173,0/ DATA AAAAW0/170,163,172,172,173,248,0/ DATA AAAAX0/170,238,0/ CALL PRINT(FD,AAAAV0) I=3+1 GOTO 10065 10063 I=I+22 10065 IF((I.GT.RD(2)))GOTO 10064 CALL PRINT(FD,AAAAW0,RD(I+4)+3) GOTO 10063 10064 CALL PRINT(FD,AAAAX0) RETURN END SUBROUTINE PRINW0(RD,FD,BUF) INTEGER RD(884) INTEGER FD INTEGER BUF(500) INTEGER I INTEGER AAAAY0(2) INTEGER AAAAZ0 INTEGER AAABA0(7) INTEGER AAABB0(7) INTEGER AAABC0(9) INTEGER AAABD0(3) DATA AAAAY0/252,0/ DATA AAABA0/160,170,163,236,160,252,0/ DATA AAABB0/160,170,163,228,160,252,0/ DATA AAABC0/160,170,163,172,163,243,160,252,0/ DATA AAABD0/170,238,0/ CALL PRINT(FD,AAAAY0) I=3+1 GOTO 10068 10066 I=I+22 10068 IF((I.GT.RD(2)))GOTO 10067 AAAAZ0=RD(I) GOTO 10069 10070 CALL PRINT(FD,AAABA0,RD(I+4),BUF(RD(I+2))) GOTO 10071 10072 CALL PRINT(FD,AAABB0,RD(I+4),BUF(RD(I+2))) GOTO 10071 10073 CALL PRINT(FD,AAABC0,RD(I+4),RD(I+1),BUF(RD(I+2))) GOTO 10071 10069 GOTO(10070,10072,10073),AAAAZ0 10071 GOTO 10066 10067 CALL PRINT(FD,AAABD0) 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 10074 CALL PRINW0(RD,FD,BUF) GOTO 10075 10074 CALL WRITEF(BUF,RD(3),FD) 10075 RETURN END SUBROUTINE GETDA0(RD,I,BUF,DEST) INTEGER RD(884) INTEGER I,BUF(1),DEST(102) INTEGER J,K INTEGER AAABE0 AAABE0=RD(I) GOTO 10076 10077 J=RD(I+2) DEST(1)=BUF(J) DEST(2)=BUF(J+1) GOTO 10078 10079 J=RD(I+2) DEST(1)=BUF(J) DEST(2)=BUF(J+1) DEST(3)=BUF(J+2) DEST(4)=BUF(J+3) GOTO 10078 10080 J=RD(I+3) K=RD(I+1) GOTO 10083 10081 J=J-(1) K=K-(1) 10083 IF((K.LE.0))GOTO 10082 IF((BUF(J).NE.160))GOTO 10082 GOTO 10081 10082 DEST(K+1)=0 GOTO 10086 10084 J=J-(1) K=K-(1) 10086 IF((K.LE.0))GOTO 10085 DEST(K)=BUF(J) GOTO 10084 10085 GOTO 10078 10076 GOTO(10077,10079,10080),AAABE0 10078 RETURN END SUBROUTINE PUTDA0(RD,I,BUF,SRC) INTEGER RD(884) INTEGER I,BUF(1),SRC(102) INTEGER J,K INTEGER AAABF0 AAABF0=RD(I) GOTO 10087 10088 J=RD(I+2) BUF(J)=SRC(1) BUF(J+1)=SRC(2) GOTO 10089 10090 J=RD(I+2) BUF(J)=SRC(1) BUF(J+1)=SRC(2) BUF(J+2)=SRC(3) BUF(J+3)=SRC(4) GOTO 10089 10091 J=RD(I+2) K=1 GOTO 10094 10092 J=J+(1) K=K+(1) 10094 IF((SRC(K).EQ.0))GOTO 10093 IF((K.GT.RD(I+1)))GOTO 10093 BUF(J)=SRC(K) GOTO 10092 10093 GOTO 10097 10095 K=K+(1) J=J+(1) 10097 IF((K.GT.RD(I+1)))GOTO 10096 BUF(J)=160 GOTO 10095 10096 GOTO 10089 10087 GOTO(10088,10090,10091),AAABF0 10089 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 10100 10098 I=I+22 10100 IF((I.GT.RD(2)))GOTO 10099 CALL GETDA0(RD,I,ROW1,BUF1) CALL GETDA0(RD,I,ROW2,BUF2) R=COMPA0(RD(I),BUF1,BUF2) IF((R.EQ.2))GOTO 10101 COMPE0=R RETURN 10101 GOTO 10098 10099 COMPE0=2 RETURN END C ---- Long Name Map ---- C comparefield compa0 C printheader print0 C comparerow compe0 C printtrailer prinu0 C compareinteger compb0 C comparestring compd0 C putdata putda0 C findfield findf0 C printrd prinv0 C printrow prinw0 C comparereal compc0 C getdata getda0 C addfieldtord addfi0