SAY XDETREXX() ;
PULL Z
EXIT
XDETREXX: PROCEDURE
parse version TN level dt1 dt2 dt3
parse source S1
TA = ADDRESS()
TOS = TRANSLATE(WORD(S1,1))
TSPF = 0
IF TN = "REXXPC88" THEN TSPF = ' 0 DOS REXX88 ';
IF TN = "REXXSAA" THEN DO
IF (dt3 = "1994" & dt2 = "Nov") THEN TSPF = ' 1 DOS IBMSAA ';
IF TOS = "OS/400" THEN TSPF = ' 2 AS4 IBMSAA ';
IF LEFT(TOS,3) = "WIN" THEN TSPF = ' 3 WIN OBJREXX ';
END
IF TN = "REXX/2" THEN DO
IF dt3 = "1995" THEN TSPF = ' 4 DOS SPFPC4 ';
IF dt3 = "1996" THEN TSPF = ' 5 WIN SPFPRO ';
END
IF (TN = "REXX" & dt3 = "99") THEN TSPF = ' 6 DOS CREXX ';
IF (TN = "OBJREXX" & TA = "bash") THEN TSPF = ' 7 NIX OBJREXX ';
IF TN = "REXXC370" THEN TSPF = ' 8 MVS C370 ';
IF TN = "REXX370" THEN DO
IF TA = "CMS" THEN TSPF = ' 9 VM 370 ';
IF TA = "ksh" THEN TSPF = '10 AIX SAA ';
IF TA = "MVS" THEN TSPF = '11 MVS 370 ';
IF TA = "REXXCICS" THEN TSPF = '12 OMVS 370 ';
IF TA = "SH" THEN TSPF = '13 OMVS 370 ';
IF TA = "TSO" THEN TSPF = '14 TSO 370 ';
IF TA = "VSE" THEN TSPF = '15 VSE 370 ';
IF TA = "XEDIT" THEN TSPF = '16 XED 370 ';
END
IF TOS = "OS/2" THEN DO
IF dt3 = "1996" THEN TSPF = '17 OS2W OBJREXX ';
IF dt3 = "1992" THEN TSPF = '18 OS2 IBMSAA ';
IF (dt3 = "1996" & dt1 = "24") THEN TSPF = '19 OS24 IBMSAA ';
IF (dt3 = "1997" & dt1 = "14") THEN TSPF = '20 OS23 TRITUS ';
END
IF TN = "REXX-r4" THEN TSPF = '21 WIN R4 ';
IF LEFT(TN,8) = "REXX-roo" THEN TSPF = '22 WIN ROO ';
IF POS("Personal",TN) > 0 THEN DO
IF dt3 = "1992" THEN TSPF = '23 DOS PREXX4 ';
IF dt3 = "1995" THEN TSPF = '24 WIN PREXX4 ';
IF dt3 = "1997" THEN TSPF = '25 WIN PREXX4 ';
END
IF TA = "THE" THEN DO
IF TOS = "WIN32" THEN TSPF = '26 WIN THE ';
IF TOS = "UNIX" THEN TSPF = '27 NIX THE ';
IF TOS = "DOS" THEN TSPF = '28 DOS THE ';
IF TOS = "OS/2" THEN TSPF = '29 OS2 THE ';
END
IF POS("Regina",TN) > 1 THEN DO
IF TOS = "WIN32" THEN TSPF = '30 WIN REGINA ';
IF TOS = "VMS" THEN TSPF = '31 OVMS REGINA ';
IF TOS = "UNIX" THEN TSPF = '32 NIX REGINA ';
IF LEFT(TOS,4) = "EPOC" THEN TSPF = '33 EPCC REGINA ';
IF TOS = "QNX" THEN TSPF = '34 QNX REGINA ';
IF LEFT(S1,5) = "AMIGA" THEN TSPF = '35 AMIG REGINA ';
END
IF POS("ooRexx",TN,1) > 1 THEN DO
IF LEFT(TOS,3) = "WIN" THEN TSPF = '36 WIN OOREXX ';
IF TOS = "LINUX" THEN TSPF = '37 NIX OOREXX ';
END
IF LEFT(TN,5) = "brexx" THEN DO
IF (dt3 = "2003" & dt1 = "Mar") THEN TSPF = '38 DOS BREXX16 ';
END
IF name = "REXX/PC" & dt3 = "1992" THEN TSPF = '39 DOS TRITUS ';
IF POS("REXX:",name) > 0 THEN TSPF = '40 DOS TRITUS ';
IF TN = "NetRexx" THEN TSPF = '41 WIN NETREXX ';
IF POS("uni-rexx",TN) > 0 THEN TSPF = '42 NIX UNI-RX ';
IF LEFT(TN,8) = "REXX/imc" THEN TSPF = '43 NIX IMC-RX ';
IF TN="ARexx" THEN TSPF = '44 AOS AREXX ';
IF POS("ise",TN) > 0 & dt3 = "1995" THEN TSPF = '45 WIN Enterprise ';
TSPF = TSPF""TA
TSPF = TSPF" "TN" "level" "dt1" "dt2" "dt3" "S1
RETURN (TSPF)
XCMD: PROCEDURE
PARSE ARG TCMD
TSPF = WORD(XDETREXX(),1) ;
IF TSPF > 3 & TSPF < 6 THEN DO
IF TSPF = 4 THEN ADDRESS COMMAND TCMD ;
IF TSPF = 5 THEN ADDRESS COMMAND TCMD ;
RETURN
END
ELSE DO
TCMD ;
END
RETURN