├── .gitattributes ├── .github └── workflows │ ├── release.yml │ └── test.yml ├── .gitignore ├── .readthedocs.yaml ├── CMakeLists.txt ├── Makefile ├── README ├── README.md ├── asm ├── getsa.hlasm ├── msysx.jcl ├── mvsdump.hlasm ├── rxabend.hlasm ├── rxcpcmd.hlasm ├── rxcputim.hlasm ├── rxestae.hlasm ├── rxikj441.hlasm ├── rxinit.hlasm ├── rxnje38.hlasm ├── rxpdstat.hlasm ├── rxpdstax.hlasm ├── rxsvc.hlasm ├── rxterm.hlasm ├── rxtso.hlasm ├── rxvsam.hlasm ├── rxvsmio1.hlasm ├── rxvsmio2.hlasm ├── svc.hlasm ├── vsmiosub.hlasm ├── vtoc370.hlasm ├── vtocchek.hlasm ├── vtocexcp.hlasm ├── vtocform.hlasm ├── vtocmap.hlasm ├── vtocmsgs.hlasm ├── vtocprnt.hlasm └── vtocsort.hlasm ├── build ├── .gitignore ├── Makefile ├── README.md ├── builder.py ├── dev │ ├── Makefile │ ├── assemble-link.sh │ ├── clean.sh │ ├── install.sh │ ├── jcl │ │ ├── brxbld#1.done.jcl │ │ ├── brxbld#2.done.jcl │ │ ├── brxbld#3.done.jcl │ │ ├── brxbld#4.done.jcl │ │ ├── brxbld#5.nje.jcl │ │ ├── brxbld#6.done.jcl │ │ ├── brxbld#7.done.jcl │ │ └── brxbld#8.done.jcl │ ├── link │ ├── link.sh │ ├── obj │ │ ├── bintree.obj │ │ ├── brxsvc.obj │ │ ├── lstring.obj │ │ ├── printf.obj │ │ └── rxmvsext.obj │ ├── rc.sh │ ├── release.sh │ └── test.sh ├── jcl │ ├── $$README.template │ ├── $CLEANUP.template │ ├── $CREKEYV.template │ ├── $INSTALL.template │ ├── $INSTAPF.template │ ├── $TESTRX.template │ └── $UNPACK.template ├── rxmvsext.nam └── templates │ ├── README.md │ ├── asmfcl.template │ ├── asmfcl_alternate.template │ ├── brexx_link.template │ ├── clean.template │ ├── clean_linklib.template │ ├── copy.template │ ├── deletepds.template │ ├── install.template │ ├── irxexcom_link.template │ ├── irxvtoc_assemble.template │ ├── irxvtoc_link.template │ ├── jobcard.template │ ├── maclib.template │ ├── metal.template │ ├── newpds.template │ ├── nje38.template │ ├── pdsload_new.template │ ├── punchcard.template │ ├── readme.template │ ├── release.template │ ├── rxmvsext.template │ ├── temp_obj.template │ ├── tests.template │ └── unxmit.template ├── cmdlib ├── EOT.clist ├── LA.clist ├── NJE38DIR.clist ├── README.md ├── REPL.cllst ├── REXXTRY.clist ├── TODAY.clist ├── TT.clist ├── USERS.clist ├── WHO.clist └── WHOAMI.clist ├── cross ├── jccdummy.c └── jccdummy.h ├── doc ├── _static │ ├── _sphinx_javascript_frameworks_compat.js │ └── jquery.js ├── added.md ├── application.md ├── array.md ├── brexx370.png ├── brexx370.svg ├── builtin.md ├── calling.md ├── compound.md ├── dataset.md ├── debugging.md ├── expressions.md ├── external_function.md ├── fss.md ├── global.md ├── index.md ├── installation.md ├── instructions.md ├── key_value.md ├── migration.md ├── mvs.md ├── readme.md ├── restrictions.md ├── rxlib.md ├── special.md ├── tcpip.md ├── templates.md ├── tokens_and_terms.md ├── tso.md ├── tso_commands.md └── vsam.md ├── docs ├── Makefile ├── README.md ├── make.bat ├── requirements.txt └── source │ ├── _static │ └── brexx370.png │ ├── added.rst │ ├── application.rst │ ├── array.rst │ ├── builtin.rst │ ├── calling.rst │ ├── compound.rst │ ├── conf.py │ ├── cover.tmpl │ ├── cover.yaml │ ├── dataset.rst │ ├── debugging.rst │ ├── expressions.rst │ ├── external_function.rst │ ├── fss.rst │ ├── global.rst │ ├── index.rst │ ├── installation.rst │ ├── instructions.rst │ ├── key_value.rst │ ├── migration.rst │ ├── mvs.rst │ ├── readme.rst │ ├── restrictions.rst │ ├── rxlib.rst │ ├── special.rst │ ├── style.yaml │ ├── tcpip.rst │ ├── templates.rst │ ├── tokens_and_terms.rst │ ├── tso.rst │ ├── tso_commands.rst │ └── vsam.rst ├── dynit ├── dynit.c ├── dynit.h ├── svc99.c └── svc99.h ├── fss ├── fss.c └── fss.h ├── inc ├── addrlink.h ├── bintree.h ├── bmem.h ├── compile.h ├── config.h ├── dqueue.h ├── external.h ├── hostcmd.h ├── hostenv.h ├── interpre.h ├── irx.h ├── ldefs.h ├── lerror.h ├── lmvs.h ├── lstring.h ├── mvssup.h ├── nextsymb.h ├── os.h ├── preload.h ├── rexx.h ├── rxconio.h ├── rxdefs.h ├── rxexecio.h ├── rxfss.h ├── rxmvs.h ├── rxmvsext.h ├── rxnje.h ├── rxrac.h ├── rxregex.h ├── rxtcp.h ├── rxtso.h ├── rxvsamio.h ├── sarray.h ├── stack.h ├── systemx.h ├── trace.h ├── util.h └── variable.h ├── irx ├── irxexcom.c ├── irxinit.c └── irxsay.c ├── jcl ├── DATE#B.jcl ├── DUMP#T.jcl ├── ETIME#T.jcl ├── PDSDIR#T.jcl ├── PL1CUT.jcl ├── PL1PI.jcl ├── RXMSG#T.jcl ├── SORT#T.jcl ├── STEM#T.jcl ├── STUDENTC.jcl ├── STUDENTI.jcl ├── STUDENTK.jcl ├── STUDENTN.jcl ├── TESTRX.jcl ├── VERSIO#T.jcl ├── WAIT#T.jcl └── WTO#T.jcl ├── lib ├── RexxFormat.r ├── complex.r ├── dates.r ├── ebcdic.r ├── editline.r ├── files.r ├── math.r ├── pslib.r └── veclib.r ├── lstring ├── abbrev.c ├── abs.c ├── add.c ├── b2x.c ├── bitand.c ├── bitor.c ├── bitxor.c ├── bool.c ├── c2d.c ├── c2x.c ├── center.c ├── changest.c ├── charin.c ├── charout.c ├── chars.c ├── compare.c ├── copies.c ├── countstr.c ├── d2c.c ├── d2p.c ├── d2x.c ├── datatype.c ├── date.c ├── dec.c ├── delstr.c ├── delword.c ├── div.c ├── equal.c ├── errortxt.c ├── expose.c ├── filter.c ├── format.c ├── hashvalu.c ├── inc.c ├── index.c ├── insert.c ├── intdiv.c ├── justify.c ├── lastpos.c ├── linein.c ├── lineout.c ├── lines.c ├── lmath.c ├── lower.c ├── lstring.c ├── mod.c ├── mult.c ├── neg.c ├── overlay.c ├── p2d.c ├── print.c ├── read.c ├── reradix.c ├── reverse.c ├── right.c ├── round.c ├── sign.c ├── soundex.c ├── space.c ├── stderr.c ├── strip.c ├── sub.c ├── substr.c ├── subword.c ├── time.c ├── translat.c ├── trunc.c ├── upper.c ├── verify.c ├── word.c ├── wordidx.c ├── wordlen.c ├── wordpos.c ├── words.c ├── write.c ├── x2b.c ├── x2c.c ├── x2d.c └── xrange.c ├── maclib ├── #CLEAR.hlasm ├── #ENVCTX.hlasm ├── ARG.hlasm ├── BIN2CHR.hlasm ├── BIN2PAK.hlasm ├── BLANK.hlasm ├── CONC.hlasm ├── DUMPIT.hlasm ├── EDT.hlasm ├── ENTER.hlasm ├── EPILOG.hlasm ├── EXMVC.hlasm ├── FORMAT.hlasm ├── HAL.hlasm ├── LADR.hlasm ├── LEAVE.hlasm ├── MOVCMT.hlasm ├── MOVE.hlasm ├── MPOUTVAR.hlasm ├── MRXEXIT.hlasm ├── MRXREGS.hlasm ├── MRXSTART.hlasm ├── MVA.hlasm ├── OPER.hlasm ├── OPERLIST.hlasm ├── PPROC.hlasm ├── PROLOG.hlasm ├── README.md ├── REGISTER.hlasm ├── REGOP.hlasm ├── REGS.hlasm ├── REQU.hlasm ├── RPFCOMM.hlasm ├── RXGET.hlasm ├── RXPGCALL.hlasm ├── RXPGNAME.hlasm ├── RXPUT.hlasm ├── SHVCB.hlasm ├── SRETURN.hlasm ├── STRLC.hlasm ├── TLINE.hlasm ├── TPT.hlasm ├── VSAMIO.hlasm ├── VTCALL.hlasm ├── VTCALLOC.hlasm ├── VTCCOM.hlasm ├── VTCDYNSP.hlasm ├── VTCENTER.hlasm ├── VTCFMT.hlasm ├── VTCFREE.hlasm ├── VTCLEAVE.hlasm ├── VTCMSG.hlasm ├── VTCPARS.hlasm ├── VTCPDEDS.hlasm ├── VTCS99NG.hlasm ├── VTOCMSG.hlasm ├── WORKAREA.hlasm ├── WORKEND.hlasm └── WTOV.hlasm ├── map ├── CREDITS ├── LICENSE ├── README.md ├── hashing.c ├── hashing.h ├── hashmap.c ├── hashmap.h ├── list.c └── list.h ├── metal ├── metal.c └── metal.h ├── printf ├── CREDITS ├── LICENSE ├── printf.c └── printf.h ├── proclib ├── README.md ├── RX2ASM.jcl ├── RXBATCH.jcl └── RXTSO.jcl ├── progs ├── 3dplot.r ├── NewFunc.rexx ├── banner.r ├── block.r ├── buffer.r ├── buzzword.r ├── code.r ├── factorial.r ├── int.r ├── qt.r └── rexxcps.r ├── rac ├── rac.c └── rac.h ├── regex ├── CREDITS ├── LICENSE ├── re.c └── re.h ├── rxlib ├── BUILD.REXX ├── DAYSBETW.rexx ├── DBPROF.rexx ├── DCL.rexx ├── DCLO.rexx ├── DSHAPI.rexx ├── DSHHDR.rexx ├── DSHHDR2.rexx ├── DSHHDR3.rexx ├── DSHINFO.rexx ├── DSHMTT.rexx ├── DSHPOP1.rexx ├── DSHREGN.rexx ├── DSHSMSG.rexx ├── DSHTIME.rexx ├── DSHTSO.rexx ├── DSHUSER.rexx ├── DUMP.rexx ├── FMTBANNR.rexx ├── FMTCOLUM.rexx ├── FMTLIST.rexx ├── FMTLISTC.rexx ├── FMTMENU.rexx ├── FMTMON.rexx ├── FMTMONAR.rexx ├── FMTMONX.rexx ├── FSSAPI.rexx ├── FSSCREEN.rexx ├── FSSDASH.rexx ├── FSSMENU.rexx ├── FSSTICKY.rexx ├── GCD.rexx ├── JESQUEUE.rexx ├── KEYVALUE.rexx ├── LCM.rexx ├── LISTALC.rexx ├── LISTCAT.rexx ├── LSTALL.rexx ├── LSTNCAT.rexx ├── MATIN.rexx ├── MCOREL.rexx ├── MPRINT.rexx ├── MTTLOG.rexx ├── MTTSCAN.rexx ├── MVSCBS.rexx ├── NJE38CMD.rexx ├── NJE38DIR.rexx ├── NJE38DSN.rexx ├── PDSDIR.rexx ├── PDSHASH.rexx ├── PDSRESET.rexx ├── PERFORM.rexx ├── PFACTOR.rexx ├── PRINT.rexx ├── PRTBANNR.rexx ├── QUOTE.rexx ├── READALL.rexx ├── README.md ├── REGRESSN.rexx ├── RXCONSOL.rexx ├── RXCOPY.rexx ├── RXDATE.rexx ├── RXDIFF.rexx ├── RXISPF.rexx ├── RXMSG.rexx ├── RXMSGCUS.rexx ├── RXSORT.rexx ├── SECTIMEO.rexx ├── SETHDR.rexx ├── SETHDR2.rexx ├── SETHDR3.rexx ├── SETINFO.rexx ├── SETPOP1.rexx ├── SETSMSG.rexx ├── SGLDSI.rexx ├── SGPDSLSX.rexx ├── SGSYS1.rexx ├── SHUTD.rexx ├── SORTCOPY.rexx ├── STARG2MV.rexx ├── STARGATE.rexx ├── STARGDLI.rexx ├── STARGFSS.rexx ├── STARGLCT.rexx ├── STARGMEN.rexx ├── STARGRCF.rexx ├── STARGSEL.rexx ├── STARGSL2.rexx ├── STARGSL3.rexx ├── STARGSND.rexx ├── STARGSPL.rexx ├── STARGSUB.rexx ├── STARGSYS.rexx ├── STDASH.rexx ├── STDATE.rexx ├── STEMCLEN.rexx ├── STEMGET.rexx ├── STEMINS.rexx ├── STEMPUT.rexx ├── STEMREOR.rexx ├── STICKY.rexx ├── STICKYDF.rexx ├── STICKYDS.rexx ├── STICKYSH.rexx ├── STMTT.rexx ├── STREGION.rexx ├── STSMSG.rexx ├── STTIME.rexx ├── STTSO.rexx ├── STUSER.rexx ├── TCPSF.rexx ├── TODAY.rexx ├── TSOUSERS.rexx ├── UNQUOTE.rexx └── WRITEALL.rexx ├── samples ├── #BROWSE.rexx ├── #FSS1COL.rexx ├── #FSS2COL.rexx ├── #FSS3COL.rexx ├── #FSS4CLX.rexx ├── #FSS4COL.rexx ├── #LOGON.rexx ├── #SELMEM.rexx ├── #TSOAPPL.rexx ├── #VSAMDAT.rexx ├── $ABEND.rexx ├── $DATE.rexx ├── $DATETIM.rexx ├── $DSINFO.rexx ├── $DSORG.rexx ├── $ETIME.rexx ├── $PDSDIR.rexx ├── $RXMSG.rexx ├── $RXSORT.rexx ├── $TCPSERV.rexx ├── $VERSION.rexx ├── $WAIT.rexx ├── $WTO.rexx ├── @STUDENI.rexx ├── @STUDENK.rexx ├── @STUDENL.rexx ├── @STUDENN.rexx ├── AFLOAT.rexx ├── AINT.rexx ├── ALLCHARS.rexx ├── ANIMAL.rexx ├── AWARI.rexx ├── BANNER.rexx ├── BASE64.rexx ├── BLOCK.rexx ├── BUFFER.rexx ├── BUILD.REXX ├── BUZZWORD.rexx ├── CITIES.rexx ├── CODE.rexx ├── CONSOLE.rexx ├── CORELT.rexx ├── COUNTRY.rexx ├── DATE#T.rexx ├── DBWORLD.rexx ├── DIFFT.rexx ├── EOT.rexx ├── FACTRIAL.rexx ├── FIFO.rexx ├── FMTOPBOT.rexx ├── FORMULA.rexx ├── FSVR.rexx ├── GETCMT.rexx ├── HOUSING.rexx ├── HOUSING2.rexx ├── HTTPD.rexx ├── IPLDATE.rexx ├── JES2.rexx ├── JESQUEUE.rexx ├── JESVIEW.rexx ├── KCOUNTRY.rexx ├── KVSAMP1.rexx ├── LIFO.rexx ├── LISTALC.rexx ├── LISTALL.rexx ├── LISTNCAT.rexx ├── LL2STEM.rexx ├── LLCOPY.rexx ├── LLDATA.rexx ├── LLDEL.rexx ├── LLREAD.rexx ├── LLSETX.rexx ├── LLSORT.rexx ├── LLSORT2.rexx ├── LLTEMP.rexx ├── LOCATE.REXX ├── LOCPAN.REXX ├── LOCRPT.REXX ├── LSELECT.rexx ├── LSTVOL.rexx ├── LVOLMVS.REXX ├── LVOLUME.rexx ├── LVTOC.rexx ├── MONDAY.rexx ├── MTT.rexx ├── MTTSCANT.rexx ├── MTTSTOP.rexx ├── NJECMD.rexx ├── PLOT3D.rexx ├── POETRY.rexx ├── PRIMES.rexx ├── QT.rexx ├── README.md ├── REGRESST.rexx ├── REPL.rexx ├── REXXCPS.rexx ├── REXXTRY.rexx ├── S2HASH.rexx ├── S2STEM.rexx ├── SAPPEND.rexx ├── SCHANGE.rexx ├── SDROP.rexx ├── SGENTRY.rexx ├── SGSTART.rexx ├── SGTCPLST.rexx ├── SINPLOT.rexx ├── SKEEP.rexx ├── SKEEPAND.rexx ├── SNUMBER.rexx ├── SSEARCH.rexx ├── SSELECT.rexx ├── SSORT.rexx ├── SSUBSTR.rexx ├── STARDATE.rexx ├── STEM2LL.rexx ├── STEM2SX.rexx ├── SUNDARAM.rexx ├── TB.rexx ├── WHO.rexx ├── WHOAMI.rexx └── XMAS.rexx ├── smf ├── smf.c └── smf.h ├── src ├── address.c ├── addrlink.c ├── bintree.c ├── bmem.c ├── brexx.c ├── builtin.c ├── compile.c ├── dqueue.c ├── error.c ├── expr.c ├── external.c ├── hostcmd.c ├── hostenv.c ├── interpre.c ├── mvssup.c ├── nextsymb.c ├── preload.c ├── rexx.c ├── rexxfunc.c ├── rxconv.c ├── rxexecio.c ├── rxfiles.c ├── rxfss.c ├── rxmath.c ├── rxmvs.c ├── rxnje.c ├── rxrac.c ├── rxregex.c ├── rxstr.c ├── rxtcp.c ├── rxtso.c ├── rxvsamio.c ├── rxword.c ├── stack.c ├── template.c ├── trace.c ├── util.c └── variable.c └── test ├── README.md ├── abbrev.rexx ├── abs.rexx ├── address.rexx ├── arg.rexx ├── b2x.rexx ├── bifs.not_working ├── bitand.rexx ├── bitor.rexx ├── bitxor.rexx ├── c2d.rexx ├── c2x.rexx ├── center.rexx ├── changes.rexx ├── charin.rexx ├── charout.rexx ├── chars.rexx ├── compare.rexx ├── copies.rexx ├── countst.rexx ├── d2c.rexx ├── d2x.rexx ├── datatyp.rexx ├── date.not_working ├── date.rexx ├── delstr.rexx ├── delword.rexx ├── digits.not_working ├── errorms.rexx ├── errorte.rexx ├── factria.not_working ├── form.rexx ├── format.rexx ├── fuzz.rexx ├── insert.rexx ├── lastpos.rexx ├── left.rexx ├── length.rexx ├── linein.rexx ├── lineout.rexx ├── lines.rexx ├── max.rexx ├── min.rexx ├── overlay.rexx ├── pos.rexx ├── qualify.not_working ├── random.rexx ├── regress.old ├── reverse.rexx ├── right.rexx ├── rxtest.rxlib ├── sign.rexx ├── sourcel.not_working ├── space.rexx ├── strip.rexx ├── substr.rexx ├── subword.rexx ├── symbol.rexx ├── test_one.sh ├── testexc.not_working ├── testfac.not_working ├── tests.sh ├── time.rexx ├── trace.rexx ├── transla.rexx ├── trunc.rexx ├── value.rexx ├── verify.rexx ├── word.rexx ├── wordind.rexx ├── wordlen.rexx ├── wordpos.rexx ├── words.rexx ├── x2b.rexx ├── x2c.rexx ├── x2d.rexx └── xrange.rexx /.gitattributes: -------------------------------------------------------------------------------- 1 | *.sh text eol=lf 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | .idea/ 3 | cmake-build-*/ 4 | tests/ 5 | build/*.obj 6 | build/*.objp 7 | build/*.log 8 | build/*.out 9 | build/*.jcl 10 | docs/build/ 11 | docs/.venv/ 12 | .DS_Store 13 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # Read the Docs configuration file 2 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 3 | 4 | # Required 5 | version: 2 6 | 7 | # Build documentation in the docs/ directory with Sphinx 8 | sphinx: 9 | configuration: docs/source/conf.py 10 | 11 | python: 12 | install: 13 | - requirements: docs/requirements.txt -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # This makefile is a stub. To make changes to the build target or 2 | # to change folders, etc edit the Makefile in ./build 3 | 4 | # The REAMDE.md in ./build contains detailed instructions 5 | # on how to build BREXX 6 | 7 | # Forward targets to build/Makefile 8 | %: 9 | $(MAKE) -C build $@ 10 | 11 | test: 12 | $(MAKE) -C build $@ 13 | 14 | jcl: 15 | $(MAKE) -C build $@ 16 | 17 | # Define a default target to forward to build/Makefile 18 | .DEFAULT_GOAL := all 19 | 20 | .PHONY: test jcl -------------------------------------------------------------------------------- /asm/getsa.hlasm: -------------------------------------------------------------------------------- 1 | GETSA START 0 2 | * 3 | L 15,4(13) 4 | BR 14 5 | * 6 | END GETSA 7 | -------------------------------------------------------------------------------- /asm/rxvsmio1.hlasm: -------------------------------------------------------------------------------- 1 | GBLB &TEST 00000100 2 | &TEST SETB 0 ****** SET TO 1 IF TRACING DESIRED ******** 00000207 3 | COPY VSMIOSUB 00000300 4 | -------------------------------------------------------------------------------- /asm/rxvsmio2.hlasm: -------------------------------------------------------------------------------- 1 | GBLB &TEST 00000100 2 | &TEST SETB 1 ****** SET TO 1 IF TRACING DESIRED ******** 00000200 3 | COPY VSMIOSUB 00000300 4 | -------------------------------------------------------------------------------- /build/.gitignore: -------------------------------------------------------------------------------- 1 | MVSCE/ 2 | mvsce/ 3 | *.punch 4 | *.dummy 5 | *.pdf 6 | *.XMIT 7 | *.xmi 8 | *.zip 9 | *.ZIP 10 | html/ 11 | jcl/$README.txt 12 | *.txt -------------------------------------------------------------------------------- /build/dev/jcl/brxbld#5.nje.jcl: -------------------------------------------------------------------------------- 1 | //BRXBLD#5 JOB (BREXX), 2 | // 'BREXX BUILD STEP#5', 3 | // CLASS=A, 4 | // MSGCLASS=H, 5 | // REGION=8M, 6 | // MSGLEVEL=(1,1) 7 | //******************************************************************** 8 | //* 9 | //* BUILDING BREXX NJE38 SUPPORT ROUTINE - RXNJE38 10 | //* 11 | //******************************************************************** 12 | //* 13 | //ASM EXEC PROC=ASMFCL, 14 | // MAC='SYS1.MACLIB', 15 | // MAC1='BRXBLD.ASM.MACLIB', 16 | // MAC2='SYS2.NJE38.MACLIB', 17 | // SOUT=H 18 | //ASM.SYSIN DD DISP=SHR,DSN=BRXBLD.ASM.SRC(RXNJE38) 19 | //LKED.SYSLMOD DD DISP=SHR,DSN=BRXBLD.LOADLIB(IRXNJE38) 20 | //LKED.SYSLIB1 DD DISP=SHR,DSN=SYS2.LINKLIB 21 | //LKED.SYSLIB2 DD DISP=SHR,DSN=SYS2.NJE38.AUTHLIB 22 | //LKED.SYSIN DD * 23 | INCLUDE SYSLIB2(NJESPOOL) 24 | /* 25 | // 26 | -------------------------------------------------------------------------------- /build/dev/jcl/brxbld#7.done.jcl: -------------------------------------------------------------------------------- 1 | //BRXBLD#7 JOB (BREXX), 2 | // 'BREXX BUILD STEP#7', 3 | // CLASS=A, 4 | // MSGCLASS=H, 5 | // REGION=8M, 6 | // NOTIFY=&SYSUID, 7 | // MSGLEVEL=(1,1) 8 | //******************************************************************** 9 | //* 10 | //* BUILDING BREXX PDSSTAT SUPPORT ROUTINE - RXPDSTAT 11 | //* 12 | //******************************************************************** 13 | //* 14 | //ASM EXEC PROC=ASMFCL, 15 | // MAC='SYS1.MACLIB', 16 | // MAC1='BRXBLD.ASM.MACLIB', 17 | // SOUT=H 18 | //ASM.SYSIN DD DISP=SHR,DSN=BRXBLD.ASM.SRC(RXPDSTAT) 19 | //*LKED.SYSLMOD DD DISP=SHR,DSN=BRXBLD.LOADLIB(IRXISTAT) 20 | //LKED.SYSLMOD DD DISP=SHR,DSN=SYS2.LINKLIB(IRXISTAT) 21 | // 22 | -------------------------------------------------------------------------------- /build/dev/jcl/brxbld#8.done.jcl: -------------------------------------------------------------------------------- 1 | //BRXBLD#8 JOB (BREXX), 2 | // 'BREXX BUILD STEP#7', 3 | // CLASS=A, 4 | // MSGCLASS=H, 5 | // REGION=8M, 6 | // NOTIFY=&SYSUID, 7 | // MSGLEVEL=(1,1) 8 | //******************************************************************** 9 | //* 10 | //* BUILDING BREXX PDSSTAT SUPPORT ROUTINE - RXPDSTAT 11 | //* 12 | //******************************************************************** 13 | //* 14 | //ASM EXEC PROC=ASMFCL, 15 | // MAC='SYS1.MACLIB', 16 | // MAC1='BRXBLD.ASM.MACLIB', 17 | // SOUT=H 18 | //ASM.SYSIN DD DISP=SHR,DSN=BRXBLD.ASM.SRC(MVSDUMP) 19 | //*LKED.SYSLMOD DD DISP=SHR,DSN=BRXBLD.LOADLIB(IRXISTAT) 20 | //LKED.SYSLMOD DD DISP=SHR,DSN=SYS2.LINKLIB(MVSDUMP) 21 | // 22 | -------------------------------------------------------------------------------- /build/dev/obj/bintree.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvslovers/brexx370/82331e6ceac93d1102ef0e81a565df3d6a154c23/build/dev/obj/bintree.obj -------------------------------------------------------------------------------- /build/dev/obj/brxsvc.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvslovers/brexx370/82331e6ceac93d1102ef0e81a565df3d6a154c23/build/dev/obj/brxsvc.obj -------------------------------------------------------------------------------- /build/dev/obj/lstring.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvslovers/brexx370/82331e6ceac93d1102ef0e81a565df3d6a154c23/build/dev/obj/lstring.obj -------------------------------------------------------------------------------- /build/dev/obj/printf.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvslovers/brexx370/82331e6ceac93d1102ef0e81a565df3d6a154c23/build/dev/obj/printf.obj -------------------------------------------------------------------------------- /build/dev/obj/rxmvsext.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvslovers/brexx370/82331e6ceac93d1102ef0e81a565df3d6a154c23/build/dev/obj/rxmvsext.obj -------------------------------------------------------------------------------- /build/dev/rc.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | # uses JCL to check if all the steps in JCL 3 | # have RC= 0000/0004. If not set return code to 1 4 | J=`head -1 $1|cut -d" " -f1` 5 | 6 | JOBNAME=${J#//} 7 | IFS=$'\n' 8 | proc=false 9 | rc=0 10 | echo "Time Job Num Jobname Stepname Procstep Program Retcode" 11 | for i in `grep ' EXEC \| PROC ' $1|grep -v "//\*"` 12 | do 13 | S=`echo $i|cut -d " " -f1` 14 | STEPNAME=${S#//} 15 | if echo $i | grep -q ' PROC ' ; then 16 | proc=true 17 | continue 18 | fi 19 | if $proc; then 20 | # skip PROC exec statements 21 | proc=false 22 | continue 23 | fi 24 | srch=`printf '%-8s %s' "$JOBNAME" "$STEPNAME"` 25 | status=`grep "$srch" $2|tail -1` 26 | 27 | if [ $? -eq 0 ]; then 28 | if echo $status|grep -q 0000 || echo $status|grep -q 0004; then 29 | echo $status 30 | else 31 | echo $status "<==== error" 32 | rc=1 33 | fi 34 | else 35 | echo "$JOBNAME $STEPNAME not found in $2" 36 | rc=1 37 | fi 38 | done 39 | exit $rc 40 | -------------------------------------------------------------------------------- /build/jcl/$$README.template: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------ 2 | Library BREXX.{HLQ}.INSTALL generated 3 | on: {date} 4 | at: {time} 5 | by: {builder} 6 | ------------------------------------------------------------ -------------------------------------------------------------------------------- /build/jcl/$CLEANUP.template: -------------------------------------------------------------------------------- 1 | //BRXXCLEN JOB (BREXX),'BREXX CLEANUP',CLASS=A, 2 | // MSGCLASS=H,MSGLEVEL=(0,0),NOTIFY={SYSUID} 3 | //* 4 | //*RELEASE SET '{version}' 5 | //* ... BREXX Version {version} Build Date {date} 6 | //* ... INSTALLER DATE {date} 7 | //* ---------------------------------------------------------------- 8 | //* REMOVE INSTALLATION FILES, WHICH ARE COPIES TO SYS2. LIBRARIES 9 | //* ---------------------------------------------------------------- 10 | //TSOBTCH EXEC PGM=IKJEFT01,REGION=8192K 11 | //SYSTSPRT DD SYSOUT=* 12 | //SYSTSIN DD * 13 | DELETE BREXX.{HLQ}.LINKLIB 14 | DELETE BREXX.{HLQ}.APF.LINKLIB 15 | DELETE BREXX.{HLQ}.APFLLIB 16 | DELETE BREXX.{HLQ}.PROCLIB 17 | DELETE BREXX.{HLQ}.RXLIB 18 | DELETE BREXX.{HLQ}.JCL 19 | DELETE BREXX.{HLQ}.CMDLIB 20 | DELETE BREXX.{HLQ}.SAMPLES 21 | LISTCAT 22 | //* -------------------------------------------------------------------------------- /build/jcl/$INSTALL.template: -------------------------------------------------------------------------------- 1 | //BRXXINST JOB (BREXX),'INSTALL LIBS',CLASS=A, 2 | // MSGCLASS=H,NOTIFY={SYSUID} 3 | //* 4 | //*RELEASE SET '{version}' 5 | //* ... BREXX Version {version} Build Date {date} 6 | //* ... INSTALLER DATE {date} 7 | //* ------------------------------------------------------------------ 8 | //* COPY BREXX MODULE(S) INTO SYS2.LINKLIB 9 | //* ------------------------------------------------------------------ 10 | //STEP10 EXEC PGM=IEBCOPY 11 | //SYSPRINT DD SYSOUT=* 12 | //DDIN DD DSN=BREXX.{HLQ}.LINKLIB,DISP=SHR 13 | //DDOUT DD DSN=SYS2.LINKLIB,DISP=SHR 14 | //SYSIN DD * 15 | COPY INDD=((DDIN,R)),OUTDD=DDOUT 16 | /* 17 | //* ------------------------------------------------------------------ 18 | //* COPY BREXX MODULE(S) INTO SYS2.PROCLIB 19 | //* ------------------------------------------------------------------ 20 | //STEP20 EXEC PGM=IEBCOPY 21 | //SYSPRINT DD SYSOUT=* 22 | //DDIN DD DSN=BREXX.{HLQ}.PROCLIB,DISP=SHR 23 | //DDOUT DD DSN=SYS2.PROCLIB,DISP=SHR 24 | //SYSIN DD * 25 | COPY INDD=((DDIN,R)),OUTDD=DDOUT 26 | /* -------------------------------------------------------------------------------- /build/jcl/$INSTAPF.template: -------------------------------------------------------------------------------- 1 | //BRXXINST JOB (BREXX),'INSTALL LIBS',CLASS=A, 2 | // MSGCLASS=H,NOTIFY={SYSUID} 3 | //* 4 | //* ------------------------------------------------------------------ 5 | //* COPY BREXX MODULE(S) INTO SYS2.LINKLIB 6 | //* ------------------------------------------------------------------ 7 | //STEP10 EXEC PGM=IEBCOPY 8 | //SYSPRINT DD SYSOUT=* 9 | //DDIN DD DSN=BREXX.{version}.APFLLIB,DISP=SHR 10 | //DDOUT DD DSN=SYS2.LINKLIB,DISP=SHR 11 | //SYSIN DD * 12 | COPY INDD=((DDIN,R)),OUTDD=DDOUT 13 | /* 14 | //* ------------------------------------------------------------------ 15 | //* COPY BREXX MODULE(S) INTO SYS2.PROCLIB 16 | //* ------------------------------------------------------------------ 17 | //STEP20 EXEC PGM=IEBCOPY 18 | //SYSPRINT DD SYSOUT=* 19 | //DDIN DD DSN=BREXX.{HLQ}.PROCLIB,DISP=SHR 20 | //DDOUT DD DSN=SYS2.PROCLIB,DISP=SHR 21 | //SYSIN DD * 22 | COPY INDD=((DDIN,R)),OUTDD=DDOUT 23 | /* -------------------------------------------------------------------------------- /build/rxmvsext.nam: -------------------------------------------------------------------------------- 1 | RXIKJ441 call_rxikj441 2 | RXABEND call_rxabend 3 | RXINIT call_rxinit 4 | RXTERM call_rxterm 5 | RXVSAM call_rxvsam 6 | RXTSO call_rxtso 7 | RXSVC call_rxsvc 8 | RXCPUTIM cputime 9 | RXCPCMD systemCP 10 | RXSETJMP _setjmp_estae 11 | RXECANC _setjmp_ecanc -------------------------------------------------------------------------------- /build/templates/README.md: -------------------------------------------------------------------------------- 1 | BREXX Build Engine Templates 2 | ============================ 3 | 4 | The files in this folder are used by the /build/build.py script. 5 | 6 | Do see what JCL is generated by the various steps you can run `make jcl` 7 | which will generate a copy of the JCL used by every step in the Makefile. -------------------------------------------------------------------------------- /build/templates/asmfcl.template: -------------------------------------------------------------------------------- 1 | //{module} EXEC PROC=ASMFCL 2 | //ASM.SYSLIB DD DSN=SYS2.MACLIB,DISP=SHR 3 | // DD DSN=&&MACLIB,DISP=(MOD,PASS) 4 | // DD DSN=&&ASMMAC,DISP=(MOD,PASS) 5 | // DD DSN=SYS1.MACLIB,DISP=SHR 6 | //ASM.SYSPUNCH DD DUMMY 7 | //ASM.SYSIN DD DATA,DLM=@@ 8 | {source} 9 | @@ 10 | //LKED.SYSLMOD DD DISP=SHR,DSN=BREXX.BUILD.LOADLIB({module}) -------------------------------------------------------------------------------- /build/templates/asmfcl_alternate.template: -------------------------------------------------------------------------------- 1 | //{module} EXEC PROC=ASMFCL 2 | //ASM.SYSLIB DD DSN=SYS1.MACLIB,DISP=SHR 3 | // DD DSN=&&MACLIB,DISP=(MOD,PASS) 4 | //ASM.SYSPUNCH DD DUMMY 5 | //ASM.SYSIN DD DATA,DLM=@@ 6 | {source} 7 | @@ 8 | //LKED.SYSLMOD DD DISP=SHR,DSN=SYS2.LINKLIB({module}) -------------------------------------------------------------------------------- /build/templates/clean.template: -------------------------------------------------------------------------------- 1 | //* ------------------------------------------------------------------ 2 | //* CLEAN UP DATASETS 3 | //* ------------------------------------------------------------------ 4 | //* 5 | //{stepname} EXEC PGM=IDCAMS,REGION=1024K 6 | //SYSPRINT DD SYSOUT=A 7 | //SYSIN DD * 8 | DELETE {dsname1} NONVSAM SCRATCH PURGE 9 | /* IF THERE WAS NO DATASET TO DELETE, RESET CC */ 10 | IF LASTCC = 8 THEN 11 | DO 12 | SET LASTCC = 0 13 | SET MAXCC = 0 14 | END 15 | -------------------------------------------------------------------------------- /build/templates/clean_linklib.template: -------------------------------------------------------------------------------- 1 | //RXDLLIB EXEC PGM=IKJEFT01,REGION=8192K 2 | //SYSTSPRT DD SYSOUT=* 3 | //SYSTSIN DD * 4 | DELETE 'SYS2.LINKLIB(BREXX)' 5 | DELETE 'SYS2.LINKLIB(REXX)' 6 | DELETE 'SYS2.LINKLIB(RX)' 7 | COMPRESS 'SYS2.LINKLIB' 8 | /* -------------------------------------------------------------------------------- /build/templates/copy.template: -------------------------------------------------------------------------------- 1 | //* ------------------------------------------------------------------ 2 | //* COPY BREXX MODULE(S) INTO {outdsn} 3 | //* ------------------------------------------------------------------ 4 | //COPYALL EXEC PGM=IEBCOPY 5 | //SYSPRINT DD SYSOUT=* 6 | //DDIN DD DSN={indsn},DISP=SHR 7 | //DDOUT DD DSN={outdsn},DISP=SHR 8 | //SYSIN DD * 9 | COPY INDD=((DDIN,R)),OUTDD=DDOUT 10 | /* 11 | -------------------------------------------------------------------------------- /build/templates/deletepds.template: -------------------------------------------------------------------------------- 1 | //DELETE EXEC PGM=IEFBR14 2 | //SYSPRINT DD SYSOUT=* 3 | //DELETE DD DSN={dsname}, 4 | // DISP=(OLD,DELETE,DELETE) -------------------------------------------------------------------------------- /build/templates/install.template: -------------------------------------------------------------------------------- 1 | //INSTALL PROC HLQ='BREXX.{current}',HLQ2= 2 | //PDS EXEC PGM=PDSLOAD 3 | //* 4 | //* Either SYSC.LINKLIB for MVS/CE or SYS2.LINKLIB for TK4-/TK5 5 | //* 6 | //STEPLIB DD DSN={steplib},DISP=SHR 7 | //SYSPRINT DD SYSOUT=* 8 | //SYSUT2 DD DSN=&HLQ..&HLQ2, 9 | // UNIT={unit},VOL=SER={volser}, 10 | // SPACE=(TRK,(20,50,25),RLSE), 11 | // DISP=(NEW,CATLG,DELETE) 12 | //SYSUT1 DD DUMMY 13 | // PEND 14 | //* ------------------------------------------------------------------ 15 | //* Install the various libraries 16 | //* ------------------------------------------------------------------ 17 | //PROCLIB EXEC INSTALL,HLQ2=PROCLIB 18 | //PDS.SYSUT1 DD DATA,DLM=@@ 19 | {proclib} 20 | @@ 21 | //JCL EXEC INSTALL,HLQ2=JCL 22 | //PDS.SYSUT1 DD DATA,DLM=@@ 23 | {jcl} 24 | @@ 25 | //SAMPLES EXEC INSTALL,HLQ2=SAMPLES 26 | //PDS.SYSUT1 DD DATA,DLM=@@ 27 | {samples} 28 | @@ 29 | //RXLIB EXEC INSTALL,HLQ2=RXLIB 30 | //PDS.SYSUT1 DD DATA,DLM=@@ 31 | {rxlib} 32 | @@ 33 | //CMDLIB EXEC INSTALL,HLQ2=CMDLIB 34 | //PDS.SYSUT1 DD DATA,DLM=@@ 35 | {cmdlib} 36 | @@ -------------------------------------------------------------------------------- /build/templates/irxexcom_link.template: -------------------------------------------------------------------------------- 1 | //* 2 | //* link the final IRXEXCOM module 3 | //* 4 | //* WARNING: This is is rdrprep template 5 | //* 6 | //LKED EXEC PGM=IEWL,PARM='NCAL,MAP,LIST,XREF,NORENT' 7 | //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(5,2)) 8 | //SYSPRINT DD SYSOUT=* 9 | //SYSPUNCH DD SYSOUT=* 10 | //OBJECT DD DATA,DLM=@@ 11 | ::E {path}/irxexcom.objp 12 | @@ 13 | //METAL DD DATA,DLM=@@ 14 | ::E {path}/metal.objp 15 | @@ 16 | //SYSLMOD DD DSN=BREXX.BUILD.LOADLIB(IRXEXCOM),DISP=SHR 17 | //SYSLIN DD * 18 | INCLUDE OBJECT 19 | INCLUDE METAL 20 | ENTRY IRXEXCOM 21 | NAME IRXEXCOM(R) 22 | /* -------------------------------------------------------------------------------- /build/templates/irxvtoc_assemble.template: -------------------------------------------------------------------------------- 1 | //* ------------------------------------------------------- 2 | //* BUILDING BREXX VTOC ACCESS ROUTINE - IRXVTOC 3 | //* BUILDING - {module} 4 | //* ------------------------------------------------------- 5 | //{module} EXEC PGM=IFOX00,REGION=1000K,PARM='TEST,RENT,NOOBJ,DECK' 6 | //SYSLIB DD DSN=&&{asm_maclib},DISP=(OLD,PASS),DCB=BLKSIZE=32720 7 | // DD DSN=SYS1.MACLIB,DISP=SHR,DCB=BLKSIZE=32720 8 | // DD DSN=SYS1.AMODGEN,DISP=SHR 9 | // DD DSN=&&{maclib},DISP=(OLD,PASS) 10 | //SYSUT1 DD DSN=&&SYSUT1,UNIT=VIO,SPACE=(1700,(600,100)) 11 | //SYSUT2 DD DSN=&&SYSUT2,UNIT=VIO,SPACE=(1700,(300,50)) 12 | //SYSUT3 DD DSN=&&SYSUT3,UNIT=VIO,SPACE=(1700,(300,50)) 13 | //SYSPUNCH DD DISP=(OLD,PASS),DSN=&&OBJECT({module}) 14 | //SYSPRINT DD SYSOUT=* 15 | //SYSIN DD DATA,DLM=@@ 16 | {source} 17 | @@ 18 | -------------------------------------------------------------------------------- /build/templates/irxvtoc_link.template: -------------------------------------------------------------------------------- 1 | //* ------------------------------------------------------- 2 | //* LINKEDIT IRXVTOC COMMAND 3 | //* ------------------------------------------------------- 4 | //VTOCLINK EXEC PGM=IEWL,REGION=1000K, 5 | // PARM='RENT,REUS,REFR,LIST,XREF,SIZE=(512K,96K)' 6 | //OBJ DD DISP=(OLD,PASS),DSN=&&OBJECT 7 | //SYSLMOD DD DISP=SHR,DSN=BREXX.BUILD.LOADLIB 8 | //SYSUT1 DD UNIT=SYSDA,SPACE=(TRK,(10,10)) 9 | //SYSPRINT DD SYSOUT=* 10 | //SYSLIN DD * 11 | {objects} 12 | ENTRY VTOCCMD 13 | NAME IRXVTOC(R) 14 | // -------------------------------------------------------------------------------- /build/templates/jobcard.template: -------------------------------------------------------------------------------- 1 | //{jobname} JOB (BREXX),'{title}', 2 | // CLASS={jclass},MSGCLASS={msgclass}, 3 | // REGION=8M,MSGLEVEL=(1,1),USER={user},PASSWORD={password} 4 | //******************************************************************** -------------------------------------------------------------------------------- /build/templates/maclib.template: -------------------------------------------------------------------------------- 1 | //{temp_name} EXEC PGM=PDSLOAD 2 | //* 3 | //* Either SYSC.LINKLIB for MVS/CE or SYS2.LINKLIB for TK4-/TK5 4 | //* 5 | //STEPLIB DD DSN={steplib},DISP=SHR 6 | //SYSPRINT DD SYSOUT=* 7 | //SYSUT2 DD DSN=&&{temp_name},DISP=(,PASS), 8 | // UNIT=VIO,SPACE=(TRK,(44,14,17)), 9 | // DCB=(RECFM=FB,LRECL=80,BLKSIZE=19040) 10 | //SYSUT1 DD DATA,DLM=@@ 11 | {maclibs} 12 | @@ 13 | -------------------------------------------------------------------------------- /build/templates/metal.template: -------------------------------------------------------------------------------- 1 | //******************************************************************** 2 | //* Assembling {module} 3 | //* 4 | //{module} EXEC ASMFC,PARM.ASM=(OBJ,NODECK) 5 | //ASM.SYSLIB DD DSN=SYS2.MACLIB,DISP=SHR 6 | // DD DSN=SYS1.MACLIB,DISP=SHR 7 | // DD DSN=&&MACLIB,DISP=(MOD,PASS) 8 | //ASM.SYSIN DD DATA,DLM=@@ 9 | {source} 10 | @@ 11 | //******************************************************************** 12 | //* Now to output the temp dataset &&OBJ to Class B which is the 13 | //* punch out (pch00d.txt) 14 | //ASM.SYSGO DD DISP=SHR,DSN=BREXX.BUILD.LOADLIB({module}) 15 | -------------------------------------------------------------------------------- /build/templates/newpds.template: -------------------------------------------------------------------------------- 1 | //******************************************************************** 2 | //{stepname} EXEC PGM=IEFBR14 3 | //LINKLIB DD DSN={dsname1}, 4 | // UNIT={unit},VOL=SER={volser},DISP=(,CATLG), 5 | // SPACE=(TRK,(100,100,10)), 6 | // DCB=(SYS2.LINKLIB) 7 | //******************************************************************** 8 | -------------------------------------------------------------------------------- /build/templates/nje38.template: -------------------------------------------------------------------------------- 1 | //******************************************************************** 2 | //* 3 | //* BUILDING BREXX NJE38 SUPPORT ROUTINE - RXNJE38 4 | //* 5 | //******************************************************************** 6 | //* 7 | //ASM EXEC PROC=ASMFCL, 8 | // SOUT=A 9 | //ASM.SYSLIB DD DSN=SYS1.MACLIB,DISP=SHR 10 | // DD DSN=&&MACLIB,DISP=(MOD,PASS) 11 | // DD DSN=&&ASMMAC,DISP=(MOD,PASS) 12 | // DD DSN={nje_maclib},DISP=SHR 13 | //ASM.SYSIN DD DATA,DLM=@@ 14 | {nje_hlasm} 15 | @@ 16 | //LKED.SYSLMOD DD DISP=SHR,DSN=BREXX.BUILD.LOADLIB(IRXNJE38) 17 | //LKED.SYSLIB1 DD DISP=SHR,DSN=SYS2.LINKLIB 18 | //LKED.SYSLIB2 DD DISP=SHR,DSN={nje_authlib} 19 | //LKED.SYSIN DD * 20 | INCLUDE SYSLIB2(NJESPOOL) 21 | /* 22 | // -------------------------------------------------------------------------------- /build/templates/pdsload_new.template: -------------------------------------------------------------------------------- 1 | //* ------------------------------------------------------------------ 2 | //* DELETE DATASETS IF ALREADY INSTALLED 3 | //* ------------------------------------------------------------------ 4 | //* 5 | //{delname} EXEC PGM=IDCAMS,REGION=1024K 6 | //SYSPRINT DD SYSOUT=A 7 | //SYSIN DD * 8 | DELETE {dsname1} NONVSAM SCRATCH PURGE 9 | /* IF THERE WAS NO DATASET TO DELETE, RESET CC */ 10 | IF LASTCC = 8 THEN 11 | DO 12 | SET LASTCC = 0 13 | SET MAXCC = 0 14 | END 15 | //****************************************************************** 16 | //{create} EXEC PGM=PDSLOAD 17 | //* 18 | //* Either SYSC.LINKLIB for MVS/CE or SYS2.LINKLIB for TK4-/TK5 19 | //* 20 | //STEPLIB DD DSN={steplib},DISP=SHR 21 | //SYSPRINT DD SYSOUT=* 22 | //SYSUT2 DD DSN={dsname1}, 23 | // UNIT={unit},VOL=SER={volser}, 24 | // SPACE=(TRK,(250,250,25),RLSE), 25 | // DISP=(NEW,CATLG,DELETE) 26 | //SYSUT1 DD DATA,DLM=@@ 27 | {rxlibs} 28 | @@ 29 | //****************************************************************** 30 | -------------------------------------------------------------------------------- /build/templates/punchcard.template: -------------------------------------------------------------------------------- 1 | //******************************************************************** 2 | //* Now to output the temp dataset {dsname} to 3 | //* Class B which is the punch out (pch00d.txt) 4 | //PUNCHOUT EXEC PGM=IEBGENER 5 | //SYSIN DD DUMMY 6 | //SYSUT1 DD DSN={dsname},DISP=SHR 7 | //SYSUT2 DD SYSOUT={jes_class} 8 | //SYSPRINT DD SYSOUT=* -------------------------------------------------------------------------------- /build/templates/temp_obj.template: -------------------------------------------------------------------------------- 1 | //******************************************************************** 2 | //ALLOC EXEC PGM=IEFBR14 3 | //SYSLIN DD DISP=(,PASS),DSN=&&{temp_name}, 4 | // DCB=(BLKSIZE=400,LRECL=80,RECFM=FB), 5 | // SPACE=(CYL,(1,1,8),RLSE),UNIT=SYSDA 6 | //******************************************************************** 7 | -------------------------------------------------------------------------------- /build/templates/unxmit.template: -------------------------------------------------------------------------------- 1 | //* ------------------------------------------------------------ 2 | //* RECEIVE XMIT FILE AND CREATE DSN OR PDS 3 | //* ------------------------------------------------------------ 4 | //RECV370 EXEC PGM=RECV370,REGION=8192K{steplib} 5 | //RECVLOG DD SYSOUT=* 6 | //XMITIN DD DATA,DLM=@$ 7 | ::E {brexx_filename} 8 | @$ 9 | //SYSPRINT DD SYSOUT=* 10 | //SYSUT1 DD DSN=&&XMIT2, 11 | // UNIT={unit},VOL=SER={volser}, 12 | // SPACE=(TRK,(300,60)), 13 | // DISP=(NEW,DELETE,DELETE) 14 | //SYSUT2 DD DSN=BREXX.{HLQ}.INSTALL, 15 | // UNIT={unit},VOL=SER={volser}, 16 | // SPACE=(TRK,(300,60,20)), 17 | // DISP=(NEW,CATLG,CATLG) 18 | //SYSIN DD DUMMY 19 | -------------------------------------------------------------------------------- /cmdlib/EOT.clist: -------------------------------------------------------------------------------- 1 | RX EOT NOSTAE 2 | -------------------------------------------------------------------------------- /cmdlib/LA.clist: -------------------------------------------------------------------------------- 1 | REXX - +00000100 2 | CALL LISTALC('PRINT') 00000200 3 | -------------------------------------------------------------------------------- /cmdlib/NJE38DIR.clist: -------------------------------------------------------------------------------- 1 | REXX - + 2 | CALL NJE38DIR 3 | -------------------------------------------------------------------------------- /cmdlib/README.md: -------------------------------------------------------------------------------- 1 | BREXX/370 TSO Command Library 2 | ============================= 3 | 4 | This folder contains TSO CLISTs that demontrate how to use REXX scripts 5 | as TSO commands. 6 | -------------------------------------------------------------------------------- /cmdlib/REPL.cllst: -------------------------------------------------------------------------------- 1 | RX REPL NOSTAE 2 | -------------------------------------------------------------------------------- /cmdlib/REXXTRY.clist: -------------------------------------------------------------------------------- 1 | RX REXXTRY NOSTAE 2 | -------------------------------------------------------------------------------- /cmdlib/TODAY.clist: -------------------------------------------------------------------------------- 1 | REXX - SAY DATE(); SAY TIME() 2 | -------------------------------------------------------------------------------- /cmdlib/TT.clist: -------------------------------------------------------------------------------- 1 | RX MTT 2 | -------------------------------------------------------------------------------- /cmdlib/USERS.clist: -------------------------------------------------------------------------------- 1 | RX WHO 2 | -------------------------------------------------------------------------------- /cmdlib/WHO.clist: -------------------------------------------------------------------------------- 1 | RX WHO 2 | -------------------------------------------------------------------------------- /cmdlib/WHOAMI.clist: -------------------------------------------------------------------------------- 1 | REXX - +00000108 2 | SAY USERID() 00000208 3 | -------------------------------------------------------------------------------- /doc/brexx370.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvslovers/brexx370/82331e6ceac93d1102ef0e81a565df3d6a154c23/doc/brexx370.png -------------------------------------------------------------------------------- /doc/compound.md: -------------------------------------------------------------------------------- 1 | # Compound Variable Names 2 | 3 | **name** may be “compound” in that it may be composed of several parts 4 | (separated by periods) some of which may have variable values. The parts 5 | are then substituted independently, to generate a fully resolved name. 6 | In general, 7 | 8 | ```rexx 9 | s0.s1.s2.---.sn /* is substituted to form */ 10 | d0.v1.v2.---.vn /* where d0 is uppercase of s0, and 11 | v1-vn are values of s1-sn */ 12 | ``` 13 | 14 | This facility may be used for traditional arrays, content-addressable 15 | arrays, and other indirect addressing modes. As an example, the 16 | sequence: 17 | 18 | ```rexx 19 | J = 5 20 | a.j = "fred" 21 | ``` 22 | 23 | would assign fred to the variable A.5. 24 | 25 | The stem of name (i.e. that part up to and including the first “.”) may 26 | be specified on the DROP and PROCEDURE EXPOSE instructions and 27 | affect all variables starting with that stem. An assignment to a stem 28 | assigns the new value to all possible variables with that stem. 29 | -------------------------------------------------------------------------------- /doc/debugging.md: -------------------------------------------------------------------------------- 1 | # Interactive Debugging 2 | 3 | You can enter the interactive debuging either by executing a TRACE 4 | instruction with a prefix ‘?’ or when calling REXX from command line 5 | issuing as a first argument the trace option: 6 | 7 | rexx ‘?A’ ‘HLQ.DATASET(MEMBER)’ 8 | 9 | In interactive debug, interpreter pauses before the execution of the 10 | instructions that are to be traced and prompts for input. You may do one 11 | of following things: 12 | 13 | - Enter a null line to continue execution. 14 | - Enter a list of REXX instructions, which are interpreted immediately 15 | (DO-END instructions must be complete, etc.). 16 | 17 | During the execution of the string, no tracing takes place, except that 18 | non-zero return codes from host commands are displayed. Execution of a 19 | TRACE instruction with the “?” prefix turns off interactive debug mode. 20 | Other TRACE instructions affect the tracing that occurs when normal 21 | execution continues. 22 | -------------------------------------------------------------------------------- /doc/global.md: -------------------------------------------------------------------------------- 1 | # GLOBAL Variables 2 | 3 | You can define global variables which can be accessed from within the 4 | rexx whatever the current procedure variable scope is. STEMS are not 5 | supported. 6 | 7 | ### SETG('variable-name', 'content') 8 | 9 | SETG sets or updates a variable with the given content. 10 | 11 | ### GETG('variable-name') 12 | 13 | GETG returns the current content of the global variable. 14 | 15 | Example: 16 | 17 | ```rexx 18 | call setg('ctime',time('l')) 19 | call setg('city','Munich') 20 | call testproc 21 | exit 0 22 | 23 | testproc: procedure 24 | /* normal variable scope can't access variables from the calling rexx */ 25 | say 'Global Variables from the calling REXX' 26 | say getg('ctime') 27 | say getg('city') 28 | return 0 29 | ``` 30 | 31 | Result: 32 | 33 | ```default 34 | GLOBAL VARIABLES FROM THE CALLING REXX 35 | 19:45:12.538474 36 | MUNICH 37 | ``` 38 | -------------------------------------------------------------------------------- /doc/special.md: -------------------------------------------------------------------------------- 1 | # Special Variables 2 | 3 | There are three special variables: 4 | 5 | ## SIGL 6 | 7 | holds the line number of the instruction that was last executed before 8 | control of program was transferred to another place. This can be caused 9 | by a SIGNAL instruction, a CALL instruction or a trapped error 10 | condition. 11 | 12 | ## RC 13 | 14 | is set to the errorlevel (return-code) after execution of every command (to host). 15 | 16 | ## RESULT 17 | 18 | is set by a RETURN instruction in a CALLed procedure. 19 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | PDFBUILD = build/pdf 11 | 12 | # Put it first so that "make" without argument is like "make help". 13 | help: 14 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 15 | 16 | .PHONY: help Makefile pdf 17 | 18 | pdf: $(PDFBUILD)/BREXX370_Users_Guide.pdf 19 | 20 | $(PDFBUILD)/BREXX370_Users_Guide.pdf: 21 | $(SPHINXBUILD) -b pdf "$(SOURCEDIR)" "$(PDFBUILD)" >> ../build/docs.log 2>&1 22 | 23 | # Catch-all target: route all unknown targets to Sphinx using the new 24 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 25 | %: Makefile 26 | $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) >> ../build/docs.log 2>&1 27 | 28 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=source 11 | set BUILDDIR=build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.https://www.sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | rinohtype -------------------------------------------------------------------------------- /docs/source/_static/brexx370.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvslovers/brexx370/82331e6ceac93d1102ef0e81a565df3d6a154c23/docs/source/_static/brexx370.png -------------------------------------------------------------------------------- /docs/source/compound.rst: -------------------------------------------------------------------------------- 1 | Compound Variable Names 2 | ======================= 3 | 4 | **name** may be "compound" in that it may be composed of several parts 5 | (separated by periods) some of which may have variable values. The parts 6 | are then substituted independently, to generate a fully resolved name. 7 | In general, 8 | 9 | .. code-block:: rexx 10 | :linenos: 11 | 12 | s0.s1.s2.---.sn /* is substituted to form */ 13 | d0.v1.v2.---.vn /* where d0 is uppercase of s0, and 14 | v1-vn are values of s1-sn */ 15 | 16 | This facility may be used for traditional arrays, content-addressable 17 | arrays, and other indirect addressing modes. As an example, the 18 | sequence: 19 | 20 | .. code-block:: rexx 21 | :linenos: 22 | 23 | J = 5 24 | a.j = "fred" 25 | 26 | would assign fred to the variable A.5. 27 | 28 | The stem of name (i.e. that part up to and including the first ".") may 29 | be specified on the `DROP` and `PROCEDURE` `EXPOSE` instructions and 30 | affect all variables starting with that stem. An assignment to a stem 31 | assigns the new value to all possible variables with that stem. -------------------------------------------------------------------------------- /docs/source/cover.tmpl: -------------------------------------------------------------------------------- 1 | .. class:: logoimage 2 | 3 | .. image:: _static/brexx370.png 4 | :align: center 5 | :width: 80% 6 | 7 | 8 | .. raw:: pdf 9 | 10 | Spacer 0 10mm 11 | 12 | 13 | {% if title: %} 14 | 15 | .. cssclass:: title 16 | 17 | {{title}} 18 | 19 | {% endif %} 20 | 21 | .. cssclass:: subtitle 22 | 23 | {{subtitle}} 24 | 25 | .. cssclass:: author 26 | :align: center 27 | 28 | {{date}} 29 | 30 | .. raw:: pdf 31 | 32 | PageBreak oneColumn -------------------------------------------------------------------------------- /docs/source/cover.yaml: -------------------------------------------------------------------------------- 1 | pageSetup: {firstTemplate: coverPage} 2 | pageTemplates: 3 | coverPage: 4 | frames: 5 | - [0cm, 0cm, 100%, 100%] 6 | showFooter: false 7 | showHeader: false 8 | styles: 9 | centered: {alignment: center, parent: bodytext} 10 | headertable: 11 | colWidths: [20%, 60%, 20%] 12 | commands: [] 13 | parent: table 14 | logoimage: {alignment: TA_CENTER} 15 | right: {alignment: right, parent: bodytext} 16 | subtitle: {fontName: fontMonoBold, fontSize: 38} 17 | thin: {alignment: TA_JUSTIFY, hyphenation: true, language: en, parent: bodytext, 18 | width: 65%} 19 | title: {fontName: fontMonoBold, fontSize: 56} 20 | author: {fontName: fontMonoBold, fontSize: 32} 21 | mathformula: {alignment: TA_CENTER} -------------------------------------------------------------------------------- /docs/source/debugging.rst: -------------------------------------------------------------------------------- 1 | 2 | 3 | Interactive Debugging 4 | ===================== 5 | 6 | You can enter the interactive debuging either by executing a TRACE 7 | instruction with a prefix '?' or when calling REXX from command line 8 | issuing as a first argument the trace option: 9 | 10 | `rexx '?A' 'HLQ.DATASET(MEMBER)'` 11 | 12 | In interactive debug, interpreter pauses before the execution of the 13 | instructions that are to be traced and prompts for input. You may do one 14 | of following things: 15 | 16 | - Enter a null line to continue execution. 17 | - Enter a list of REXX instructions, which are interpreted immediately 18 | (`DO-END` instructions must be complete, etc.). 19 | 20 | During the execution of the string, no tracing takes place, except that 21 | non-zero return codes from host commands are displayed. Execution of a 22 | TRACE instruction with the "?" prefix turns off interactive debug mode. 23 | Other TRACE instructions affect the tracing that occurs when normal 24 | execution continues. -------------------------------------------------------------------------------- /docs/source/special.rst: -------------------------------------------------------------------------------- 1 | Special Variables 2 | ================= 3 | 4 | There are three special variables: 5 | 6 | SIGL 7 | ---- 8 | 9 | holds the line number of the instruction that was last executed before 10 | control of program was transferred to another place. This can be caused 11 | by a SIGNAL instruction, a CALL instruction or a trapped error 12 | condition. 13 | 14 | RC 15 | -- 16 | 17 | is set to the errorlevel (return-code) after execution of every command (to host). 18 | 19 | RESULT 20 | ------ 21 | 22 | is set by a RETURN instruction in a CALLed procedure. -------------------------------------------------------------------------------- /dynit/svc99.c: -------------------------------------------------------------------------------- 1 | #include "rxmvsext.h" 2 | #include "svc99.h" 3 | 4 | int svc99(__S99parms *parms) 5 | { 6 | int rc; 7 | 8 | unsigned int tmp; 9 | RX_SVC_PARAMS svcParams; 10 | 11 | // set high order bit 12 | tmp = (unsigned int) parms; 13 | tmp |= MASK; 14 | 15 | svcParams.SVC = 99; 16 | svcParams.R0 = 0; 17 | svcParams.R1 = (unsigned int) &tmp; 18 | svcParams.R15 = 0; 19 | 20 | call_rxsvc(&svcParams); 21 | 22 | rc = (int) svcParams.R15; 23 | 24 | return rc; 25 | } 26 | -------------------------------------------------------------------------------- /inc/addrlink.h: -------------------------------------------------------------------------------- 1 | #ifndef ADDRLINK_H 2 | #define ADDRLINK_H 3 | 4 | #include "lstring.h" 5 | 6 | #define MAX_ARGS 16 7 | 8 | typedef struct trx_link_params_r15 { 9 | void* moduleName; 10 | void* dcbAddress; 11 | } RX_LINK_PARAMS_R15, *RX_LINK_PARAMS_R15_PTR; 12 | 13 | typedef struct trx_link_params_r1 { 14 | void* ptr[MAX_ARGS]; 15 | } RX_LINK_PARAMS_R1, *RX_LINK_PARAMS_R1_PTR; 16 | 17 | int handleLinkCommands(PLstr cmd, PLstr env); 18 | 19 | #endif //ADDRLINK_H 20 | -------------------------------------------------------------------------------- /inc/external.h: -------------------------------------------------------------------------------- 1 | #ifndef EXTERNAL_H 2 | #define EXTERNAL_H 3 | #include "lstring.h" 4 | 5 | #define MAX_ARGS 15 6 | #define EVALBLOCK_HEADER_LENGTH 16 7 | #define EVALBLOCK_DATA_LENGTH 4096 8 | 9 | typedef struct trx_ext_params_r15 { 10 | void* moduleName; 11 | void* dcbAddress; 12 | } RX_EXT_PARAMS_R15, *RX_EXT_PARAMS_R15_PTR; 13 | 14 | typedef struct trx_ext_params_r1 { 15 | void* ptr[1]; 16 | } RX_EXT_PARAMS_R1, *RX_EXT_PARAMS_R1_PTR; 17 | 18 | int callExternalFunction(char *functionName, char* arguments[MAX_ARGS], int numArguments, PLstr result); 19 | 20 | #endif //EXTERNAL_H 21 | -------------------------------------------------------------------------------- /inc/hostcmd.h: -------------------------------------------------------------------------------- 1 | #ifndef BREXX_HOSTCMD_H 2 | #define BREXX_HOSTCMD_H 3 | 4 | bool isHostCmd(PLstr cmd, PLstr env); 5 | int handleHostCmd(PLstr cmd, PLstr env); 6 | 7 | #endif //BREXX_HOSTCMD_H 8 | -------------------------------------------------------------------------------- /inc/lmvs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: lmvs.h,v 1.1 2008/07/15 14:57:11 bnv Exp $ 3 | * $Log: lmvs.h,v $ 4 | * Revision 1.1 2008/07/15 14:57:11 bnv 5 | * Initial revision 6 | * 7 | * 8 | * Following sections contains name redefinitions for VM 9 | */ 10 | #ifndef __LMVS_H 11 | #define __LMVS_H 12 | 13 | #define Ldiv Lsdiv 14 | #define Labs Lsabs 15 | #define Lx2b Lsx2b 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /inc/mvssup.h: -------------------------------------------------------------------------------- 1 | #ifndef __MVSSUP_H 2 | #define __MVSSUP_H 3 | 4 | //typedef unsigned long uintptr_t; 5 | 6 | void _dump(void *data, size_t size, char *heading); 7 | 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /inc/preload.h: -------------------------------------------------------------------------------- 1 | #ifndef __PRELOAD_H 2 | #define __PRELOAD_H 3 | 4 | #include "rexx.h" 5 | int RxPreLoaded(RxFile *rxf); 6 | int RxLoadRX(RxFile *rxf); 7 | 8 | #endif //__PRELOAD_H 9 | -------------------------------------------------------------------------------- /inc/rxexecio.h: -------------------------------------------------------------------------------- 1 | #ifndef __RXEXECIO_H 2 | #define __RXEXECIO_H 3 | 4 | int RxEXECIO(char **tokens,PLstr cmd); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /inc/rxfss.h: -------------------------------------------------------------------------------- 1 | #ifndef __RXFSS_H__ 2 | #define __RXFSS_H__ 3 | 4 | int RxFSS_INIT(char **tokens); 5 | int RxFSS_TERM(char **tokens); 6 | int RxFSS_STATIC(char **tokens); 7 | int RxFSS_RESET(char **tokens); 8 | int RxFSS_TEXT(char **tokens); 9 | int RxFSS_TEST(char **tokens); 10 | int RxFSS_FIELD(char **tokens); 11 | int RxFSS_SET(char **tokens); 12 | int RxFSS_GET(char **tokens); 13 | int RxFSS_REFRESH(char **tokens); 14 | int RxFSS_SHOW(char **tokens); 15 | int RxFSS_CHECK(char **tokens); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /inc/rxrac.h: -------------------------------------------------------------------------------- 1 | #ifndef __RXRAC_H 2 | #define __RXRAC_H 3 | 4 | #ifdef JCC 5 | #define __unused 6 | #endif 7 | 8 | #define FACILITY (const char *) "FACILITY" 9 | 10 | #define SVC244 (const char *) "SVC244" 11 | #define DIAG8 (const char *) "DIAG8CMD" 12 | 13 | #define READ (const char *) "READ" 14 | #define ALTER (const char *) "ALTER" 15 | 16 | void RxRacRegFunctions(); 17 | 18 | #endif //__RXRAC_H 19 | -------------------------------------------------------------------------------- /inc/rxregex.h: -------------------------------------------------------------------------------- 1 | #ifndef __RXREGEX_H 2 | #define __RXREGEX_H 3 | 4 | #ifdef JCC 5 | #define __unused 6 | #endif 7 | 8 | void RxRegexRegFunctions(); 9 | 10 | #endif //__RXREGEX_H 11 | -------------------------------------------------------------------------------- /inc/rxvsamio.h: -------------------------------------------------------------------------------- 1 | #ifndef __RXVSAMIO_H 2 | #define __RXVSAMIO_H 3 | 4 | int RxVSAMIO(char **tokens); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /inc/stack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: stack.h,v 1.4 2008/07/15 07:40:07 bnv Exp $ 3 | * $Log: stack.h,v $ 4 | * Revision 1.4 2008/07/15 07:40:07 bnv 5 | * MVS, CMS support 6 | * 7 | * Revision 1.3 2002/06/11 12:37:56 bnv 8 | * Added: CDECL 9 | * 10 | * Revision 1.2 2001/06/25 18:52:04 bnv 11 | * Header -> Id 12 | * 13 | * Revision 1.1 1998/07/02 17:35:50 bnv 14 | * Initial revision 15 | * 16 | */ 17 | 18 | #ifndef __STACK_H__ 19 | #define __STACK_H__ 20 | 21 | #include "lstring.h" 22 | #include "dqueue.h" 23 | 24 | /* ---- function prototypes ---- */ 25 | void __CDECL CreateStack( void ); 26 | void __CDECL DeleteStack( void ); 27 | void __CDECL Queue2Stack( PLstr str ); 28 | void __CDECL Push2Stack( PLstr str ); 29 | PLstr __CDECL PullFromStack( void ); 30 | long __CDECL StackQueued( void ); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /inc/systemx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: systemx.h,v 1.2 2001/06/25 18:52:04 bnv Exp $ 3 | * $Log: systemx.h,v $ 4 | * Revision 1.2 2001/06/25 18:52:04 bnv 5 | * Header -> Id 6 | * 7 | * Revision 1.1 1998/07/02 17:35:50 bnv 8 | * Initial revision 9 | * 10 | * 11 | * Function prototypes for calling external programs 12 | */ 13 | 14 | /* ---------------------------------------------------------- */ 15 | /* like system() function except that it returns the real */ 16 | /* Return Code from the function */ 17 | /* ---------------------------------------------------------- */ 18 | extern int far systemx(const char far *cmd); 19 | 20 | /* ----------------------------------------------BNV 1991 --- */ 21 | /* prototype to call asm int2e back door of command.com */ 22 | /* int2e, executes a dos command without loading command.com */ 23 | /* but uses the parent proccess command interpreter */ 24 | /* ---------------------------------------------------------- */ 25 | extern void far int2e(char far *); 26 | -------------------------------------------------------------------------------- /inc/util.h: -------------------------------------------------------------------------------- 1 | #ifndef BREXX_UTIL_H 2 | #define BREXX_UTIL_H 3 | #include "rxmvsext.h" 4 | 5 | typedef enum quotation { UNQUOTED, PARTIALLY_QUOTED, FULL_QUOTED } QuotationType; 6 | 7 | QuotationType CheckQuotation(const char *sDSName); 8 | int getDatasetName(RX_ENVIRONMENT_CTX_PTR pEnvironmentCtx, const char *datasetNameIn, char datasetNameOut[54 + 1]); 9 | void splitDSN(PLstr dsn, PLstr member, PLstr fromDSN); 10 | int createDataset(char *sNAME, char *sMODE, char *sRECFM, unsigned int uiLRECL, unsigned int uiBLKSIZE, 11 | unsigned int uiDIR, unsigned int uiPRI, unsigned int uiSEC); 12 | long getFileSize(FILE *pFile); 13 | int IsReturnCode(char * input); 14 | void DumpHex(const unsigned char* data, size_t size); 15 | void PrintErrno(); 16 | 17 | #endif //BREXX_UTIL_H 18 | -------------------------------------------------------------------------------- /irx/irxinit.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Mike Großmann on 04.11.20. 3 | // 4 | 5 | -------------------------------------------------------------------------------- /irx/irxsay.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvslovers/brexx370/82331e6ceac93d1102ef0e81a565df3d6a154c23/irx/irxsay.c -------------------------------------------------------------------------------- /jcl/DATE#B.jcl: -------------------------------------------------------------------------------- 1 | //DATETEST JOB (BREXX370),CLASS=A,MSGCLASS=H, 2 | // REGION=8192K,NOTIFY=&SYSUID 3 | //* 4 | //* 5 | //*RELEASE SET '{version}' 6 | //* ... BREXX Version {version} Build Date {date} 7 | //* ... INSTALLER DATE {date} 8 | //* ------------------------------------------------------------------* 9 | //* TEST REXX DATE IN PLAIN BATCH 10 | //* ------------------------------------------------------------------* 11 | //REXX EXEC RXBATCH,BREXX='BREXX', 12 | // EXEC='DATE#T', 13 | // SLIB='BREXX.CURRENT.SAMPLES' 14 | -------------------------------------------------------------------------------- /jcl/DUMP#T.jcl: -------------------------------------------------------------------------------- 1 | //DUMPTEST JOB (BREXX370),CLASS=A,MSGCLASS=H, 2 | // REGION=8192K,NOTIFY=&SYSUID 3 | //* 4 | //*RELEASE SET '{version}' 5 | //* ... BREXX Version {version} Build Date {date} 6 | //* ... INSTALLER DATE {date} 7 | //* ------------------------------------------------------------------* 8 | //* TEST REXX DATE IN PLAIN BATCH 9 | //* ------------------------------------------------------------------* 10 | //REXX EXEC RXBATCH,EXEC='$DUMP',SLIB='BREXX.CURRENT.SAMPLES' 11 | -------------------------------------------------------------------------------- /jcl/ETIME#T.jcl: -------------------------------------------------------------------------------- 1 | //TIMETEST JOB (BREXX370),CLASS=A,MSGCLASS=H, 2 | // REGION=8192K,NOTIFY=&SYSUID 3 | //* 4 | //*RELEASE SET '{version}' 5 | //* ... BREXX Version {version} Build Date {date} 6 | //* ... INSTALLER DATE {date} 7 | //* ------------------------------------------------------------------* 8 | //* TEST REXX DATE AS TSO BATCH 9 | //* ------------------------------------------------------------------* 10 | //REXX EXEC RXTSO,EXEC='$ETIME',SLIB='BREXX.CURRENT.SAMPLES' 11 | -------------------------------------------------------------------------------- /jcl/PDSDIR#T.jcl: -------------------------------------------------------------------------------- 1 | //PDSDIRT JOB (BREXX370),CLASS=A,MSGCLASS=H, 2 | // REGION=8192K,NOTIFY=&SYSUID 3 | //* 4 | //*RELEASE SET '{version}' 5 | //* ... BREXX Version {version} Build Date {date} 6 | //* ... INSTALLER DATE {date} 7 | //* ------------------------------------------------------------------* 8 | //* TEST REXX DATE AS TSO BATCH 9 | //* ------------------------------------------------------------------* 10 | //REXX EXEC RXTSO,EXEC='$PDSDIR',SLIB='BREXX.CURRENT.SAMPLES' 11 | -------------------------------------------------------------------------------- /jcl/RXMSG#T.jcl: -------------------------------------------------------------------------------- 1 | //MSGTEST JOB (BREXX370),CLASS=A,MSGCLASS=H, 2 | // REGION=8192K,NOTIFY=&SYSUID 3 | //* 4 | //*RELEASE SET '{version}' 5 | //* ... BREXX Version {version} Build Date {date} 6 | //* ... INSTALLER DATE {date} 7 | //* ------------------------------------------------------------------* 8 | //* TEST REXX DATE AS TSO BATCH 9 | //* ------------------------------------------------------------------* 10 | //REXX EXEC RXTSO,EXEC='$RXMSG',SLIB='BREXX.CURRENT.SAMPLES' 11 | -------------------------------------------------------------------------------- /jcl/SORT#T.jcl: -------------------------------------------------------------------------------- 1 | //SORTTEST JOB (BREXX370),CLASS=A,MSGCLASS=H, 2 | // REGION=8192K,NOTIFY=&SYSUID 3 | //* 4 | //*RELEASE SET '{version}' 5 | //* ... BREXX Version {version} Build Date {date} 6 | //* ... INSTALLER DATE {date} 7 | //* ------------------------------------------------------------------* 8 | //* TEST REXX DATE AS TSO BATCH 9 | //* ------------------------------------------------------------------* 10 | //REXX EXEC RXTSO,EXEC='$RXSORT',SLIB='BREXX.CURRENT.SAMPLES' 11 | -------------------------------------------------------------------------------- /jcl/STEM#T.jcl: -------------------------------------------------------------------------------- 1 | //WSTEMSAB JOB (BREXX370),CLASS=A,MSGCLASS=H, 2 | // REGION=8192K,NOTIFY=&SYSUID 3 | //* 4 | //*RELEASE SET '{version}' 5 | //* ... BREXX Version {version} Build Date {date} 6 | //* ... INSTALLER DATE {date} 7 | //* ------------------------------------------------------------------* 8 | //* TEST REXX DATE AS TSO BATCH 9 | //* ------------------------------------------------------------------* 10 | //REXX EXEC RXTSO,EXEC='$STEMSAV',SLIB='BREXX.CURRENT.SAMPLES' 11 | -------------------------------------------------------------------------------- /jcl/STUDENTI.jcl: -------------------------------------------------------------------------------- 1 | //BRXVSMIN JOB CLASS=A,MSGCLASS=H,REGION=8192K, 2 | // NOTIFY=&SYSUID 3 | //* 4 | //*RELEASE SET '{version}' 5 | //* ... BREXX Version {version} Build Date {date} 6 | //* ... INSTALLER DATE {date} 7 | //* ----------------------------------------------------------------- 8 | //* STEP 1 INSERT RECORDS INTO VSAM FILE 9 | //* ----------------------------------------------------------------- 10 | //* 11 | //BATCH EXEC RXTSO,BREXX='BREXX', 12 | // EXEC='@STUDENI', 13 | // SLIB='BREXX.CURRENT.SAMPLES' 14 | //SYSPRINT DD SYSOUT=*, 15 | // DCB=(RECFM=FBA,LRECL=133,BLKSIZE=133) 16 | //SYSUDUMP DD SYSOUT=* 17 | // 18 | -------------------------------------------------------------------------------- /jcl/STUDENTK.jcl: -------------------------------------------------------------------------------- 1 | //BRXVSMKY JOB CLASS=A,MSGCLASS=H,REGION=8192K, 2 | // NOTIFY=&SYSUID 3 | //* 4 | //*RELEASE SET '{version}' 5 | //* ... BREXX Version {version} Build Date {date} 6 | //* ... INSTALLER DATE {date} 7 | //* ----------------------------------------------------------------- 8 | //* READ STUDENT VSAM FILE VIA KEY 9 | //* ----------------------------------------------------------------- 10 | //* 11 | //BATCH EXEC RXTSO,BREXX='BREXX', 12 | // EXEC='@STUDENK', 13 | // SLIB='BREXX.CURRENT.SAMPLES' 14 | //SYSPRINT DD SYSOUT=*, 15 | // DCB=(RECFM=FBA,LRECL=133,BLKSIZE=133) 16 | //SYSUDUMP DD SYSOUT=* 17 | // 18 | -------------------------------------------------------------------------------- /jcl/STUDENTN.jcl: -------------------------------------------------------------------------------- 1 | //BRXVSMNX JOB CLASS=A,MSGCLASS=H,REGION=8192K, 2 | // NOTIFY=&SYSUID 3 | //* 4 | //*RELEASE SET '{version}' 5 | //* ... BREXX Version {version} Build Date {date} 6 | //* ... INSTALLER DATE {date} 7 | //* ----------------------------------------------------------------- 8 | //* READ STUDENT VSAM FILE VIA LOCATE/NEXT 9 | //* ----------------------------------------------------------------- 10 | //* 11 | //BATCH EXEC RXTSO,BREXX='BREXX', 12 | // EXEC='@STUDENN', 13 | // SLIB='BREXX.CURRENT.SAMPLES' 14 | //SYSPRINT DD SYSOUT=*, 15 | // DCB=(RECFM=FBA,LRECL=133,BLKSIZE=133) 16 | //SYSUDUMP DD SYSOUT=* 17 | // 18 | -------------------------------------------------------------------------------- /jcl/VERSIO#T.jcl: -------------------------------------------------------------------------------- 1 | //VERSIONT JOB (BREXX370),CLASS=A,MSGCLASS=H, 2 | // REGION=8192K,NOTIFY=&SYSUID 3 | //* 4 | //*RELEASE SET '{version}' 5 | //* ... BREXX Version {version} Build Date {date} 6 | //* ... INSTALLER DATE {date} 7 | //* ------------------------------------------------------------------* 8 | //* TEST REXX DATE AS TSO BATCH 9 | //* ------------------------------------------------------------------* 10 | //REXX EXEC RXTSO,EXEC='$VERSION',SLIB='BREXX.CURRENT.SAMPLES' 11 | -------------------------------------------------------------------------------- /jcl/WAIT#T.jcl: -------------------------------------------------------------------------------- 1 | //WAITTEST JOB (BREXX370),CLASS=A,MSGCLASS=H, 2 | // REGION=8192K,NOTIFY=&SYSUID 3 | //* 4 | //*RELEASE SET '{version}' 5 | //* ... BREXX Version {version} Build Date {date} 6 | //* ... INSTALLER DATE {date} 7 | //* ------------------------------------------------------------------* 8 | //* TEST REXX DATE AS TSO BATCH 9 | //* ------------------------------------------------------------------* 10 | //REXX EXEC RXTSO,EXEC='$WAIT',SLIB='BREXX.CURRENT.SAMPLES' 11 | -------------------------------------------------------------------------------- /jcl/WTO#T.jcl: -------------------------------------------------------------------------------- 1 | //WTOTEST JOB (BREXX370),CLASS=A,MSGCLASS=H, 2 | // REGION=8192K,NOTIFY=&SYSUID 3 | //* 4 | //*RELEASE SET '{version}' 5 | //* ... BREXX Version {version} Build Date {date} 6 | //* ... INSTALLER DATE {date} 7 | //* ------------------------------------------------------------------* 8 | //* TEST REXX DATE AS TSO BATCH 9 | //* ------------------------------------------------------------------* 10 | //REXX EXEC RXTSO,EXEC='$WTO',SLIB='BREXX.CURRENT.SAMPLES' 11 | -------------------------------------------------------------------------------- /lib/math.r: -------------------------------------------------------------------------------- 1 | /* extended math library */ 2 | C = 299792458.0 /* m/s */ 3 | h = 6.6260755e-34 /* J s */ 4 | pi = 3.14159265358979323846 5 | qe = 1.6021773349e-19 /* C */ 6 | me = 0.51099906 /* MeV */ 7 | mp = 938.27231 /* MeV */ 8 | mn = 939.56563 /* MeV */ 9 | fwhm = 2.355 10 | na = 6.022e23 /* Avogadro */ 11 | 12 | in = 25.4 /* mm */ 13 | nm = 1852 /* m */ 14 | ft = 0.3048 /* m */ 15 | return 16 | 17 | d2r: return arg(1)/180*PI 18 | r2d: return arg(1)/PI*180 19 | 20 | sind: return sin(d2r(arg(1))) 21 | cosd: return cos(d2r(arg(1))) 22 | tand: return tan(d2r(arg(1))) 23 | 24 | asind: return r2d(asin(arg(1))) 25 | acosd: return r2d(acos(arg(1))) 26 | atand: return r2d(atan(arg(1))) 27 | 28 | b2g: return 1/sqrt(1-arg(1)**2) 29 | g2b: return sqrt(1-1/arg(1)**2) 30 | -------------------------------------------------------------------------------- /lstring/abbrev.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: abbrev.c,v 1.5 2008/07/15 07:40:54 bnv Exp $ 3 | * $Log: abbrev.c,v $ 4 | * Revision 1.5 2008/07/15 07:40:54 bnv 5 | * #include changed from <> to "" 6 | * 7 | * Revision 1.4 2008/07/14 13:07:53 bnv 8 | * Bug correction 9 | * 10 | * Revision 1.3 2002/06/11 12:37:15 bnv 11 | * Added: CDECL 12 | * 13 | * Revision 1.2 2001/06/25 18:49:48 bnv 14 | * Header changed to Id 15 | * 16 | * Revision 1.1 1998/07/02 17:16:15 bnv 17 | * Initial revision 18 | * 19 | */ 20 | 21 | #include "lstring.h" 22 | 23 | /* ------------------- Labbrev -------------------- */ 24 | bool __CDECL 25 | Labbrev(const PLstr information, const PLstr info, long length) 26 | { 27 | int cond1, cond2, cond3; 28 | 29 | if (length<=0) length = LLEN(*info); 30 | 31 | cond1 = (LLEN(*information) >= LLEN(*info)); 32 | cond2 = (LLEN(*info) >= length); 33 | cond3 = !memcmp(LSTR(*information), LSTR(*info), LLEN(*info)); 34 | return cond1 && cond2 && cond3; 35 | } /* Labbrev */ 36 | -------------------------------------------------------------------------------- /lstring/abs.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: abs.c,v 1.4 2008/07/15 07:40:54 bnv Exp $ 3 | * $Log: abs.c,v $ 4 | * Revision 1.4 2008/07/15 07:40:54 bnv 5 | * #include changed from <> to "" 6 | * 7 | * Revision 1.3 2002/06/11 12:37:15 bnv 8 | * Added: CDECL 9 | * 10 | * Revision 1.2 2001/06/25 18:49:48 bnv 11 | * Header changed to Id 12 | * 13 | * Revision 1.1 1998/07/02 17:16:35 bnv 14 | * Initial revision 15 | * 16 | */ 17 | 18 | #include 19 | #include "lstring.h" 20 | 21 | /* ------------------ Labs ---------------------- */ 22 | void __CDECL 23 | Labs( const PLstr to, const PLstr num ) 24 | { 25 | L2NUM(num); 26 | 27 | switch (LTYPE(*num)) { 28 | case LINTEGER_TY: 29 | Licpy(to,labs(LINT(*num))); 30 | break; 31 | case LREAL_TY: 32 | Lrcpy(to,fabs(LREAL(*num))); 33 | break; 34 | } 35 | } /* Labs */ 36 | -------------------------------------------------------------------------------- /lstring/c2x.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: c2x.c,v 1.5 2011/06/29 08:33:09 bnv Exp $ 3 | * $Log: c2x.c,v $ 4 | * Revision 1.5 2011/06/29 08:33:09 bnv 5 | * char to unsigned 6 | * 7 | * Revision 1.4 2008/07/15 07:40:54 bnv 8 | * #include changed from <> to "" 9 | * 10 | * Revision 1.3 2002/06/11 12:37:15 bnv 11 | * Added: CDECL 12 | * 13 | * Revision 1.2 2001/06/25 18:49:48 bnv 14 | * Header changed to Id 15 | * 16 | * Revision 1.1 1998/07/02 17:16:35 bnv 17 | * Initial revision 18 | * 19 | */ 20 | 21 | #include "lstring.h" 22 | 23 | /* ------------------- Lc2x ------------------- */ 24 | void __CDECL 25 | Lc2x( const PLstr to, const PLstr from ) 26 | { 27 | unsigned char *re, *ar; 28 | int i,r; 29 | 30 | L2STR(from); 31 | 32 | Lfx(to,2*LLEN(*from)); 33 | re = LSTR(*to); ar = LSTR(*from); 34 | 35 | for (i=0,r=0; i> 4) & 0x0F]; 37 | re[r++] = chex[ar[i] & 0x0F]; 38 | } 39 | LTYPE(*to) = LSTRING_TY; 40 | LLEN(*to) = r; 41 | } /* Lc2x */ 42 | -------------------------------------------------------------------------------- /lstring/center.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: center.c,v 1.4 2008/07/15 07:40:54 bnv Exp $ 3 | * $Log: center.c,v $ 4 | * Revision 1.4 2008/07/15 07:40:54 bnv 5 | * #include changed from <> to "" 6 | * 7 | * Revision 1.3 2002/06/11 12:37:15 bnv 8 | * Added: CDECL 9 | * 10 | * Revision 1.2 2001/06/25 18:49:48 bnv 11 | * Header changed to Id 12 | * 13 | * Revision 1.1 1998/07/02 17:17:00 bnv 14 | * Initial revision 15 | * 16 | */ 17 | 18 | #include 19 | #include "lstring.h" 20 | 21 | /* ------------------ Lcenter ----------------- */ 22 | void __CDECL 23 | Lcenter( const PLstr to, const PLstr from, const long length, const char pad) 24 | { 25 | long i,a; 26 | 27 | if (length<=0) { 28 | LZEROSTR(*to); 29 | return; 30 | } 31 | 32 | L2STR(to); 33 | L2STR(from); 34 | i = length - LLEN(*from); 35 | 36 | if (!i) Lstrcpy(to,from); 37 | else 38 | if (i < 0) { 39 | i = -i; a = i / 2; 40 | _Lsubstr(to, from, (size_t)a+1, (size_t)length); 41 | } else { 42 | a = i / 2; 43 | Lstrset(to,length,pad); 44 | MEMCPY( LSTR(*to)+a, LSTR(*from), LLEN(*from) ); 45 | } 46 | } /* Lcenter */ 47 | -------------------------------------------------------------------------------- /lstring/charin.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: charin.c,v 1.6 2008/07/15 07:40:54 bnv Exp $ 3 | * $Log: charin.c,v $ 4 | * Revision 1.6 2008/07/15 07:40:54 bnv 5 | * #include changed from <> to "" 6 | * 7 | * Revision 1.5 2004/03/26 22:50:22 bnv 8 | * *** empty log message *** 9 | * 10 | * Revision 1.4 2002/06/11 12:37:15 bnv 11 | * Added: CDECL 12 | * 13 | * Revision 1.3 2001/06/25 18:49:48 bnv 14 | * Header changed to Id 15 | * 16 | * Revision 1.2 1999/11/26 09:53:14 bnv 17 | * Changed: To use the new macros. 18 | * 19 | * Revision 1.1 1998/07/02 17:17:00 bnv 20 | * Initial revision 21 | * 22 | */ 23 | 24 | #include "lstring.h" 25 | 26 | /* ---------------- Lcharin ------------------- */ 27 | void __CDECL 28 | Lcharin( FILEP f, const PLstr line, const long start, const long length ) 29 | { 30 | if (start>=1) 31 | FSEEK(f,start-1,SEEK_SET); 32 | if (length<=0) { 33 | LZEROSTR(*line); 34 | return; 35 | } 36 | Lread(f,line,length); 37 | } /* Lcharin */ 38 | -------------------------------------------------------------------------------- /lstring/charout.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: charout.c,v 1.5 2008/07/15 07:40:54 bnv Exp $ 3 | * $Log: charout.c,v $ 4 | * Revision 1.5 2008/07/15 07:40:54 bnv 5 | * #include changed from <> to "" 6 | * 7 | * Revision 1.4 2002/06/11 12:37:15 bnv 8 | * Added: CDECL 9 | * 10 | * Revision 1.3 2001/06/25 18:49:48 bnv 11 | * Header changed to Id 12 | * 13 | * Revision 1.2 1999/11/26 09:53:28 bnv 14 | * Changed: To use the new macros. 15 | * 16 | * Revision 1.1 1998/07/02 17:17:00 bnv 17 | * Initial revision 18 | * 19 | */ 20 | 21 | #include "lstring.h" 22 | 23 | /* ---------------- Lcharout ------------------- */ 24 | void __CDECL 25 | Lcharout( FILEP f, const PLstr line, const long start ) 26 | { 27 | if (start>=0) 28 | FSEEK(f,start,SEEK_SET); 29 | 30 | Lwrite(f,line,FALSE); 31 | } /* Lcharout */ 32 | -------------------------------------------------------------------------------- /lstring/countstr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: countstr.c,v 1.4 2008/07/15 07:40:54 bnv Exp $ 3 | * $Log: countstr.c,v $ 4 | * Revision 1.4 2008/07/15 07:40:54 bnv 5 | * #include changed from <> to "" 6 | * 7 | * Revision 1.3 2002/06/11 12:37:15 bnv 8 | * Added: CDECL 9 | * 10 | * Revision 1.2 2001/06/25 18:49:48 bnv 11 | * Header changed to Id 12 | * 13 | * Revision 1.1 1998/07/02 17:17:00 bnv 14 | * Initial revision 15 | * 16 | */ 17 | 18 | #include "lstring.h" 19 | 20 | /* ----------------- Lcountstr ------------------- * 21 | * Counts the appearances of the first string 'target' 22 | * in the second argument 'source' 23 | */ 24 | long __CDECL 25 | Lcountstr( const PLstr target, const PLstr source ) 26 | { 27 | long output=0, position; 28 | 29 | position = Lpos(target,source,0); 30 | while (position>0) { 31 | output++; 32 | position = Lpos(target,source,position+LLEN(*target)); 33 | } 34 | return output; 35 | } /* Lcountstr */ 36 | -------------------------------------------------------------------------------- /lstring/dec.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: dec.c,v 1.4 2008/07/15 07:40:54 bnv Exp $ 3 | * $Log: dec.c,v $ 4 | * Revision 1.4 2008/07/15 07:40:54 bnv 5 | * #include changed from <> to "" 6 | * 7 | * Revision 1.3 2002/06/11 12:37:15 bnv 8 | * Added: CDECL 9 | * 10 | * Revision 1.2 2001/06/25 18:49:48 bnv 11 | * Header changed to Id 12 | * 13 | * Revision 1.1 1998/07/02 17:17:00 bnv 14 | * Initial revision 15 | * 16 | */ 17 | 18 | #include "lstring.h" 19 | 20 | /* ------------------- Ldec ------------------ */ 21 | void __CDECL 22 | Ldec( const PLstr num ) 23 | { 24 | L2NUM(num); 25 | 26 | if (LTYPE(*num)==LINTEGER_TY) 27 | LINT(*num) -= 1; 28 | else 29 | LREAL(*num) -= 1.0; 30 | } /* Ldec */ 31 | -------------------------------------------------------------------------------- /lstring/delstr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: delstr.c,v 1.4 2008/07/15 07:40:54 bnv Exp $ 3 | * $Log: delstr.c,v $ 4 | * Revision 1.4 2008/07/15 07:40:54 bnv 5 | * #include changed from <> to "" 6 | * 7 | * Revision 1.3 2002/06/11 12:37:15 bnv 8 | * Added: CDECL 9 | * 10 | * Revision 1.2 2001/06/25 18:49:48 bnv 11 | * Header changed to Id 12 | * 13 | * Revision 1.1 1998/07/02 17:17:00 bnv 14 | * Initial revision 15 | * 16 | */ 17 | 18 | #include "lstring.h" 19 | 20 | /* ---------------- Ldelstr ------------------- */ 21 | void __CDECL 22 | Ldelstr( const PLstr to, const PLstr from, long start, long length ) 23 | { 24 | Lstr tmp; 25 | 26 | L2STR(from); 27 | 28 | start--; 29 | if (start<0) start = 0; 30 | if (start>=LLEN(*from)) { 31 | Lstrcpy(to,from); 32 | return; 33 | } 34 | 35 | if (start) 36 | _Lsubstr(to,from,1,(size_t)start); 37 | else 38 | LZEROSTR(*to); 39 | 40 | if (length>0) 41 | if (start+length < LLEN(*from)) { 42 | LINITSTR(tmp); 43 | _Lsubstr(&tmp, from, (size_t)(start+length+1), 0); 44 | Lstrcat(to,&tmp); 45 | LFREESTR(tmp); 46 | } 47 | } /* Ldelstr */ 48 | -------------------------------------------------------------------------------- /lstring/div.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: div.c,v 1.5 2011/06/29 08:33:09 bnv Exp $ 3 | * $Log: div.c,v $ 4 | * Revision 1.5 2011/06/29 08:33:09 bnv 5 | * char to unsigned 6 | * 7 | * Revision 1.4 2008/07/15 07:40:54 bnv 8 | * #include changed from <> to "" 9 | * 10 | * Revision 1.3 2002/06/11 12:37:15 bnv 11 | * Added: CDECL 12 | * 13 | * Revision 1.2 2001/06/25 18:49:48 bnv 14 | * Header changed to Id 15 | * 16 | * Revision 1.1 1998/07/02 17:18:00 bnv 17 | * Initial Version 18 | * 19 | */ 20 | 21 | #include "lerror.h" 22 | #include "lstring.h" 23 | 24 | /* ------------------- Ldiv ----------------- */ 25 | void __CDECL 26 | Ldiv( const PLstr to, const PLstr A, const PLstr B ) 27 | { 28 | double b; 29 | 30 | b = Lrdreal(B); 31 | if (b == 0) Lerror(ERR_ARITH_OVERFLOW,3); 32 | LREAL(*to) = Lrdreal(A) / b; 33 | LTYPE(*to) = LREAL_TY; 34 | LLEN(*to) = sizeof(double); 35 | } /* Ldiv */ 36 | -------------------------------------------------------------------------------- /lstring/inc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: inc.c,v 1.4 2008/07/15 07:40:54 bnv Exp $ 3 | * $Log: inc.c,v $ 4 | * Revision 1.4 2008/07/15 07:40:54 bnv 5 | * #include changed from <> to "" 6 | * 7 | * Revision 1.3 2002/06/11 12:37:15 bnv 8 | * Added: CDECL 9 | * 10 | * Revision 1.2 2001/06/25 18:49:48 bnv 11 | * Header changed to Id 12 | * 13 | * Revision 1.1 1998/07/02 17:18:00 bnv 14 | * Initial Version 15 | * 16 | */ 17 | 18 | #include "lstring.h" 19 | 20 | /* ------------------- Linc ------------------ */ 21 | void __CDECL 22 | Linc( const PLstr num ) 23 | { 24 | L2NUM(num); 25 | 26 | if (LTYPE(*num)==LINTEGER_TY) 27 | LINT(*num) += 1; 28 | else 29 | LREAL(*num) += 1.0; 30 | } /* Linc */ 31 | -------------------------------------------------------------------------------- /lstring/intdiv.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: intdiv.c,v 1.4 2008/07/15 07:40:54 bnv Exp $ 3 | * $Log: intdiv.c,v $ 4 | * Revision 1.4 2008/07/15 07:40:54 bnv 5 | * #include changed from <> to "" 6 | * 7 | * Revision 1.3 2002/06/11 12:37:15 bnv 8 | * Added: CDECL 9 | * 10 | * Revision 1.2 2001/06/25 18:49:48 bnv 11 | * Header changed to Id 12 | * 13 | * Revision 1.1 1998/07/02 17:18:00 bnv 14 | * Initial Version 15 | * 16 | */ 17 | 18 | #include "lerror.h" 19 | #include "lstring.h" 20 | 21 | /* ---------------- Lintdiv ---------------- */ 22 | void __CDECL 23 | Lintdiv( const PLstr to, const PLstr A, const PLstr B ) 24 | { 25 | double d1,d2,r; 26 | long s; 27 | int ta; 28 | d2 = Lrdreal(B); 29 | 30 | if (d2 == 0) Lerror(ERR_ARITH_OVERFLOW,0); 31 | 32 | d1 = Lrdreal(A); 33 | r = d1/d2; 34 | snprintf(LSTR(*to), LMAXLEN(*to), "%.*f", (int)1, r); 35 | LLEN(*to) = STRLEN(LSTR(*to))-2; 36 | ta=_Lisnum(to); 37 | s=lLastScannedNumber; 38 | LINT(*to) = (long)s; 39 | LTYPE(*to) = LINTEGER_TY; 40 | LLEN(*to) = sizeof(long); 41 | } /* Lintdiv */ 42 | -------------------------------------------------------------------------------- /lstring/lmath.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: lmath.c,v 1.4 2008/07/15 07:40:54 bnv Exp $ 3 | * $Log: lmath.c,v $ 4 | * Revision 1.4 2008/07/15 07:40:54 bnv 5 | * #include changed from <> to "" 6 | * 7 | * Revision 1.3 2002/06/11 12:37:15 bnv 8 | * Added: CDECL 9 | * 10 | * Revision 1.2 2001/06/25 18:49:48 bnv 11 | * Header changed to Id 12 | * 13 | * Revision 1.1 1998/07/02 17:18:00 bnv 14 | * Initial Version 15 | * 16 | */ 17 | 18 | #include 19 | #include "lstring.h" 20 | 21 | /* ------------------ pow10 ------------------- */ 22 | static double 23 | pow10d( double num ) 24 | { 25 | return pow(10.0,num); 26 | } /* pow10d */ 27 | 28 | #define MATH(func) \ 29 | void __CDECL L##func(const PLstr to, const PLstr num) \ 30 | {Lrcpy(to, func(Lrdreal(num)));} 31 | 32 | MATH( acos ) 33 | MATH( asin ) 34 | MATH( atan ) 35 | MATH( cos ) 36 | MATH( cosh ) 37 | MATH( exp ) 38 | MATH( log ) 39 | MATH( log10) 40 | MATH( pow10d) 41 | MATH( sin ) 42 | MATH( sinh ) 43 | MATH( sqrt ) 44 | MATH( tan ) 45 | MATH( tanh ) 46 | #undef MATH 47 | -------------------------------------------------------------------------------- /lstring/lower.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: lower.c,v 1.4 2008/07/15 07:40:54 bnv Exp $ 3 | * $Log: lower.c,v $ 4 | * Revision 1.4 2008/07/15 07:40:54 bnv 5 | * #include changed from <> to "" 6 | * 7 | * Revision 1.3 2002/06/11 12:37:15 bnv 8 | * Added: CDECL 9 | * 10 | * Revision 1.2 2001/06/25 18:49:48 bnv 11 | * Header changed to Id 12 | * 13 | * Revision 1.1 1998/07/02 17:18:00 bnv 14 | * Initial Version 15 | * 16 | */ 17 | 18 | #include "lstring.h" 19 | 20 | /* --------------- Llower ----------------- */ 21 | void __CDECL 22 | Llower( const PLstr s ) 23 | { 24 | size_t i; 25 | 26 | L2STR(s); 27 | for (i=0; i to "" 6 | * 7 | * Revision 1.3 2002/06/11 12:37:15 bnv 8 | * Added: CDECL 9 | * 10 | * Revision 1.2 2001/06/25 18:49:48 bnv 11 | * Header changed to Id 12 | * 13 | * Revision 1.1 1998/07/02 17:18:00 bnv 14 | * Initial Version 15 | * 16 | */ 17 | 18 | #include "lstring.h" 19 | 20 | /* ------------------- Lneg ------------------ */ 21 | void __CDECL 22 | Lneg( const PLstr to, const PLstr num ) 23 | { 24 | L2NUM(num); 25 | 26 | if (LTYPE(*num)==LINTEGER_TY) { 27 | LINT(*to) = -LINT(*num); 28 | LTYPE(*to) = LINTEGER_TY; 29 | LLEN(*to) = sizeof(long); 30 | } else { 31 | LREAL(*to) = -LREAL(*num); 32 | LTYPE(*to) = LREAL_TY; 33 | LLEN(*to) = sizeof(double); 34 | } 35 | } /* Lneg */ 36 | -------------------------------------------------------------------------------- /lstring/reradix.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: reradix.c,v 1.5 2008/07/15 07:40:54 bnv Exp $ 3 | * $Log: reradix.c,v $ 4 | * Revision 1.5 2008/07/15 07:40:54 bnv 5 | * #include changed from <> to "" 6 | * 7 | * Revision 1.4 2002/06/11 12:37:15 bnv 8 | * Added: CDECL 9 | * 10 | * Revision 1.3 2001/06/25 18:49:48 bnv 11 | * Header changed to Id 12 | * 13 | * Revision 1.2 1999/11/26 12:52:25 bnv 14 | * Nothing important. 15 | * 16 | * Revision 1.1 1998/07/02 17:18:00 bnv 17 | * Initial Version 18 | * 19 | */ 20 | 21 | #include "lstring.h" 22 | 23 | /* --------------- Lreradix ----------------- */ 24 | void __CDECL 25 | Lreradix( const PLstr to, const PLstr subject, 26 | const int fromradix, const int toradix ) 27 | { 28 | /* and suppose that subject is string */ 29 | /* radix must be from 2 to 16 */ 30 | long integer=0; 31 | int j; 32 | 33 | for (j=0; j to "" 6 | * 7 | * Revision 1.3 2002/06/11 12:37:15 bnv 8 | * Added: CDECL 9 | * 10 | * Revision 1.2 2001/06/25 18:49:48 bnv 11 | * Header changed to Id 12 | * 13 | * Revision 1.1 1998/07/02 17:18:00 bnv 14 | * Initial Version 15 | * 16 | */ 17 | 18 | #include "lstring.h" 19 | 20 | /* ------------------ Lreverse ------------------- */ 21 | void __CDECL 22 | Lreverse( const PLstr s ) 23 | { 24 | long i; 25 | char c,*cf,*cl; 26 | 27 | L2STR(s); 28 | if (LLEN(*s)==0) 29 | return; 30 | cf = LSTR(*s); cl = cf + LLEN(*s) - 1; 31 | i = LLEN(*s) / 2; 32 | while (i--) { 33 | c = *cf; 34 | *cf++ = *cl; 35 | *cl-- = c; 36 | } 37 | } /* Lreverse */ 38 | -------------------------------------------------------------------------------- /lstring/right.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: right.c,v 1.4 2008/07/15 07:40:54 bnv Exp $ 3 | * $Log: right.c,v $ 4 | * Revision 1.4 2008/07/15 07:40:54 bnv 5 | * #include changed from <> to "" 6 | * 7 | * Revision 1.3 2002/06/11 12:37:15 bnv 8 | * Added: CDECL 9 | * 10 | * Revision 1.2 2001/06/25 18:49:48 bnv 11 | * Header changed to Id 12 | * 13 | * Revision 1.1 1998/07/02 17:18:00 bnv 14 | * Initial Version 15 | * 16 | */ 17 | 18 | #include 19 | #include "lstring.h" 20 | 21 | /* ------------------ Lright ------------------- */ 22 | void __CDECL 23 | Lright( const PLstr to, const PLstr from, const long length, const char pad) 24 | { 25 | L2STR(from); 26 | 27 | if (length<=0) { 28 | LZEROSTR(*to); 29 | return; 30 | } 31 | 32 | if (length > LLEN(*from)) { 33 | Lstrset(to, length-LLEN(*from), pad ); 34 | Lstrcat(to, from); 35 | } else 36 | Lsubstr(to, from, LLEN(*from)-length+1,LREST,pad); 37 | } /* Lright */ 38 | -------------------------------------------------------------------------------- /lstring/round.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by PeterJ on 05.05.2020. 3 | // 4 | 5 | #include "lstring.h" 6 | 7 | /* ---------------- Lround ----------------- */ 8 | void __CDECL 9 | Lround( const PLstr to, const PLstr from, long n) { 10 | int i; 11 | double add; 12 | 13 | L2REAL(from); 14 | Lfx(to,n+15); 15 | 16 | add=5.0; 17 | if (LREAL(*from)<0) add=-add; 18 | for (i=0;i<=n;i++) add=add/10; 19 | 20 | // the PC Version round does not work correctly as snprintf rounds 21 | // in the MVS version snprintf does not, we therefore need to add 0.xx5 22 | // which is stripped off by snprintf later 23 | 24 | snprintf(LSTR(*to), LMAXLEN(*to), "%.*f", (int)n, LREAL(*from)+add); 25 | LTYPE(*to) = LSTRING_TY; 26 | LLEN(*to) = STRLEN(LSTR(*to)); 27 | } /* Lround */ 28 | -------------------------------------------------------------------------------- /lstring/sign.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: sign.c,v 1.4 2008/07/15 07:40:54 bnv Exp $ 3 | * $Log: sign.c,v $ 4 | * Revision 1.4 2008/07/15 07:40:54 bnv 5 | * #include changed from <> to "" 6 | * 7 | * Revision 1.3 2002/06/11 12:37:15 bnv 8 | * Added: CDECL 9 | * 10 | * Revision 1.2 2001/06/25 18:49:48 bnv 11 | * Header changed to Id 12 | * 13 | * Revision 1.1 1998/07/02 17:18:00 bnv 14 | * Initial Version 15 | * 16 | */ 17 | 18 | #include "lstring.h" 19 | 20 | /* ------------------ Lsign --------------------- */ 21 | int __CDECL 22 | Lsign( const PLstr num ) 23 | { 24 | L2NUM(num); 25 | 26 | switch (LTYPE(*num)) { 27 | case LINTEGER_TY: 28 | if (LINT(*num)<0) 29 | return -1; 30 | else 31 | if (LINT(*num)>0) 32 | return 1; 33 | else 34 | return 0; 35 | 36 | case LREAL_TY: 37 | if (LREAL(*num)<0) 38 | return -1; 39 | else 40 | if (LREAL(*num)>0) 41 | return 1; 42 | else 43 | return 0; 44 | } 45 | return 0; 46 | } /* Lsign */ 47 | -------------------------------------------------------------------------------- /lstring/upper.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: upper.c,v 1.4 2008/07/15 07:40:54 bnv Exp $ 3 | * $Log: upper.c,v $ 4 | * Revision 1.4 2008/07/15 07:40:54 bnv 5 | * #include changed from <> to "" 6 | * 7 | * Revision 1.3 2002/06/11 12:37:15 bnv 8 | * Added: CDECL 9 | * 10 | * Revision 1.2 2001/06/25 18:49:48 bnv 11 | * Header changed to Id 12 | * 13 | * Revision 1.1 1998/07/02 17:18:00 bnv 14 | * Initial Version 15 | * 16 | */ 17 | 18 | #include "lstring.h" 19 | 20 | /* --------------- Lupper ------------------ */ 21 | void __CDECL 22 | Lupper( const PLstr s ) 23 | { 24 | size_t i; 25 | L2STR(s); 26 | for (i=0; i to "" 6 | * 7 | * Revision 1.3 2002/06/11 12:37:15 bnv 8 | * Added: CDECL 9 | * 10 | * Revision 1.2 2001/06/25 18:49:48 bnv 11 | * Header changed to Id 12 | * 13 | * Revision 1.1 1998/07/02 17:20:58 bnv 14 | * Initial Version 15 | * 16 | */ 17 | 18 | #include "lstring.h" 19 | 20 | /* ------------------ Lword ------------------- */ 21 | void __CDECL 22 | Lword( const PLstr to, const PLstr from, long n ) 23 | { 24 | long i; 25 | 26 | i = Lwordindex(from,n); 27 | if (n<=0) n = 1; 28 | if (i==0) { 29 | LZEROSTR(*to); 30 | return; 31 | } 32 | n = i-1; 33 | LSKIPWORD(*from,n); 34 | _Lsubstr(to,from,i,n-i+1); 35 | } /* Lword */ 36 | -------------------------------------------------------------------------------- /lstring/wordidx.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: wordidx.c,v 1.4 2008/07/15 07:40:54 bnv Exp $ 3 | * $Log: wordidx.c,v $ 4 | * Revision 1.4 2008/07/15 07:40:54 bnv 5 | * #include changed from <> to "" 6 | * 7 | * Revision 1.3 2002/06/11 12:37:15 bnv 8 | * Added: CDECL 9 | * 10 | * Revision 1.2 2001/06/25 18:49:48 bnv 11 | * Header changed to Id 12 | * 13 | * Revision 1.1 1998/07/02 17:20:58 bnv 14 | * Initial Version 15 | * 16 | */ 17 | 18 | #include "lstring.h" 19 | 20 | /* ----------------- Lwordindex ---------------- */ 21 | long __CDECL 22 | Lwordindex( const PLstr str, long n ) 23 | { 24 | long p; 25 | 26 | L2STR(str); 27 | 28 | if ((LLEN(*str)==0) || (n<=0)) return 0; 29 | for (p=0;;) { 30 | LSKIPBLANKS(*str,p); 31 | if (p>=LLEN(*str)) return 0; 32 | n--; 33 | if (!n) return p+1; 34 | LSKIPWORD(*str,p); 35 | } 36 | } /* Lwordindex */ 37 | -------------------------------------------------------------------------------- /lstring/wordlen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: wordlen.c,v 1.4 2008/07/15 07:40:54 bnv Exp $ 3 | * $Log: wordlen.c,v $ 4 | * Revision 1.4 2008/07/15 07:40:54 bnv 5 | * #include changed from <> to "" 6 | * 7 | * Revision 1.3 2002/06/11 12:37:15 bnv 8 | * Added: CDECL 9 | * 10 | * Revision 1.2 2001/06/25 18:49:48 bnv 11 | * Header changed to Id 12 | * 13 | * Revision 1.1 1998/07/02 17:20:58 bnv 14 | * Initial Version 15 | * 16 | */ 17 | 18 | #include "lstring.h" 19 | 20 | /* --------------- Lwordlength ----------------- */ 21 | long __CDECL 22 | Lwordlength( const PLstr from, long n ) 23 | { 24 | long i; 25 | 26 | i = Lwordindex(from,n); 27 | if (i==0) return 0; 28 | n = i--; 29 | LSKIPWORD(*from,i); 30 | return i-n+1; 31 | } /* Lwordlength */ 32 | -------------------------------------------------------------------------------- /lstring/words.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: words.c,v 1.4 2008/07/15 07:40:54 bnv Exp $ 3 | * $Log: words.c,v $ 4 | * Revision 1.4 2008/07/15 07:40:54 bnv 5 | * #include changed from <> to "" 6 | * 7 | * Revision 1.3 2002/06/11 12:37:15 bnv 8 | * Added: CDECL 9 | * 10 | * Revision 1.2 2001/06/25 18:49:48 bnv 11 | * Header changed to Id 12 | * 13 | * Revision 1.1 1998/07/02 17:20:58 bnv 14 | * Initial Version 15 | * 16 | */ 17 | 18 | #include "lstring.h" 19 | 20 | /* ----------------- Lwords ------------------ */ 21 | long __CDECL 22 | Lwords( const PLstr from ) 23 | { 24 | long i=0,r=0; 25 | 26 | L2STR(from); 27 | for (;;) { 28 | LSKIPBLANKS(*from,i); 29 | if (i>=LLEN(*from)) return r; 30 | r++; 31 | LSKIPWORD(*from,i); 32 | } 33 | } /* Lwords */ 34 | -------------------------------------------------------------------------------- /maclib/BIN2CHR.hlasm: -------------------------------------------------------------------------------- 1 | MACRO 00000108 2 | &LABEL BIN2CHR &TARGET,&SOURCE 00000208 3 | &LABEL BIN2PAK STRPACK,&SOURCE 00000308 4 | UNPK &TARGET,STRPACK UNPACK NUMBER 00000408 5 | OI &TARGET+L'&TARGET-1,X'F0' CORRECT SIGN (LAST BYTE) 00000508 6 | MEND 00000608 7 | -------------------------------------------------------------------------------- /maclib/BIN2PAK.hlasm: -------------------------------------------------------------------------------- 1 | MACRO 00000102 2 | &LABEL BIN2PAK &TARGET,&SOURCE 00000202 3 | AIF ('&SOURCE'(1,1) NE '(').REGNOT 00000302 4 | &LABEL CVD &SOURCE(1),STRPACK CONVERT SOURCE NUMBER 00000402 5 | AGO .STRALL 00000502 6 | .REGNOT ANOP 00000602 7 | &LABEL L R1,&SOURCE 00000702 8 | CVD R1,&TARGET CONVERT SOURCE NUMBER 00000802 9 | .STRALL ANOP 00000902 10 | MEND 00001002 11 | -------------------------------------------------------------------------------- /maclib/BLANK.hlasm: -------------------------------------------------------------------------------- 1 | * ------------------------------------------------------------------ 00000100 2 | * BLANK OUT VARIABLE (<=255 BYTES) 00000200 3 | * ------------------------------------------------------------------ 00000300 4 | MACRO 00000400 5 | &LABEL BLANK &TARGET 00000500 6 | &LABEL MVI &TARGET,C' ' CLEAR TARGET FIELD 00000600 7 | MVC &TARGET+1(L'&TARGET-1),&TARGET CLEAR TARGET FIELD 00000700 8 | MEND 00000800 9 | -------------------------------------------------------------------------------- /maclib/LADR.hlasm: -------------------------------------------------------------------------------- 1 | MACRO 2 | LADR ®M,&ADR 3 | LCLC &ADRVAR 4 | LCLA &FLEN 5 | .* ------------------------------------------------------------ 6 | .* LOAD ADDRESS OF FIELD, REGISTER 7 | .* ------------------------------------------------------------ 8 | AIF ('&ADR'(1,1) EQ '(').ISREG 9 | AIF ('&ADR'(1,1) EQ '*').ISADDR 10 | LA ®M,&ADR 11 | AGO .ADR2 12 | .* ..... ADDRESS IS IN REGISTER NOTATION 13 | .ISREG ANOP 14 | LR ®M,&ADR(1) 15 | AGO .ADR2 16 | .* ..... ADDRESS IS IN A FIELD 17 | .ISADDR ANOP 18 | &FLEN SETA K'&ADR-1 19 | &ADRVAR SETC '&ADR'(2,&FLEN) 20 | L ®M,&ADRVAR 21 | .ADR2 ANOP 22 | MEND 23 | -------------------------------------------------------------------------------- /maclib/MOVCMT.hlasm: -------------------------------------------------------------------------------- 1 | MACRO 00000100 2 | &LABEL MOVCMT &TO,&CMT 00000200 3 | LCLA &CLEN 00000300 4 | &CLEN SETA K'&CMT-2 00000400 5 | &LABEL MVC &TO.(&CLEN),=C&CMT 00000500 6 | MEND 00000600 7 | -------------------------------------------------------------------------------- /maclib/MRXEXIT.hlasm: -------------------------------------------------------------------------------- 1 | MACRO 00000100 2 | &NAME MRXEXIT 00000200 3 | &NAME LR R0,RF SAVE RC FOR THE MOMENT 00000300 4 | L RD,4(,RD) CALLER'S SAVE AREA POINTER 00000400 5 | L RE,12(,RD) RESTORE RE 00000500 6 | LM R1,RC,24(RD) RESTORE REGISTERS 00000600 7 | CL R0,512 WAS IT EXIT BEFORE ADDRESSABILTY? 00000700 8 | BER RE YES, THEN RETURN IMMEDIATELY 00000800 9 | LR RF,R0 RE-LOAD RETURN CODE 00000900 10 | BR RE RETURN TO CALLER 00001000 11 | MEND 00001100 12 | -------------------------------------------------------------------------------- /maclib/MVA.hlasm: -------------------------------------------------------------------------------- 1 | MACRO 00000100 2 | &NAME MVA &TARGET,&SOURCE 00000200 3 | &NAME LA R0,&SOURCE 00000300 4 | ST R0,&TARGET 00000400 5 | MEND 00000500 6 | -------------------------------------------------------------------------------- /maclib/OPERLIST.hlasm: -------------------------------------------------------------------------------- 1 | MACRO 2 | &OPNM OPERLIST 3 | LCLA &I 4 | &OPNM DC F'0' LIST OF KNOWN OPERANDS 5 | .CU ANOP 6 | &I SETA &I+1 7 | AIF (&I GT N'&SYSLIST).MEX 8 | DC A(&SYSLIST(&I)) 9 | AGO .CU 10 | .MEX DC F'0' END OF LIST 11 | MEND 12 | -------------------------------------------------------------------------------- /maclib/README.md: -------------------------------------------------------------------------------- 1 | BREXX/370 Macro Library 2 | ======================= 3 | 4 | This folder contains the macros used in building BREXX/370. 5 | 6 | The extention `.hlasm` is used so that github syntax highlighting works 7 | -------------------------------------------------------------------------------- /maclib/STRLC.hlasm: -------------------------------------------------------------------------------- 1 | MACRO 00000100 2 | &LABEL STRLC &TO,&CHAR='0' 00000200 3 | &LABEL LA R1,L'&TO 00000300 4 | LA RF,&TO 00000400 5 | S&SYSNDX CLI 0(RF),C&CHAR BLANK LEADING CHARACTER 00000500 6 | BNE E&SYSNDX 00000600 7 | MVI 0(RF),C' ' 00000700 8 | LA RF,1(RF) 00000800 9 | BCT R1,S&SYSNDX 00000900 10 | E&SYSNDX DS 0H 00001000 11 | MEND 00001100 12 | -------------------------------------------------------------------------------- /maclib/TLINE.hlasm: -------------------------------------------------------------------------------- 1 | MACRO 00010000 2 | TLINE &LIT 00020000 3 | B X&SYSNDX 00030000 4 | LIT&SYSNDX DC C&LIT 00040000 5 | X&SYSNDX DS 0H 00050000 6 | TPUT LIT&SYSNDX,L'LIT&SYSNDX 00060000 7 | MEND 00070000 8 | -------------------------------------------------------------------------------- /maclib/TPT.hlasm: -------------------------------------------------------------------------------- 1 | MACRO 00090000 2 | &NAME TPT &A,&B 00100000 3 | LCLC &X 00110000 4 | &X SETC 'L''' 00120000 5 | &NAME LA 1,&A 00130000 6 | AIF ('&B' NE '').GENB 00140000 7 | LA 0,&X&A 00150000 8 | AGO .TPT 00160000 9 | .GENB LA 0,&B 00170000 10 | .TPT TPUT (1),(0),R 00180000 11 | MEND 00190000 12 | -------------------------------------------------------------------------------- /maclib/VTCALL.hlasm: -------------------------------------------------------------------------------- 1 | MACRO 00778000 2 | &LAB VTCALL &RTN,&TEST 00779000 3 | &LAB LA R1,VTOCOM POINT TO THE COMMON AREA 00780000 4 | L R15,VAD&RTN POINT TO THE ROUTINE 00781000 5 | AIF ('&TEST' NE 'TEST').NOTEST 00782000 6 | LTR R15,R15 SEE IF THE ROUTINE IS PRESENT 00783000 7 | BZ *+6 DON'T CALL IT IF IT'S NOT THERE 00784000 8 | .NOTEST ANOP 00785000 9 | BALR R14,R15 THEN CALL IT 00786000 10 | MEND 00787000 11 | -------------------------------------------------------------------------------- /maclib/VTCMSG.hlasm: -------------------------------------------------------------------------------- 1 | MACRO 00730000 2 | &NAME VTCMSG &TEXT 00731000 3 | LCLA &A 00732000 4 | &A SETA K'&TEXT-2+4 SUBTRACT QUOTES, ADD PREFIX FOUR BYTES 00733000 5 | &NAME DC H'&A',H'0',C&TEXT 00734000 6 | MEND 00735000 7 | -------------------------------------------------------------------------------- /maclib/VTOCMSG.hlasm: -------------------------------------------------------------------------------- 1 | MACRO 00010000 2 | &LAB VTOCMSG &MSG1,&MSG2 FIRST LEVEL MESSAGE, OPTIONAL SECOND 00020000 3 | &LAB LA R1,&MSG1 POINT TO THE FIRST MESSAGE 00030000 4 | AIF ('&MSG2' EQ '').NOSEC IF NO SECOND LEVEL MSG 00040000 5 | LA R0,&MSG2 POINT TO THE SECOND MESSAGE 00050000 6 | AGO .SETMSG SET UP THE MESSAGES 00060000 7 | .NOSEC SR R0,R0 NO SECOND LEVEL MESSAGE 00070000 8 | .SETMSG STM R0,R1,MSGADDRS SAVE THE MESSAGE ADDRESSES 00080000 9 | * THEN JUST CALL THE MESSAGE ISSUING ROUTINE 00090000 10 | VTCALL MSG AWAY WE GO 00100000 11 | MEND 00110000 12 | -------------------------------------------------------------------------------- /maclib/WORKEND.hlasm: -------------------------------------------------------------------------------- 1 | .* -------------------------------------------------------------------- 00027700 2 | .* END OF WORK AREA DEFINITON 00027800 3 | .* -------------------------------------------------------------------- 00027900 4 | MACRO 00028000 5 | &LABEL WORKEND 00028100 6 | DS CL256 00028200 7 | WORKLEN EQU *-WORKAREA 00028300 8 | MEND 00028400 9 | -------------------------------------------------------------------------------- /map/CREDITS: -------------------------------------------------------------------------------- 1 | A type-safe generic hashmap implementation for C. 2 | 3 | grabbed from ... 4 | -------------------------------------------------------------------------------- /map/README.md: -------------------------------------------------------------------------------- 1 | # Hashmap 2 | 3 | A simple generic hashmap, and double linked list, implementation in C. 4 | 5 | ## Usage 6 | 7 | All hash map API functions are prefixed as `hashMap*`. 8 | 9 | ```c 10 | #include "hashmap.h" 11 | 12 | // The larger the better 13 | size_t size = 50; 14 | 15 | HashMap *map = hashMapNew(size); 16 | 17 | // Insertion/Setting 18 | hashMapSet(map, "libname", "hashmap"); 19 | hashMapSet(map, "author", "mech"); 20 | hashMapset(map, "author", "mecha"); // Overrides 21 | hashMapSet(map, "foo", "bar"); 22 | 23 | // Removal 24 | hashMapDelete(map, "foo"); 25 | 26 | // Retrieval 27 | hashMapGet(map, "libname"); // "hashmap" 28 | hashMapGet(map, "author"); // "mecha" 29 | 30 | // Existence check 31 | hashMapHas(map, "libname"); true 32 | hashMapHas(map, "foo"); // false 33 | ``` 34 | -------------------------------------------------------------------------------- /map/hashing.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "hashing.h" 3 | 4 | unsigned long int digitalRoot(unsigned long int hash) 5 | { 6 | unsigned long int digitalRoot = 0; 7 | 8 | do { 9 | digitalRoot += hash % 10; 10 | hash *= 0.1; 11 | } while (hash > 0); 12 | 13 | return digitalRoot; 14 | } 15 | 16 | unsigned long int hashKey(char *key) 17 | { 18 | size_t length = strlen(key); 19 | unsigned int hashsum = 0; 20 | unsigned int i; 21 | 22 | for (i = 0; i < length; ++i){ 23 | hashsum += key[i]; 24 | } 25 | 26 | hashsum *= digitalRoot(hashsum); 27 | hashsum += digitalRoot(hashsum); 28 | hashsum /= digitalRoot(hashsum); 29 | 30 | if (hashsum < 0) { 31 | hashsum *= -1; 32 | } 33 | 34 | return hashsum; 35 | } 36 | -------------------------------------------------------------------------------- /map/hashing.h: -------------------------------------------------------------------------------- 1 | #ifndef __HASHING_H__ 2 | #define __HASHING_H__ 3 | 4 | /** 5 | * Calculates the digital root of a hash key. 6 | * 7 | * @param hash The hash. 8 | * 9 | * @return The calculated digital root. 10 | */ 11 | unsigned long int digitalRoot(unsigned long int hash); 12 | 13 | /** 14 | * Calculates the hash for a key, taking into account the size of the container. 15 | * 16 | * @param key The key to hash. 17 | * @param size The size of the parent container. 18 | * 19 | * @return The generate hash. 20 | */ 21 | unsigned long int hashKey(char *key); 22 | 23 | #endif //__HASHING_H__ 24 | -------------------------------------------------------------------------------- /printf/CREDITS: -------------------------------------------------------------------------------- 1 | A printf / sprintf Implementation for Embedded Systems 2 | 3 | grabbed from https://github.com/mpaland/printf 4 | -------------------------------------------------------------------------------- /proclib/README.md: -------------------------------------------------------------------------------- 1 | BREXX/370 PROCLIB 2 | ================= 3 | 4 | This folder contains BREXX proclibs to allow you to use rexx scripts 5 | in batch. 6 | 7 | -------------------------------------------------------------------------------- /proclib/RXBATCH.jcl: -------------------------------------------------------------------------------- 1 | //* 2 | //*RELEASE SET 'V2R5M3' 3 | //* ... BREXX Version V2R5M3 Build Date 01. Feb 2024 4 | //* ... INSTALLER DATE 03/02/2024 17:40:25 5 | //* ------------------------------------------------------------------* 6 | //* REXX BATCH * 7 | //* ------------------------------------------------------------------* 8 | //REXX PROC EXEC='',P='', 9 | // BREXX='BREXX', 10 | // LIB='BREXX.CURRENT.RXLIB', 11 | // SLIB= 12 | //EXEC EXEC PGM=&BREXX,PARM='RXRUN &P',REGION=8192K 13 | //RXRUN DD DSN=&SLIB(&EXEC),DISP=SHR 14 | //RXLIB DD DSN=&LIB,DISP=SHR 15 | //STDIN DD DUMMY 16 | //STDOUT DD SYSOUT=*,DCB=(RECFM=FB,LRECL=140,BLKSIZE=5600) 17 | //STDERR DD SYSOUT=*,DCB=(RECFM=FB,LRECL=140,BLKSIZE=5600) 18 | //* PEND 19 | -------------------------------------------------------------------------------- /proclib/RXTSO.jcl: -------------------------------------------------------------------------------- 1 | //* 2 | //*RELEASE SET 'V2R5M3' 3 | //* ... BREXX Version V2R5M3 Build Date 01. Feb 2024 4 | //* ... INSTALLER DATE 03/02/2024 17:40:25 5 | //* ------------------------------------------------------------------* 6 | //* REXX BATCH TSO * 7 | //* ------------------------------------------------------------------* 8 | //RXTSO PROC EXEC='',P='', 9 | // BREXX='BREXX', 10 | // LIB='BREXX.V2R5M3.RXLIB', 11 | // SLIB= 12 | //EXEC EXEC PGM=IKJEFT01,PARM='&BREXX EXEC &P',REGION=8192K 13 | //EXEC DD DSN=&SLIB(&EXEC),DISP=SHR 14 | //TSOLIB DD DSN=&LIB,DISP=SHR 15 | //RXLIB DD DSN=&LIB,DISP=SHR 16 | //SYSPRINT DD SYSOUT=* 17 | //SYSTSPRT DD SYSOUT=* 18 | //SYSTSIN DD DUMMY 19 | //STDOUT DD SYSOUT=*,DCB=(RECFM=FB,LRECL=140,BLKSIZE=5600) 20 | //STDERR DD SYSOUT=*,DCB=(RECFM=FB,LRECL=140,BLKSIZE=5600) 21 | //STDIN DD DUMMY 22 | //* PEND 23 | -------------------------------------------------------------------------------- /progs/3dplot.r: -------------------------------------------------------------------------------- 1 | f.1 = '30 * exp(-z*z/100)' 2 | f.2 = 'sqrt(900.01-z*z)*.9-2' 3 | f.3 = '30*cos(z/16)-2' 4 | f.4 = '30-30*sin(z/18)' 5 | f.5 = '30*exp(-cos(z/16))-30' 6 | f.6 = '30*sin(z/10)' 7 | 8 | arg f . 9 | if datatype(f)^='NUM' then f = 1 10 | 11 | say 12 | do x=-30 to 30 by 1.5 13 | line = '' 14 | l = 0 15 | y1 = 5 * trunc(sqrt(900 - x*x) / 5 ) 16 | do y=y1 to -y1 by -5 17 | z = trunc(25+ fn(sqrt(x*x+y*y)) - 0.7*y) 18 | if z<=l then iterate 19 | l = z 20 | line = overlay('*',line,z) 21 | end 22 | say line 23 | end 24 | exit 25 | 26 | fn: procedure expose f. f 27 | arg z 28 | interpret 'r=' f.f 29 | return r 30 | -------------------------------------------------------------------------------- /progs/NewFunc.rexx: -------------------------------------------------------------------------------- 1 | /* REXX */ 2 | say "Hello Compress" 3 | say "<"filter("abc","def")">" 4 | say "<"filter("This is a string","i Tsahtrng")">" 5 | say 3.14 ceil(3.14) 6 | say -3.14 ceil(-3.14) 7 | say 13.0 ceil(13.0) 8 | say "-13.0" ceil(-13.0) 9 | say 1333.27 ceil(1333.273253) 10 | say -1333.27 ceil(-1333.273253) 11 | say "------- FLOOR ---------" 12 | say "3.0e08" floor(3.0E8) 13 | say -3.14 floor(-3.14) 14 | say 13.0 floor(13.0) 15 | say "-13.0" floor(-13.0) 16 | say 1333.27 floor(1333.273253) 17 | say -1333.27 floor(-1333.273253) -------------------------------------------------------------------------------- /progs/banner.r: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvslovers/brexx370/82331e6ceac93d1102ef0e81a565df3d6a154c23/progs/banner.r -------------------------------------------------------------------------------- /progs/block.r: -------------------------------------------------------------------------------- 1 | 2 | /* This program is block structured ! */ 3 | /* Author unknown - ported to REXX from ND Fortran by */ 4 | /* Anders Christensen -- anders@solan.unit.no */ 5 | 6 | signal=(interpret=value);value=(interpret 'VAR' then _fmtheader='' 12 | if symbol('_fmtheader2')<> 'VAR' then _fmtheader2='' 13 | if symbol('_fmtfooter') <> 'VAR' then _fmtfooter='' 14 | _screen.TopRow=2 15 | _screen.footer=_fmtFooter 16 | _screen.message=1 17 | return FMTLIST(,,_fmtHeader,_fmtheader2,caller) 18 | -------------------------------------------------------------------------------- /rxlib/GCD.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * Greatest Common Divisor 3 | * GCD(p0,p1,...) 4 | * ............................... Created by PeterJ on 2. February 2022 5 | * --------------------------------------------------------------------- 6 | */ 7 | GCD: Procedure 8 | p0=arg(1)%1 9 | p1=arg(2)%1 10 | argn=arg() 11 | if p0 == 0 then return abs(p1) 12 | if p1 == 0 then return abs(p0) 13 | do while p1 \= 0 14 | px = p0//p1%1 15 | p0 = p1 16 | p1 = px 17 | end 18 | p0=p0%1 19 | do i=3 to argn 20 | p0=gcd(p0,arg(i)) 21 | if p0==0 then leave 22 | end 23 | return abs(p0) 24 | -------------------------------------------------------------------------------- /rxlib/LCM.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * Least Common Multiple 3 | * LCM(p0,p1,...) 4 | * ............................... Created by PeterJ on 2. February 2022 5 | * --------------------------------------------------------------------- 6 | */ 7 | LCM: Procedure 8 | p0=arg(1) 9 | do i=2 to arg() 10 | px=gcd(p0,arg(i)) 11 | if px==0 then return 0 12 | p0=p0%px*(arg(i)%1) 13 | end 14 | return p0%1 15 | -------------------------------------------------------------------------------- /rxlib/LSTALL.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * LISTALL find all Datasets of the MVS Environment (by VTOCs) 3 | * added by PEJ 29. January 2024 4 | * --------------------------------------------------------------------- 5 | */ 6 | listALL: procedure 7 | parse upper arg fdsn 8 | say copies('-',110) 9 | say 'List all Datasets 'arg(1)' by scanning VTOCs' 10 | say copies('-',110) 11 | lAll=screate(20000) 12 | call listvols 13 | do i=1 to volumes.0 14 | volname=word(volumes.i,1) 15 | call vtoc volname 16 | do j=1 to vtoc.0 17 | cdsn=word(vtoc.j,1) 18 | if cdsn=0 then iterate 19 | if strip(substr(vtoc.j,1,5))='' then iterate 20 | if arg(1)<>'' then if pos(fdsn,cdsn)>0 then nop 21 | else iterate 22 | call sset(lAll,,vtoc.j) 23 | end 24 | end 25 | call sqsort lAll 26 | do i=1 to sarray(lAll) 27 | say sget(lAll,i) 28 | end 29 | say copies('-',73) 30 | say 'Datasets found 'sarray(lAll) 31 | return 32 | -------------------------------------------------------------------------------- /rxlib/MCOREL.rexx: -------------------------------------------------------------------------------- 1 | Mcorel: Procedure expose buffer. expose mtitle. 2 | parse arg data,dbg 3 | if dbg=1 then call mprint data,'scal','Data Matrix' 4 | call mproperty(data) 5 | cols=_cols.data%1 6 | rows=_rows.data%1 7 | m1=mnormalise(data,'STANDARD') 8 | if dbg=1 then call mprint m1,'m1','Normalised' 9 | m2=mtranspose(m1) 10 | if dbg=1 then call mprint m2,'m2','Transposed' 11 | m3=mmultiply(m2,m1) 12 | call MFree(m1,'FLOAT') 13 | call MFree(m2,'FLOAT') 14 | if dbg=1 then call mprint m3,'mult','Trans x Org' 15 | m4=mscalar(m3,1/(rows-1)) 16 | call MFree(m3,'FLOAT') 17 | if dbg=1 then call mprint m4,'scal','Correlation Matrix' 18 | return m4 19 | -------------------------------------------------------------------------------- /rxlib/MVSCBS.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * Return Addresses of some MVS Control Blocks 3 | * .............................. Created by PeterJ on 25. February 2019 4 | * MVSCBs must be imported before it can be used 5 | * e.g. 6 | * rc=IMPORT(MVSCBS) 7 | * say tcb() 8 | * say cvt() 9 | * say tiot() 10 | * ... 11 | * --------------------------------------------------------------------- 12 | */ 13 | mvscbs: return 0 14 | cvt: return PEEKA(16) 15 | tcb: return PEEKA(540) 16 | ascb: return PEEKA(548) 17 | Tiot: return PEEKA(tcb()+12) 18 | jscb: return PEEKA(tcb()+180) 19 | cscb: return peeka(ascb()+56) 20 | tsb: return peeka(cscb()+60) 21 | cib: return peeka(cscb()+44) 22 | rmct: return PEEKA(cvt()+604) 23 | asxb: return PEEKA(ascb()+108) 24 | acee: return PEEKA(asxb()+200) 25 | ecvt: return PEEKA(cvt()+328) 26 | smca: return PEEKA(cvt()+196) 27 | dsab: return 12+PEEKA(320+PEEKA(180+PEEKA(PEEKA(PEEKA(16))))) 28 | cpu: return d2x(c2d(storage(d2x(cvt()-6),2))) 29 | -------------------------------------------------------------------------------- /rxlib/NJE38CMD.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * Sends NJE38 Message command and picks up all received messages 3 | * Output is collected in stem _nje38.n 4 | * rc=NJE38CMD("NJE38 M nnn INFO /STATS",request-timeout,last-timeout) 5 | * --------------------------------------------------------------------- 6 | */ 7 | NJE38CMD: procedure expose nje38. 8 | parse upper arg njecmd 9 | if word(njecmd,1)='NJE38' then cmd='F NJE38,'subword(njecmd,2) 10 | else cmd='F NJE38,'njecmd 11 | if rxConsol(cmd)>0 then return 8 12 | do i=2 to console.0 13 | if substr(console.i,25,3)='NJE' then leave 14 | end 15 | if substr(console.i,25,3)<>'NJE' then return 12 16 | task=substr(console.i,15,8) 17 | nje38.1=substr(console.i,25) 18 | cnum=1 19 | do k=i+1 to console.0 20 | if substr(console.k,15,8)<>task then iterate 21 | cnum=cnum+1 22 | nje38.cnum=substr(console.k,25) 23 | end 24 | nje38.0=cnum 25 | return 0 26 | -------------------------------------------------------------------------------- /rxlib/NJE38DSN.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * Determine Netspool DSN 3 | * --------------------------------------------------------------------- 4 | */ 5 | RXNJE38DSN: 6 | parse arg mode 7 | if mode='ALLOC' then do 8 | isSet=0 9 | dsn=getg('NETSPOOL') 10 | if dsn='' then dsn=mvsvar('NJEDSN') 11 | else isSet=1 12 | if dsn='' then do 13 | zerrsm='NJE38 Application not active' 14 | zerrlm='NJE38 Application not active or Allocation failed' 15 | return 8 16 | end 17 | alc=allocate('NETSPOOL',"'"dsn"'") 18 | if alc<0 | alc>4 then do 19 | zerrsm='NJE38 NETSpool allocation error' 20 | zerrlm='NJE38 NETSpool allocation error' 21 | return 8 22 | end 23 | if isSet=0 then call setg('NETSPOOL',dsn) 24 | return alc 25 | end 26 | if mode='FREE' then do 27 | frc=free('NETSPOOL') 28 | return frc 29 | end 30 | say mode' unknown mode' 31 | return 8 32 | -------------------------------------------------------------------------------- /rxlib/PDSHASH.rexx: -------------------------------------------------------------------------------- 1 | pdshash: Procedure 2 | parse upper arg lib,member 3 | dsn=lib"("member")" 4 | fk1=open("'"dsn"'",'RT') 5 | if fk1<0 then return -1 6 | buffer=read(fk1,16000) 7 | hash=rhash(buffer) 8 | call close fk1 9 | return hash 10 | -------------------------------------------------------------------------------- /rxlib/PFACTOR.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * Prime Factorization 3 | * PFACTOR(number) 4 | * returns primefactors in stem PRIMES. 5 | * ............................... Created by PeterJ on 2. February 2022 6 | * --------------------------------------------------------------------- 7 | */ 8 | pfactor: Procedure expose primes. 9 | parse arg number 10 | say number 11 | number=number%1 12 | primes.0=0 13 | if number = 1 then return primes.0 14 | p0=0 15 | factor=2 16 | do while factor*factor<=number 17 | if number//factor \= 0 then factor=factor+1 18 | else do 19 | p0=p0+1 20 | primes.p0=factor 21 | number=number/factor%1 22 | end 23 | end 24 | p0=p0+1 25 | primes.p0=number 26 | primes.0=p0 27 | return p0 28 | -------------------------------------------------------------------------------- /rxlib/QUOTE.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * QUOTE String (enclose string in delimeter) 3 | Quote(string,) 4 | delimeter defaults to ' 5 | if delimeter is ' string will be enclosed in single quotes 6 | if delimeter is " string will be enclosed in double quotes 7 | if delimeter is ( string will be enclosed in (string) 8 | if delimeter is < string will be enclosed in 9 | * ..................................Created by PeterJ on 30. March 2019 10 | * --------------------------------------------------------------------- 11 | */ 12 | Quote: procedure 13 | parse arg ustr,qtype 14 | if qtype="" then return "'"ustr"'" 15 | if qtype="'" then return "'"ustr"'" 16 | if qtype='"' then return '"'ustr'"' 17 | if qtype='(' then return '('ustr')' 18 | if qtype='[' then return '['ustr']' 19 | if qtype='<' then return '<'ustr'>' 20 | return "'"ustr"'" 21 | -------------------------------------------------------------------------------- /rxlib/README.md: -------------------------------------------------------------------------------- 1 | BREXX/270 RXLIB 2 | ================== 3 | 4 | This folder contains all the scripts that make up BREXX/370 rexx library 5 | RXLIB. 6 | 7 | It is included in the install and is typically installed to: 8 | 9 | `BREXX.$RELEASE.RXLIB` -------------------------------------------------------------------------------- /rxlib/RXMSGCUS.rexx: -------------------------------------------------------------------------------- 1 | parse arg $msgpref,$msgnlen,$msgtlen,$msgcase 2 | if $msgpref='' then $msgpref='RX 3 | if $msgnlen='' then $msgnlen=4 4 | if $msgtlen='' then $msgtlen=0 5 | if $msgcase='' then $msgcase=0 6 | return 7 | -------------------------------------------------------------------------------- /rxlib/SETHDR.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * Sets Sticky Header Line 3 | * --------------------------------------------------------------------- 4 | */ 5 | SetHDR: 6 | call stdash 'header',arg(1),arg(2),arg(3) 7 | return 8 | -------------------------------------------------------------------------------- /rxlib/SETHDR2.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * Sets Sticky Header Line 2 3 | * --------------------------------------------------------------------- 4 | */ 5 | SetHDR2: 6 | call stdash 'header2',arg(1),arg(2) 7 | return 8 | -------------------------------------------------------------------------------- /rxlib/SETHDR3.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * Sets Sticky Header Line 3 3 | * --------------------------------------------------------------------- 4 | */ 5 | SetHDR3: 6 | call stdash 'header3',arg(1),arg(2) 7 | return 8 | -------------------------------------------------------------------------------- /rxlib/SETINFO.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * Sets Sticky Info Message 3 | * --------------------------------------------------------------------- 4 | */ 5 | SetInfo: 6 | call stdash 'INFO',arg(1),arg(2) 7 | return 8 | -------------------------------------------------------------------------------- /rxlib/SETPOP1.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * Sets Sticky POP Message 3 | * --------------------------------------------------------------------- 4 | */ 5 | SetPOP1: 6 | call stdash 'POP1',arg(1),arg(2) 7 | return 8 | -------------------------------------------------------------------------------- /rxlib/SETSMSG.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * Sets Sticky Error Message 3 | * --------------------------------------------------------------------- 4 | */ 5 | SetMSG: 6 | call stdash 'SMSG',arg(1),arg(2) 7 | return 8 | -------------------------------------------------------------------------------- /rxlib/SGLDSI.rexx: -------------------------------------------------------------------------------- 1 | sgldis: Procedure 2 | parse arg level,infile 3 | s1=screate(100) 4 | call listdsix("'"infile"'") 5 | call sset(s1,,'DS-NAME 'sysDSNAME) 6 | call sset(s1,,'Volume 'sysVOLUME) 7 | call sset(s1,,'Directory Blocks 'RIGHT(sysDIRBLK,6)) 8 | call sset(s1,,'Members 'RIGHT(sysMEMBERS,6)) 9 | call sset(s1,,'DSORG 'RIGHT(sysDSORG,6)) 10 | call sset(s1,,'RECFM 'RIGHT(sysRECFM,6)) 11 | call sset(s1,,'LRECL 'RIGHT(sysLRECL,6)' Bytes') 12 | call sset(s1,,'BLKSIZE 'RIGHT(sysBLKSIZE,6)' Bytes') 13 | call sset(s1,,'SIZE 'RIGHT(sysSIZE,6)' Bytes') 14 | call sset(s1,,'Created 'RIGHT(sysCREATE,6)) 15 | call sset(s1,,'Last Referred 'RIGHT(sysREFDATE,6)) 16 | call sset(s1,,'Extents 'RIGHT(sysEXTENTS,6)) 17 | call sset(s1,,'Tracks Allocated 'RIGHT(sysTRACKS,6)) 18 | call sset(s1,,'Free TRACKS 'RIGHT(sysNTRACKS,6)) 19 | call sset(s1,,'Secondary Quantity 'RIGHT(sysSEQALC,6)) 20 | call sset(s1,,'Allocation Units 'RIGHT(sysUNITS,6)) 21 | return s1 22 | -------------------------------------------------------------------------------- /rxlib/SGPDSLSX.rexx: -------------------------------------------------------------------------------- 1 | sgpdslst: procedure 2 | parse arg level,pds,local 3 | liblst=screate(1500) 4 | call dir("'"pds"'") 5 | today=date('jdn')-60 6 | today=date('Standard',today,'JDN') 7 | __yy=substr(today,3,2) 8 | __mm=substr(today,5,2) 9 | __dd=substr(today,7,2) 10 | today=__yy'-'__mm'-'__dd'*' 11 | do i=1 to direntry.0 12 | if symbol('direntry.i.udate')='VAR' then ddate=direntry.i.udate 13 | else ddate=today 14 | if symbol('direntry.i.utime')='VAR' then dtime=direntry.i.utime 15 | else dtime='00:00:00' 16 | call sset(LIBLST,,dirEntry.i.name';'ddate';'dtime) 17 | end 18 | return liblst 19 | -------------------------------------------------------------------------------- /rxlib/SHUTD.rexx: -------------------------------------------------------------------------------- 1 | rc=stargate('SEND','ovh2.barrco.us',3205,'$$$SHUTDOWN') 2 | -------------------------------------------------------------------------------- /rxlib/SORTCOPY.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * Copy stem into SORTIN. stem 3 | * .............................. Created by PeterJ on 15. December 2018 4 | * --------------------------------------------------------------------- 5 | */ 6 | sortcopy: 7 | call stemcopy(arg(1),'SORTIN.') 8 | return sortin.0 9 | -------------------------------------------------------------------------------- /rxlib/STARG2MV.rexx: -------------------------------------------------------------------------------- 1 | call SGFSSini 2 | slino=5 3 | do forever 4 | ADDRESS FSS 5 | 'RESET' 6 | CALL FSSTITLE 'Stargate Connecting Stargate Servers',#WHITE 7 | call fsstext('Connect this MVS to another MVS',3,7,,#white) 8 | nxt =sgfield("IPAddr", "IP Address ===>",slino,3,32) 9 | nxt2=sgfield("MVSPort","Port ===>",slino+1,3,5) 10 | call fssmessage FSSHeight()-1 11 | call fsscursor("IPADDR") 12 | call fssdisplay() 13 | 'GET AID AID' 14 | if aid=243 | aid=244 then return 4 15 | call SGfetchVars 16 | stargate_mslv=3 17 | socket=getg('sg_clientSocket') 18 | rc=stargate('SEND',"$$$SOCKET",socket,'$$$LINK 'IPADDR' 'MVSPort) 19 | end 20 | return 0 21 | -------------------------------------------------------------------------------- /rxlib/STARGDLI.rexx: -------------------------------------------------------------------------------- 1 | call SGFSSini 2 | slino=5 3 | do forever 4 | ADDRESS FSS 5 | 'RESET' 6 | CALL FSSTITLE 'Stargate Deliver Dataset ',#WHITE 7 | call fsstext('File(s) are sent to Server 'getg('SG_IPADDR'),3,7,,#white) 8 | nxt =sgfield("Dataset", "Dataset ===>",slino,3,52) 9 | call fsstext('Enter fully qualified ds-name or dsn(member)',slino+2,3,, 10 | #white) 11 | call fsstext('A partitioned dsn (w.o. member) will be entirely sent', 12 | slino+3,3,,#white) 13 | call fsstext('"You know it don'"'"'t come easy"',18,25,,#white) 14 | call fssmessage FSSHeight()-1 15 | call fsscursor("Dataset") 16 | call fssdisplay() 17 | 'GET AID AID' 18 | if aid=243 | aid=244 then return 4 19 | call SGfetchVars 20 | if dataset='' then iterate 21 | stargate_mslv=0 /* All Messages ! */ 22 | socket=getg('sg_clientSocket') 23 | rc=stargate('SEND',"$$$SOCKET",socket,'$$$DELIVER 'Dataset) 24 | end 25 | return 0 26 | -------------------------------------------------------------------------------- /rxlib/STARGRCF.rexx: -------------------------------------------------------------------------------- 1 | call SGFSSini 2 | slino=5 3 | do forever 4 | ADDRESS FSS 5 | 'RESET' 6 | CALL FSSTITLE 'Stargate Request Dataset from Server',#WHITE 7 | call fsstext('File(s) are requested from Server 'getg('SG_IPADDR'),3,7,, 8 | #white) 9 | nxt =sgfield("Dataset", "Dataset ===>",slino,3,52) 10 | call fsstext('Enter fully qualified ds-name or dsn(member)',slino+2,3,, 11 | #white) 12 | call fsstext('A partitioned dsn (w.o. member) will be entirely received', 13 | slino+3,3,,#white) 14 | call fsstext('"What Ever You Want"',18,25,,#white) 15 | call fssmessage FSSHeight()-1 16 | call fsscursor("Dataset") 17 | call fssdisplay() 18 | 'GET AID AID' 19 | if aid=243 | aid=244 then return 4 20 | call SGfetchVars 21 | if dataset='' then iterate 22 | stargate_mslv=0 /* All Messages ! */ 23 | socket=getg('sg_clientSocket') 24 | if socket<0 then return 8 25 | rc=stargate('SEND',"$$$SOCKET",socket,'$$$RECEIVE 'Dataset' 'message) 26 | end 27 | return 0 28 | -------------------------------------------------------------------------------- /rxlib/STARGSND.rexx: -------------------------------------------------------------------------------- 1 | call SGFSSini 2 | slino=5 3 | do forever 4 | ADDRESS FSS 5 | 'RESET' 6 | CALL FSSTITLE 'Stargate Send Message ',#WHITE 7 | call fsstext('Message(s) are sent via Server 'getg('SG_IPADDR'),3,7,, 8 | #white) 9 | nxt =sgfield("UserID", "User ID ===>",slino,3,8) 10 | nxt2=sgfield("Message","Message ===>",slino+1,3,60) 11 | call fsstext('sending "Message in a Bottle"',18,25,,#white) 12 | call fssmessage FSSHeight()-1 13 | call fsscursor("USERID") 14 | call fssdisplay() 15 | 'GET AID AID' 16 | if aid=243 | aid=244 then return 4 17 | call SGfetchVars 18 | if UserId='' then iterate 19 | stargate_mslv=0 20 | socket=getg('sg_clientSocket') 21 | rc=stargate('SEND',"$$$SOCKET",socket,'$$$SEND 'userid' 'message) 22 | end 23 | return 0 24 | -------------------------------------------------------------------------------- /rxlib/STARGSYS.rexx: -------------------------------------------------------------------------------- 1 | call SGFSSini 2 | socket=getg('sg_clientSocket') 3 | stargate_mslv=0 /* all messages in the beginning */ 4 | rc=stargate('SEND',"$$$SOCKET",socket,'$$$RXRUN SGSYS1') 5 | outbuf=getg('SG_OUTPUT') 6 | buffer.0='ARRAY 'outbuf 7 | _screen.TopRow=2 8 | _screen.TopRow.proc='syshdr' 9 | call FMTLIST ,,'System Information of 'ipaddr 10 | return 11 | syshdr: 12 | call fsstext('System Information of Server 'getg('SG_IPADDR'),1,20,,#white) 13 | return 14 | -------------------------------------------------------------------------------- /rxlib/STEMCLEN.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * Cleans STEM, removes empty and un-set places 3 | * STEMCLEN source-stem 4 | * stem must be coded with a trailing '.' 5 | * .................................. Created by PeterJ on 6. April 2019 6 | * --------------------------------------------------------------------- 7 | */ 8 | stemreor: 9 | parse arg $sfrom 10 | _smax=value($sfrom'0') 11 | if datatype(_smax)<>'NUM' then do 12 | call RXMSG 310,'E','STEM '$SFROM'0 does no contain a valid number' 13 | return -8 14 | end 15 | _#j=0 16 | do _#i=1 to _smax 17 | if value($sfrom''_#i)='' then iterate 18 | if symbol($sfrom''_#i)<>'VAR' then iterate 19 | _#j=_#j+1 20 | interpret $sfrom''_#j'='$sfrom''_#i 21 | end 22 | do _#i=_#j+1 to _smax 23 | interpret 'DROP '$sfrom''_#i 24 | end 25 | return _#j 26 | -------------------------------------------------------------------------------- /rxlib/STEMREOR.rexx: -------------------------------------------------------------------------------- 1 | /* ----------------------------------------------------------------------- 2 | * Reorders STEM, Element 1 becomes highest Element, 2 the 2. highest. ... 3 | * STEMREOR source-stem 4 | * stem must be coded with a trailing '.' 5 | * .................................... Created by PeterJ on 6. April 2019 6 | * .................................. Amended by PeterJ on 6. August 2022 7 | * Speed improvement factor 10 8 | * ----------------------------------------------------------------------- 9 | */ 10 | stemreor: 11 | parse arg $sfrom 12 | if substr($sfrom,length($sfrom),1)<>'.' then $sfrom=$sfrom'.' 13 | _#smax=value($sfrom'0') 14 | if datatype(_#smax)<>'NUM' then , 15 | call STOP 'STEM '$SFROM'0 does not contain a valid number' 16 | _#m=_#smax%2 17 | _#h=_#smax 18 | l1="do _#i=1 for _#m; _$t="$SFROM"_#h;"$SFROM"_#h="$SFROM"_#i" 19 | l2=$SFROM"_#i=_$t;_#h=_#h-1; end;return" 20 | __token=filter(time('L'),'.:') 21 | call setg('__str'__token,l1';'l2) 22 | interpret 'call __str'__token 23 | return _#smax 24 | -------------------------------------------------------------------------------- /rxlib/STICKY.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * STICKY Command to switch on/off sticky notes (used in FSS) 3 | * --------------------------------------------------------------------- 4 | */ 5 | Sticky: procedure expose sticky. zerrsm zerrlm 6 | parse upper arg stin 7 | w1=word(stin,1) 8 | if abbrev('SHOW',w1,2)>0 then return stickysh(subword(stin,2)) 9 | else do 10 | trace results 11 | result=0 12 | stin=translate(stin,,',') 13 | stnr=word(stin,1) 14 | mode=word(stin,2) 15 | if stnr='OFF' then do _sti=1 to sticky.0 16 | sticky.__active._sti=0 17 | end 18 | else if stnr='ON' then do _sti=1 to sticky.0 19 | sticky.__active._sti=1 20 | end 21 | else do 22 | if datatype(stnr)<>'NUM' then return 8 23 | if mode='OFF' then sticky.__active.stnr=0 24 | else sticky.__active.stnr=1 25 | end 26 | end 27 | return result 28 | -------------------------------------------------------------------------------- /rxlib/STICKYSH.rexx: -------------------------------------------------------------------------------- 1 | /* ----------------------------------------------------------------- 2 | * Displaying a predefined Sticky Note 3 | * ----------------------------------------------------------------- 4 | */ 5 | stickysh: 6 | parse upper arg exec 7 | callError=0 8 | if substr(exec,1,2)<>'ST' then rexec='ST'exec 9 | else rexec=exec 10 | lrc=load(rexec) 11 | if lrc>0 then do 12 | call setg('STICKY_'rxec,-1) 13 | zerrlm='*** 'exec' Error' 14 | zerrsm='*** 'exec' Error' 15 | callError=1 16 | return 8 17 | end 18 | interpret 'rc='rexec'()' 19 | sticky.errormsg=exec' started' 20 | return 0 21 | -------------------------------------------------------------------------------- /rxlib/STMTT.rexx: -------------------------------------------------------------------------------- 1 | /* ----------------------------------------------------------------- 2 | * Part One Sticky Note for Master Trace Table 3 | * ----------------------------------------------------------------- 4 | */ 5 | alias=gettoken() /* define alias (for stems) */ 6 | call fssticky 'Trace Table',alias,,,10,50 /* Create FSS Screen defs */ 7 | sticky.alias.__refresh=15 /* refresh every n seconds */ 8 | /* rexx call to update sticky note */ 9 | sticky.alias.__fetch="call StickyMasterTT "alias",10" 10 | return 0 11 | /* ----------------------------------------------------------------- 12 | * Part Two Procedure to create the sticky Content 13 | * ----------------------------------------------------------------- 14 | */ 15 | StickyMasterTT: 16 | parse arg __alias,maxl 17 | if mtt('REFRESH')<0 then _line.0=0 18 | j=0 19 | maxl=max(_line.0-maxl+1,1) 20 | do i=maxl to _line.0 21 | j=j+1 22 | sticky.__alias.j=_line.i 23 | end 24 | return 0 25 | -------------------------------------------------------------------------------- /rxlib/STSMSG.rexx: -------------------------------------------------------------------------------- 1 | /* ----------------------------------------------------------------- 2 | * Part One Sticky Note for User Info 3 | * ----------------------------------------------------------------- 4 | */ 5 | alias=gettoken() /* define alias (for stems) */ 6 | /* Create FSS Screen defs */ 7 | call fssticky 'SMSG',alias,1,,1,16,#turq'+'#uscore,'PLAIN' 8 | sticky.alias.__refresh=1 /* refresh every n seconds */ 9 | sticky.alias.__fetch="" 10 | return 0 11 | /* ----------------------------------------------------------------- 12 | * Part Two not needed 13 | * ----------------------------------------------------------------- 14 | */ 15 | -------------------------------------------------------------------------------- /rxlib/TODAY.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * Today's Date Today() or for a date in the past 3 | * TODAY(>) 4 | * .............................. Created by PeterJ on 22. February 2019 5 | * ................................ Modified by PeterJ on 22. March 2020 6 | * --------------------------------------------------------------------- 7 | */ 8 | today: Procedure 9 | return RXDATE(arg(1),arg(2),arg(3)) 10 | -------------------------------------------------------------------------------- /rxlib/TSOUSERS.rexx: -------------------------------------------------------------------------------- 1 | TSOuser: 2 | parse arg stem 3 | if stem='' then stem='tsouser.' 4 | usri=0 5 | cvt=peeka(16) 6 | asvt=peeka(cvt+556)+512 /* get asvt */ 7 | asvtmaxu=peeka(asvt+4) /* get max asvt entries */ 8 | do aix = 0 to asvtmaxu - 1 9 | ascb=peeks(asvt+16+aix*4,4) /* get ptr to ascb (skip */ 10 | if bitand(ascb,'80000000'x)<>'00000000'x then iterate 11 | ascb=c2d(ascb) /* get ascb address */ 12 | cscb=peeka(ascb+56) /* get cscb address */ 13 | chtrkid=peeks(cscb+28,1) /* check addr space type */ 14 | if chtrkid<>'01'x then iterate /* 01x is tso user */ 15 | ascbjbns=peeka(ascb+176) /* get ascbjbns */ 16 | usri=usri+1 17 | interpret stem'usri=peeks(ascbjbns,8)' /* we is some happy camper! */ 18 | end 19 | interpret stem'0=usri' 20 | return 0 21 | -------------------------------------------------------------------------------- /rxlib/UNQUOTE.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * UNQUOTE String (remove delimeters from string) 3 | * Unquote(string) 4 | * if 1. char is " and last char is " they will be removed 5 | * if 1. char is ' and last char is ' they will be removed 6 | * if 1. char is ( and last char is ) they will be removed 7 | * if 1. char is < and last char is > they will be removed 8 | * ...............................Created by PeterJ on 11. December 2018 9 | * ...............................Amended by PeterJ on 30. March 2019 10 | * --------------------------------------------------------------------- 11 | */ 12 | UNQuote: procedure 13 | parse arg unq 14 | _n=length(unq) 15 | _f=substr(unq,1,1) 16 | _l=substr(unq,_n,1) 17 | if _f='"' & _l='"' then _u=1 18 | else if _f="'" & _l="'" then _u=1 19 | else if _f='(' & _l=')' then _u=1 20 | else if _f='<' & _l=">" then _u=1 21 | else if _f='[' & _l="]" then _u=1 22 | if _u=1 then return substr(unq,2,_n-2) 23 | return unq 24 | -------------------------------------------------------------------------------- /samples/#BROWSE.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * Display Allocted DSNs in a Formatted List Screen 3 | * --------------------------------------------------------------------- 4 | */ 5 | CALL LISTALC 'BUFFER' /* write allocated DSNs into stem BUFFER. */ 6 | call FMTLIST /* Display stem BUFFER. */ 7 | -------------------------------------------------------------------------------- /samples/#SELMEM.rexx: -------------------------------------------------------------------------------- 1 | /* REXX */ 2 | 3 | CALL IMPORT FSSAPI 4 | ADDRESS FSS 5 | 6 | CALL FSSINIT 7 | 8 | CENTER=FSSWIDTH()%2 9 | LAST=FSSHEIGHT() 10 | 11 | CALL FSSTITLE 'BREXX/370', #BLUE 12 | 13 | CALL FSSTEXT "Specify member name to recompile,",4,CENTER - 16,,#PROT+#WHITE 14 | CALL FSSTEXT "or leave field empty for full rebuid.",5,CENTER - 18,,#PROT+#WHITE 15 | 16 | NXT = FSSTEXT( "Member name" , 8, CENTER - 17, , #PROT+#TURQ) 17 | NXT = FSSTEXT( "===>" , 8, NXT , , #PROT+#HI+#WHITE) 18 | NXT = FSSFIELD( 'MEMBER' , 8, NXT , 8, #HI+#RED+#USCORE, '') 19 | NXT = FSSTEXT( "Debug ?" , 8, NXT , , #PROT+#TURQ) 20 | NXT = FSSFIELD( 'DEBUG' , 8, NXT , 1, #HI+#RED+#USCORE, 'N') 21 | 22 | CALL FSSCURSOR 'MEMBER' 23 | 24 | DO FOREVER 25 | RCKEY=FSSREFRESH() /* DISPLAY/REFRESH FORMATTED SCREEN */ 26 | IF RCKEY==#PFK03 | RCKEY==#PFK15 THEN LEAVE 27 | END 28 | CALL FSSCLOSE 29 | -------------------------------------------------------------------------------- /samples/$ABEND.rexx: -------------------------------------------------------------------------------- 1 | /* REXX ************************************************************** * 2 | * LET THE BREXX/370 HAVE A NICE ABEND * 3 | * ******************************************************************* */ 4 | ABEND(42) 5 | -------------------------------------------------------------------------------- /samples/$DATETIM.rexx: -------------------------------------------------------------------------------- 1 | say copies('-',60) 2 | say "Date Time Functions" 3 | say copies('-',60) 4 | s1=datetime('T') 5 | s2=datetime('E',s1,'T') 6 | say "DateTime stamp of today: "s1 7 | say "DateTime re-converted: "s2 8 | -------------------------------------------------------------------------------- /samples/$DSINFO.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * Report Information from Datasets or DDN Allocations 3 | * --------------------------------------------------------------------- 4 | */ 5 | SAY ISDSN("EXEC") 6 | SAY ISDSN("'BREXX.RXLIB'") 7 | SAY ISDSN("'SYS2.LINKLIB'") 8 | SAY ISDSN('SYSPROC') 9 | SAY ISDSN("'SYS2.LINKLIB'") 10 | SAY ISDSN("'BREXX.RXLIB'") 11 | isdsn: 12 | rc=LISTDSI(arg(1)) 13 | say 'Dataset Name 'SYSDSNAME 14 | say 'Volume 'SYSVOLUME 15 | say 'DSORG 'SYSDSORG 16 | say 'RECFM 'SYSRECFM 17 | say 'LRECL 'SYSLRECL 18 | say 'BLKSIZE 'SYSBLKSIZE 19 | return rc 20 | -------------------------------------------------------------------------------- /samples/$DSORG.rexx: -------------------------------------------------------------------------------- 1 | call LISTDSI "'BREXX.RXLIB'" 2 | say sysdsname sysdsorg 3 | call LISTDSI "'SYS2.PROCLIB'" 4 | say sysdsname sysdsorg 5 | call LISTDSI "exec" 6 | say sysdsname sysdsorg 7 | -------------------------------------------------------------------------------- /samples/$ETIME.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * Example TIMEs PEJ 3. December 2018 3 | * --------------------------------------------------------------------- 4 | */ 5 | say copies('-',60) 6 | say "Some Time functions" 7 | say copies('-',60) 8 | say 'Time Now : 'time('L') 9 | say 'Time since midnight: 'Time('S')' (time in seconds)' 10 | say 'Time since midnight: 'time('hs')' (time in hundreds of seconds)' 11 | say 'Time since midnight: 'time('LS')' (time in micro seconds)' 12 | -------------------------------------------------------------------------------- /samples/$PDSDIR.rexx: -------------------------------------------------------------------------------- 1 | say copies('-',60) 2 | say "Display Directory of SYS2.PROCLIB" 3 | say copies('-',60) 4 | /* The directory is provided in the stem variable DIRENTRY. 5 | DIRENTRY.0 contains the number of directory members 6 | DIRENTRY.n.CDATE creation date of the member, e.g. => "19-04-18" 7 | DIRENTRY.n .INIT" initial size of member 8 | DIRENTRY.n.MOD" mod level 9 | DIRENTRY.n.NAME member name 10 | DIRENTRY.n.SIZE" current size of member 11 | DIRENTRY.n.TTR TTR of member 12 | DIRENTRY.n.UDATE last update date, e.g. " 20-06-09" 13 | DIRENTRY.n.UID last updated by user- id 14 | DIRENTRY.n.UTIME" last updated time 15 | DIRENTRY.n.CDATE creation date 16 | */ 17 | call DIR("'sys2.proclib'") 18 | do i=1 to direntry.0 19 | say left(direntry.i.name,9)Direntry.i.ttr 20 | end 21 | -------------------------------------------------------------------------------- /samples/$RXMSG.rexx: -------------------------------------------------------------------------------- 1 | say '**** Print all Messages' 2 | call display 3 | say '**** Print only Warning Messages and above' 4 | rxmslv='W' /* Print only Warning Messages and above */ 5 | call display 6 | say '**** Print only Error Messages and above' 7 | rxmslv='E' /* Print only Error Messages */ 8 | call display 9 | exit 10 | /* --------------------------------------------------------------------- 11 | * Demonstrate usage of Message Command 12 | * --------------------------------------------------------------------- 13 | */ 14 | Display: 15 | rc=rxmsg( 10,'I','Program started') 16 | call vars 17 | rc=rxmsg(200,'W','Value missing') 18 | call vars 19 | rc=rxmsg(100,'E','Value not Numeric') 20 | call vars 21 | rc=rxmsg(999,'C','Divisor is zero') 22 | call vars 23 | return 24 | /* --------------------------------------------------------------------- 25 | * Message Variables return 26 | * --------------------------------------------------------------------- 27 | */ 28 | vars: 29 | say '*** Variables returned from RXMSG Call' 30 | say ' RC : 'rc 31 | say ' MSLV: 'mslv 32 | say ' MSTX: 'mstx 33 | say ' MSLN: 'msln 34 | return 35 | -------------------------------------------------------------------------------- /samples/$VERSION.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * Report Version Information and Build Date of BREXX 3 | * --------------------------------------------------------------------- 4 | */ 5 | say version() 6 | say version('FULL') 7 | -------------------------------------------------------------------------------- /samples/$WAIT.rexx: -------------------------------------------------------------------------------- 1 | /* REXX ************************************************************** * 2 | * LET THE BREXX/370 HAVE A BREAK * 3 | * ******************************************************************* */ 4 | PARSE ARG seconds 5 | say copies('-',60) 6 | say "Wait a bit" 7 | say copies('-',60) 8 | if seconds > 0 then call wait(seconds*1000) 9 | else do 10 | say time() 11 | call wait(42000) /* wait 42s */ 12 | say time() 13 | end 14 | -------------------------------------------------------------------------------- /samples/$WTO.rexx: -------------------------------------------------------------------------------- 1 | /* REXX ************************************************************** * 2 | * LET THE BREXX/370 HAVE A TALK * 3 | * ******************************************************************* */ 4 | CALL WTO('The Ultimate Answer to Life, The Universe and Everything is...42!') 5 | -------------------------------------------------------------------------------- /samples/AFLOAT.rexx: -------------------------------------------------------------------------------- 1 | say copies('-',60) 2 | say "Create a Float Array" 3 | say copies('-',60) 4 | f1=fcreate(100) 5 | do i=1 to 51 /* I * PI / Euler */ 6 | call fset(f1,i,i*3.14/0.5772156649) 7 | end 8 | call flist(f1,,,"Float Array") 9 | say copies('-',60) 10 | say "After some float operations" 11 | say copies('-',60) 12 | do i=1 to 51 /* I * PI / Euler */ 13 | say right(i,3,'0') fget(f1,i)*fget(f1,random(1,50)) 14 | end 15 | -------------------------------------------------------------------------------- /samples/AINT.rexx: -------------------------------------------------------------------------------- 1 | say copies('-',60) 2 | say "Create an Integer Array" 3 | say copies('-',60) 4 | i1=Icreate(100,"DENUMERATE") 5 | say iarray(i1) 6 | call ilist(i1,,,'Denumerated Integer Array') 7 | -------------------------------------------------------------------------------- /samples/ALLCHARS.rexx: -------------------------------------------------------------------------------- 1 | /* 2 | * Print all characters supported by BREXX.R(BANNER) 3 | */ 4 | ADDRESS MVS 5 | call banner "ABCDEFGH" 6 | call banner "IJKLMNOPQ" 7 | call banner "RSTUVWXYZ" 8 | call banner "abcdefgh" 9 | call banner "ijklmnopq" 10 | call banner "rstuvwxyz" 11 | call banner "0123456789" 12 | call banner "^£²·©Õ¶´½¾" 13 | call banner "±¿Ð]¯×ôöÔÖ" 14 | call banner "€®+-Æ*¬=¥%" 15 | call banner "¢$@§&.,;:?" 16 | call banner "(|)<>[]{}!" 17 | call banner "'ðÞ/\_#" || '"' 18 | say "ABCDEFGH" 19 | say "IJKLMNOPQ" 20 | say "RSTUVWXYZ" 21 | say "abcdefgh" 22 | say "ijklmnopq" 23 | say "rstuvwxyz" 24 | say "0123456789" 25 | say "^£²·©Õ¶´½¾" 26 | say "±¿Ð]¯×ôöÔÖ" 27 | say "€®+-Æ*¬=¥%" 28 | say "¢$@§&.,;:?" 29 | say "(|)<>[]{}!" 30 | say "'ðÞ/\_#" || '"' 31 | -------------------------------------------------------------------------------- /samples/BASE64.rexx: -------------------------------------------------------------------------------- 1 | say copies('-',60) 2 | say "Base 64 Encoding/Decoding" 3 | say copies('-',60) 4 | str='The quick brown fox jumps over the lazy dog, has nothing better to do!' 5 | stre=base64Enc(str) 6 | say 'Encoded 'stre 7 | strd=base64Dec(stre) 8 | say 'Original "'strd'"' 9 | say 'Decoded "'strd'"' 10 | -------------------------------------------------------------------------------- /samples/BLOCK.rexx: -------------------------------------------------------------------------------- 1 | 2 | /* This program is block structured ! */ 3 | /* Author unknown - ported to REXX from ND Fortran by */ 4 | /* Anders Christensen -- anders@solan.unit.no */ 5 | 6 | signal=(interpret=value);value=(interpret> BREXX, enter valid BREXX statement, or EXIT to leave" 13 | parse external cmd 14 | interpret cmd 15 | end 16 | error: 17 | say 'unknown command: 'cmd 18 | signal loop 19 | syntax: 20 | say 'Syntax Error: 'cmd 21 | signal loop 22 | -------------------------------------------------------------------------------- /samples/FACTRIAL.rexx: -------------------------------------------------------------------------------- 1 | /* recursion test of factorial */ 2 | /* note: this implementation of rexx uses two kinds of 3 | of numbers integers (C long (4-bytes) numbers from -2E9 upto 2E9), 4 | and real (C double precision numbers). It's better 5 | to use a real number ie 45.0 instead of 45 for large 6 | factorials since the later will result to a factorial using 7 | integer arithmetic resulting in a crazy result 8 | (15 is the largest integer factorial that can be calculated 9 | with out any error ) 10 | */ 11 | numeric digits 20 12 | if arg() ¬= 1 then do 13 | say 'Enter a number' 14 | pull num 15 | end; else do 16 | num = arg(1) 17 | end 18 | 19 | if datatype(num) ¬= 'NUM' | num < 0 then do 20 | say 'Invalid number "'num'"' 21 | exit 2 22 | end 23 | 24 | /* you can even translate the number to real with the following instr */ 25 | /* num = num + 0.0 /* so from now on num will be treated as real */ */ 26 | 27 | say num'! = ' trunc(fact(num)) 28 | exit 29 | 30 | fact: procedure 31 | if arg(1)<=0 then return 1 32 | return fact(arg(1)-1)*arg(1) 33 | -------------------------------------------------------------------------------- /samples/FIFO.rexx: -------------------------------------------------------------------------------- 1 | max=25 2 | /* ------------------------------------------- 3 | * FIFO stack Example 4 | * ------------------------------------------- 5 | */ 6 | call time('R') 7 | st1=FIFO("cREATE",'LIFO Stack') 8 | do i=1 to max 9 | call FIFO("PUSH",st1,'FRED 'i) 10 | end 11 | say copies('-',50) 12 | say "report on LIFO stack" 13 | say copies('-',50) 14 | do i=1 until llcurrent=0 15 | say FIFO("PULL",st1) 16 | end 17 | -------------------------------------------------------------------------------- /samples/GETCMT.rexx: -------------------------------------------------------------------------------- 1 | say copies('-',60) 2 | say "Select Data Sections out of REXX comment" 3 | say copies('-',60) 4 | 5 | /* DATA STEM mystem. 6 | Line 1 7 | Line 2 8 | Line 3 9 | Line 4 10 | Line 5 11 | Line 6 12 | Line 7 13 | */ 14 | 15 | /* DATA SARRAY sname 16 | Record 1 17 | Record 2 18 | Record 3 19 | Record 4 20 | Record 5 21 | */ 22 | 23 | /* fetch data from DATA comments */ 24 | call getdata('GETCMT') 25 | /* print content */ 26 | call slist sname,,,"Content of first Data Comment block" 27 | call stemlist 'mystem',,,"Content of second Data Comment block" 28 | return 29 | -------------------------------------------------------------------------------- /samples/IPLDATE.rexx: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------- 2 | * Returns the estimated IPLDATE 3 | * -------------------------------------------------------------------- 4 | */ 5 | IPLDate: 6 | say 'IPL Monitor' 7 | say '-----------' 8 | $iplsec=mvsvar('MVSUP') /* MVS up time in seconds */ 9 | $ipldays=$iplsec%86400 /* days MVS is running */ 10 | $iplrem=$iplsec//86400%1 /* remaining seconds */ 11 | days1900=date('b')-$ipldays /* calculate days since 1.1.1900 */ 12 | $iplsec=time('s')-$iplrem 13 | do while $iplsec<0 14 | $iplsec=$iplsec+86400 15 | days1900=days1900-1 16 | end 17 | $ipldate=date(,days1900,'B') /* convert it back normal date */ 18 | $iplwday=date('WEEKDAY',days1900,'B') /* convert it normal date*/ 19 | $iplsec=sec2time($iplsec) 20 | $iplrem=sec2time($iplrem) 21 | $Time=time('l') 22 | say ' Current Time '$TIME 23 | say ' IPL on '$iplwday $ipldate' at '$iplsec 24 | say ' MVS up for '$ipldays' days '$iplrem' hours' 25 | return 26 | -------------------------------------------------------------------------------- /samples/JESVIEW.rexx: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------- 2 | * Print JES2 Spool Queue 3 | * ------------------------------------------------------------- 4 | */ 5 | spool=JESQUEUE() 6 | if spool = -8 then return 7 | say ' Job Name Number Class' 8 | say copies('-',40) 9 | do i=1 to sarray(spool) 10 | say right(i,3)' 'sget(spool,i) 11 | end 12 | -------------------------------------------------------------------------------- /samples/LIFO.rexx: -------------------------------------------------------------------------------- 1 | max=25 2 | /* ------------------------------------------- 3 | * LIFO stack Example 4 | * ------------------------------------------- 5 | */ 6 | call time('R') 7 | st1=LIFO("cREATE",'LIFO Stack') 8 | do i=1 to max 9 | call LIFO("PUSH",st1,'Entry 'i) 10 | end 11 | say copies('-',50) 12 | say "report on LIFO stack" 13 | say copies('-',50) 14 | do i=1 until llcurrent=0 15 | say LIFO("PULL",st1) 16 | end 17 | -------------------------------------------------------------------------------- /samples/LISTALC.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * LISTALC find allocated ddnames and datasets 3 | * numfiles=LISTALC() 4 | * numfiles files found 5 | * PRINT display found allocation, and return in stem variables 6 | * NOPRINT return results in stem variables 7 | * PRINT is default 8 | * Results are returned in: 9 | * listalcDDN.n contains the allocated dd name 10 | * listalcDSN.n contains the allocated dsname (incl. member, if any) 11 | * listalcDDN.0 contain the number of entries 12 | * listalcDSN.0 contain the number of entries 13 | * listalcDSN.n and listalcddn.n correspond 14 | * --------------------------------------------------------------------- 15 | */ 16 | LISTA: 17 | call listalc 'PRINT' /* Fetch all current allocations */ 18 | /* the LISTALC function out of RXLIB is used */ 19 | -------------------------------------------------------------------------------- /samples/LISTALL.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * LISTALL find all Datasets of the MVS Environment (by VTOCs) 3 | * --------------------------------------------------------------------- 4 | */ 5 | call lstall arg(1) 6 | -------------------------------------------------------------------------------- /samples/LISTNCAT.rexx: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | * LISTNCAT find all Datasets which are not catalogued (by VTOCs) 3 | * --------------------------------------------------------------------- 4 | */ 5 | call lstnCAT arg(1) 6 | -------------------------------------------------------------------------------- /samples/LL2STEM.rexx: -------------------------------------------------------------------------------- 1 | max=1000 2 | /* ------------------------------------------- 3 | * Copy LLIST into STEM 4 | * ------------------------------------------- 5 | */ 6 | LL1=LLCREATE("LLIST") 7 | do i=1 to max 8 | call LLADD(LL1,'FRED 'i) 9 | end 10 | call ll2stem(LL1,'myStem.') 11 | do i=mystem.0-10 to mystem.0 12 | say i mystem.i 13 | end 14 | exit 15 | -------------------------------------------------------------------------------- /samples/LLCOPY.rexx: -------------------------------------------------------------------------------- 1 | max=20 2 | ll1=llcreate() /* Create Linked List */ 3 | ll2=llcreate() /* Create Linked List */ 4 | call time('r') 5 | do i=1 to max 6 | adr=lladd(ll1,i". Record") 7 | end 8 | call llList ll1 9 | do i=1 to 10 10 | adr=lladd(ll2,i". Entry") 11 | end 12 | call llList ll2 13 | ll3=llcopy(ll1,,,ll2,"Copied") 14 | call llList ll3 15 | -------------------------------------------------------------------------------- /samples/LLDEL.rexx: -------------------------------------------------------------------------------- 1 | dsnin=mvsvar("REXXDSN") 2 | ll1=llread("'"dsnin"(lldata)'") /* Create Linked List */ 3 | call lllist ll1 4 | say copies('-',32) 5 | say " Delete AC/DC song " 6 | say copies('-',32) 7 | call llset(ll1,"POSITION",3) /* set to 3. Entry */ 8 | call lldel(ll1) /* remove AC/DC */ 9 | call lllist ll1 10 | call llfree ll1 11 | -------------------------------------------------------------------------------- /samples/LLREAD.rexx: -------------------------------------------------------------------------------- 1 | dsnin=mvsvar("REXXDSN") 2 | ll1=llread("'"dsnin"(lldata)'") /* Create Linked List */ 3 | say copies('-',32) 4 | say "Read External Linked List" 5 | say copies('-',32) 6 | call lllist ll1 7 | say copies('-',32) 8 | say "Write External Linked List" 9 | say copies('-',32) 10 | say "Records written: "llwrite(ll1,"'"dsnin"(lltemp)'") /* Save Linked List */ 11 | -------------------------------------------------------------------------------- /samples/LLSETX.rexx: -------------------------------------------------------------------------------- 1 | dsnin=mvsvar("REXXDSN") 2 | ll1=llread("'"dsnin"(lldata)'") /* Create Linked List */ 3 | say copies('-',32) 4 | say "Run Through Linked List" 5 | say copies('-',32) 6 | say llget(ll1,"FIRST") 7 | do while llset(ll1,"NEXT")>0 8 | say llget(ll1) 9 | end 10 | say copies('-',32) 11 | say " Add CREAM before position 2 " 12 | say copies('-',32) 13 | call llset(ll1,"POSITION",2) /* set to 2. Entry */ 14 | call llinsert(ll1,"CREAM I AM SO GLAD") 15 | call lllist ll1 16 | call llfree ll1 17 | -------------------------------------------------------------------------------- /samples/LLSORT.rexx: -------------------------------------------------------------------------------- 1 | dsnin=mvsvar("REXXDSN") 2 | ll1=llread("'"dsnin"(lldata)'") /* Create Linked List */ 3 | say copies('-',32) 4 | say "Unsorted Song List " 5 | say copies('-',32) 6 | call llList ll1 7 | call llsort ll1 8 | say copies('-',32) 9 | say "Sorted Song List " 10 | say copies('-',32) 11 | call llList ll1,,,1 12 | return 13 | -------------------------------------------------------------------------------- /samples/LLSORT2.rexx: -------------------------------------------------------------------------------- 1 | dsnin=mvsvar("REXXDSN") 2 | ll1=llread("'"dsnin"(lldata)'") /* Create Linked List */ 3 | say copies('-',32) 4 | say "Unsorted Song List " 5 | say copies('-',32) 6 | call llList ll1 7 | call llsort ll1,,31 /* sort song names */ 8 | say copies('-',32) 9 | say "Sorted Song List " 10 | say copies('-',32) 11 | call llList ll1 12 | return 13 | -------------------------------------------------------------------------------- /samples/LSELECT.rexx: -------------------------------------------------------------------------------- 1 | /* Extract Data from a certain line of a SARRAY */ 2 | say copies('-',60) 3 | say "Extract Data from a SARRAY" 4 | say copies('-',60) 5 | s1=screate(100) 6 | /* create stream */ 7 | do i=1 to 5 8 | call sset(s1,,'Record 'i) 9 | end 10 | call sset(s1,,'from here *******') /* insert begin string */ 11 | do i=1 to 3 12 | call sset(s1,,'my Data 'i) 13 | end 14 | call sset(s1,,'to there *******') /* insert end string */ 15 | do i=6 to 10 16 | call sset(s1,,'Record 'i) 17 | end 18 | call slist s1,,,"Original SARRAY" 19 | /* now extract lines */ 20 | s2=scut(s1,"from here","to there",1,"DEL") 21 | call slist s2,,,"extracted including delimiters" 22 | s3=scut(s1,"from here","to there",1,"NO-DEL") 23 | call slist s3,,,"extracted excluding delimiters" 24 | -------------------------------------------------------------------------------- /samples/LVOLUME.rexx: -------------------------------------------------------------------------------- 1 | /* BREXX */ 2 | /* ----------------------------------------------------------------------------- 3 | * Example: List Details of a Volume (first argument) 4 | * PEJ 27.12.2022 5 | * ----------------------------------------------------------------------------- 6 | */ 7 | rc=listvol(arg(1)) /* Call VTOC to retrieve Volume information */ 8 | if rc<8 then call listit 'vol' /* dump all variables prefix with VOL */ 9 | else say "Volume '"arg(1)"' not mounted/specified" 10 | return rc 11 | -------------------------------------------------------------------------------- /samples/LVTOC.rexx: -------------------------------------------------------------------------------- 1 | /* BREXX */ 2 | /* ----------------------------------------------------------------------------- 3 | * Example: List VTOC 4 | * PEJ 31.12.2022 5 | * ----------------------------------------------------------------------------- 6 | */ 7 | call vtoc arg(1),'LIST' 8 | -------------------------------------------------------------------------------- /samples/MTTSTOP.rexx: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * STOP MASTER TRACE TABLE SCAN 3 | * ------------------------------------------------------------------ 4 | */ 5 | CALL WTO 'TTSCAN STOP' 6 | -------------------------------------------------------------------------------- /samples/NJECMD.rexx: -------------------------------------------------------------------------------- 1 | /* ----------------------------------------------------------- 2 | * NJE38 Sample: Show available files in NJE38 inbox 3 | * pass command to NJE38CMD and retrieve output 4 | * ----------------------------------------------------------- 5 | */ 6 | rc=nje38CMD('NJE38 D fILes') 7 | if rc>0 then do 8 | say 'Unable to pickup NJE38 results' 9 | return 8 10 | end 11 | say copies('-',72) 12 | say center('NJE38 Spool Queue',72) 13 | say copies('-',72) 14 | do i=1 to nje38.0 15 | say nje38.i 16 | end 17 | -------------------------------------------------------------------------------- /samples/PLOT3D.rexx: -------------------------------------------------------------------------------- 1 | f.1 = '30 * exp(-z*z/100)' 2 | f.2 = 'sqrt(900.01-z*z)*.9-2' 3 | f.3 = '30*cos(z/16)-2' 4 | f.4 = '30-30*sin(z/18)' 5 | f.5 = '30*exp(-cos(z/16))-30' 6 | f.6 = '30*sin(z/10)' 7 | 8 | arg f . 9 | if datatype(f)¬='NUM' then f = 1 10 | 11 | say 12 | do x=-30 to 30 by 1.5 13 | line = '' 14 | l = 0 15 | y1 = 5 * trunc(sqrt(900 - x*x) / 5 ) 16 | do y=y1 to -y1 by -5 17 | z = trunc(25+ fn(sqrt(x*x+y*y)) - 0.7*y) 18 | if z<=l then iterate 19 | l = z 20 | line = overlay('*',line,z) 21 | end 22 | say line 23 | end 24 | exit 25 | 26 | fn: procedure expose f. f 27 | arg z 28 | interpret 'r=' f.f 29 | return r 30 | -------------------------------------------------------------------------------- /samples/README.md: -------------------------------------------------------------------------------- 1 | BREXX/270 Samples 2 | ================== 3 | 4 | This folder contains various rexx scripts that demonstrates how to use 5 | BREXX/370. 6 | 7 | It is included in the install and is typically installed to: 8 | 9 | `BREXX.$RELEASE.SAMPLES` 10 | -------------------------------------------------------------------------------- /samples/REGRESST.rexx: -------------------------------------------------------------------------------- 1 | m0=mcreate(10,3) 2 | call mcol m0,1,156.3,158.9,160.8,179.6,156.6,165.1,165.9,156.7,167.8,160.8 3 | call mcol m0,2,62,52,83,69,74,52,77,65,79,51 4 | call mcol m0,3,24,34,26,51,43,33,22,21,19,34 5 | call mprint(m0,"Data","Original Data Matrix") 6 | y0=mcreate(10,1) 7 | call mcol y0,1,47.1,46.8,49.3,53.2,47.7,49.0,50.6,47.1,51.7,47.8 8 | call mprint(y0,"Y","Result Vector") 9 | rgr=regressn(m0,y0,1) 10 | say copies('-',72) 11 | say 'Regression factors' 12 | say copies('-',72) 13 | say 'const '_regression.1 14 | do i=2 to _regression.0 15 | say 'x('i-1') '_regression.i 16 | end 17 | return 18 | mcol: 19 | parse arg mx,col 20 | do j=3 to arg() 21 | i=j-2 22 | call mset(mx,i,col,arg(j)) 23 | end 24 | return 25 | -------------------------------------------------------------------------------- /samples/REPL.rexx: -------------------------------------------------------------------------------- 1 | /* BREXX/370 */ 2 | PARSE VERSION LANG VER 3 | START: 4 | SAY "### "LANG" "VER" ###" 5 | SAY " " 6 | SAY "TYPE EXIT TO EXIT. " 7 | SAY "BREXX" 8 | LOOP: 9 | VAR = '' 10 | RC = 0 11 | PARSE UPPER EXTERNAL CMD 12 | SIGNAL ON ERROR 13 | SIGNAL ON SYNTAX 14 | INTERPRET CMD 15 | SAY 'BREXX' 16 | SIGNAL LOOP 17 | ERROR: 18 | SYNTAX: 19 | SAY 'UNKNOWN COMMAND' 20 | SIGNAL LOOP 21 | -------------------------------------------------------------------------------- /samples/S2HASH.rexx: -------------------------------------------------------------------------------- 1 | say copies('-',50) 2 | say "Read External into Sarray, select Subset" 3 | say copies('-',50) 4 | dsnin=mvsvar("REXXDSN") 5 | s1=sread("'"dsnin"(lldata)'") /* Create Linked List */ 6 | call slist s1 7 | i1=s2HASH(s1,25,,'INTERNAL') 8 | say copies('-',50) 9 | say 'Hashes from ARRAY' 10 | say copies('-',50) 11 | call ilist i1 12 | call sfree s1 13 | call ifree i1 14 | EXIT 0 15 | -------------------------------------------------------------------------------- /samples/S2STEM.rexx: -------------------------------------------------------------------------------- 1 | smax=1000 2 | s1=screate(smax) 3 | do i=1 to smax 4 | call sset(s1,,"Record "i) 5 | end 6 | call slist s1,smax-10,smax 7 | call time('r') 8 | call s2stem(s1,"Fred.") 9 | say "S2STEM "time('e') 10 | do i=smax-10 to smax 11 | say i fred.i 12 | end 13 | -------------------------------------------------------------------------------- /samples/SAPPEND.rexx: -------------------------------------------------------------------------------- 1 | say copies('-',50) 2 | say "Read External into Sarray" 3 | say copies('-',50) 4 | dsnin=mvsvar("REXXDSN") 5 | s1=sread("'"dsnin"(lldata)'") 6 | call sAPPEND(s1,s1,10,20) 7 | say copies('-',50) 8 | say 'Appended Array by itself from entry to 20' 9 | say copies('-',50) 10 | call slist s1 11 | call sfree s1 12 | EXIT 0 13 | -------------------------------------------------------------------------------- /samples/SCHANGE.rexx: -------------------------------------------------------------------------------- 1 | SAY COPIES('-',50) 2 | SAY "READ EXTERNAL INTO SARRAY, SELECT SUBSET" 3 | SAY COPIES('-',50) 4 | DSNIN=MVSVAR("REXXDSN") 5 | S1=SREAD("'"DSNIN"(LLDATA)'") /* READ DATA */ 6 | CALL SLIST S1 7 | SAY SCHANGE(S1,'IN','**','EE','+++','EY','') 8 | SAY COPIES('-',50) 9 | SAY 'CHANGED ARRAY ' 10 | SAY COPIES('-',50) 11 | CALL SLIST S1 12 | CALL SFREE S1 13 | EXIT 0 14 | -------------------------------------------------------------------------------- /samples/SDROP.rexx: -------------------------------------------------------------------------------- 1 | /* copies('-',50) 2 | say "Read External into Sarray, select Subset" 3 | say copies('-',50) */ 4 | dsnin=mvsvar("REXXDSN") 5 | s1=sread("'"dsnin"(lldata)'") /* Create Linked List */ 6 | call sDROP(s1,'AC','IN') 7 | say copies('-',50) 8 | say 'Items not containing AC or IN' 9 | say copies('-',50) 10 | call slist s1 11 | call sfree s1 12 | EXIT 0 13 | -------------------------------------------------------------------------------- /samples/SGENTRY.rexx: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------ 2 | * Stargate Client, start Menu 3 | * ------------------------------------------------------------ 4 | */ 5 | Call STARGFSS 6 | -------------------------------------------------------------------------------- /samples/SGSTART.rexx: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------- 2 | * How to start a STARGATE Server 3 | * rc=stargate('RECEIVE','xxx.xxx.xx',3205) 4 | * Add your TCP-Address or URL 5 | * ------------------------------------------------------------- 6 | */ 7 | rc=stargate('RECEIVE','xxx.xxx.xxx',3205) 8 | say 'Stargate ended with RC='rc 9 | return 10 | -------------------------------------------------------------------------------- /samples/SGTCPLST.rexx: -------------------------------------------------------------------------------- 1 | ;; ----------------------------------------------------------------- 2 | ;; Tailor the TCP Address you usually use to access Stargate Servers 3 | ;; the format is 4 | ;; IP-ADDRESS port-number comment 5 | ;; comment is optional 6 | ;; ----------------------------------------------------------------- 7 | xxxx1.yyyyyyy.dddd 3205 my system 1 8 | xxxx2.yyyyyyy.dddd 3205 my system 2 9 | xxxx3.yyyyyyy.dddd 3205 my system 3 10 | xxxx4.yyyyyyy.dddd 3205 my system 4 11 | xxxx5.yyyyyyy.dddd 3205 my system 5 12 | -------------------------------------------------------------------------------- /samples/SINPLOT.rexx: -------------------------------------------------------------------------------- 1 | do x=0 to 6.28 by 0.299 2 | y = trunc(35 * (sin(x) + 1.1)) + 1 3 | out = copies(" ",y) || "*" 4 | l = left(out,39," ") 5 | r = substr(out,41) 6 | say l || substr("|*",1+pos("*",substr(out,40,1)),1) || r 7 | end 8 | -------------------------------------------------------------------------------- /samples/SKEEP.rexx: -------------------------------------------------------------------------------- 1 | say copies('-',50) 2 | say "Read External into Sarray, select Subset" 3 | say copies('-',50) 4 | dsnin=mvsvar("REXXDSN") 5 | s1=sread("'"dsnin"(lldata)'") /* Create Linked List */ 6 | call slist s1 7 | call sKEEP(s1,'AC','IN') 8 | say copies('-',50) 9 | say 'Items containing AC or IN' 10 | say copies('-',50) 11 | call slist s1 12 | call sfree s1 13 | EXIT 0 14 | -------------------------------------------------------------------------------- /samples/SKEEPAND.rexx: -------------------------------------------------------------------------------- 1 | say copies('-',50) 2 | say "Read External into Sarray, select Subset" 3 | say copies('-',50) 4 | dsnin=mvsvar("REXXDSN") 5 | s1=sread("'"dsnin"(lldata)'") /* Create Linked List */ 6 | call slist s1 7 | call sKEEPAND(s1,'AC','IN') 8 | say copies('-',50) 9 | say 'Items containing AC AND IN' 10 | say copies('-',50) 11 | call slist s1 12 | call sfree s1 13 | EXIT 0 14 | -------------------------------------------------------------------------------- /samples/SNUMBER.rexx: -------------------------------------------------------------------------------- 1 | say copies('-',50) 2 | say "Read External into Sarray, select Subset" 3 | say copies('-',50) 4 | dsnin=mvsvar("REXXDSN") 5 | s1=sread("'"dsnin"(lldata)'") /* Create Linked List */ 6 | call slist s1 7 | call snumber(s1) 8 | say copies('-',50) 9 | say 'Array with added Line Number' 10 | say copies('-',50) 11 | call slist s1 12 | call sfree s1 13 | EXIT 0 14 | -------------------------------------------------------------------------------- /samples/SSEARCH.rexx: -------------------------------------------------------------------------------- 1 | say copies('-',50) 2 | say "Select Lines if ON is contained" 3 | say copies('-',50) 4 | dsnin=mvsvar("REXXDSN") 5 | s1=sread("'"dsnin"(lldata)'") /* Create Linked List */ 6 | ssc="ON" 7 | ssi=ssearch(s1,ssc) /* Search strin OF in array */ 8 | do while ssi>0 9 | say "Found at "ssi": "sget(s1,ssi) 10 | ssi=ssearch(s1,ssc,ssi+1) 11 | end 12 | -------------------------------------------------------------------------------- /samples/SSELECT.rexx: -------------------------------------------------------------------------------- 1 | say copies('-',50) 2 | say "Read External into Sarray, select Subset" 3 | say copies('-',50) 4 | dsnin=mvsvar("REXXDSN") 5 | s1=sread("'"dsnin"(lldata)'") /* Create Linked List */ 6 | call slist s1 7 | s2=sselect(s1,'ON','OF','EE') 8 | say copies('-',50) 9 | say 'Selected for lines containing ON, OF, EE' 10 | say copies('-',50) 11 | call slist s2 12 | call sfree(s1) 13 | call sfree(s2) 14 | EXIT 0 15 | -------------------------------------------------------------------------------- /samples/SSORT.rexx: -------------------------------------------------------------------------------- 1 | say copies('-',32) 2 | say "Read External in Sarray Sort Song List " 3 | say copies('-',32) 4 | dsnin=mvsvar("REXXDSN") 5 | s1=sread("'"dsnin"(lldata)'") /* Create Linked List */ 6 | call slist s1 7 | /* Sort Array S1 beginning column 25 (song name) */ 8 | call sqsort(s1,'ASC',31) 9 | say copies('-',32) 10 | say "Sarray sorted by Song List " 11 | say copies('-',32) 12 | call slist s1 13 | -------------------------------------------------------------------------------- /samples/SSUBSTR.rexx: -------------------------------------------------------------------------------- 1 | say copies('-',50) 2 | say "Read External into Sarray, select Subset" 3 | say copies('-',50) 4 | dsnin=mvsvar("REXXDSN") 5 | s1=sread("'"dsnin"(lldata)'") /* Create Linked List */ 6 | /* call slist s1 */ 7 | call sSUBSTR(s1,25,,'INTERNAL') 8 | say copies('-',50) 9 | say 'ARRAY from Column 25 ' 10 | say copies('-',50) 11 | call slist s1 12 | call sfree s1 13 | EXIT 0 14 | -------------------------------------------------------------------------------- /samples/STARDATE.rexx: -------------------------------------------------------------------------------- 1 | say STDATE() 2 | say STDATE('XE', 89898.41 ,'SDW') 3 | say STDATE('SDW','12/31/2322','XU') 4 | say STDATE('XE','01.00','SDW') 5 | say STDATE('XE','01.00','SDW','BASE2') 6 | say STDATE('XE',2265.11,'SDW') 7 | say STDATE('SDW','01/01/2323','XU') 8 | say STDATE('SDW','05/15/2323','XU') 9 | /* 10 | say STDATE() 77073.77 for current date of 01/28/2024 11 | say STDATE( XE , 89898.41 , SDW ) 24/11/2036 12 | say SDATE( SDW , 12/31/2322 , XU ) 375997.26 13 | say STDATE('XE','01.00','SDW') 01/01/1947 14 | say STDATE('XE','01.00','SDW', BASE2 ) 01/01/2023 15 | say SDATE( XE ,2265.11, SDW ) 07/04/1949 16 | say SDATE( SDW , 01/01/2323 , XU ) 0.00 17 | say SDATE( SDW , 05/15/2323 , XU ) 367.1 18 | */ 19 | -------------------------------------------------------------------------------- /samples/STEM2LL.rexx: -------------------------------------------------------------------------------- 1 | max=1000 2 | /* ------------------------------------------- 3 | * Copy STEM into LLIST 4 | * ------------------------------------------- 5 | */ 6 | do i=1 to max 7 | myStem.i=i". Record" 8 | end 9 | mystem.0=max 10 | call time('r') 11 | ll1=stem2ll('myStem.') 12 | say "STEM2LL "time('e') 13 | call lllist ll1,max-10,max 14 | -------------------------------------------------------------------------------- /samples/STEM2SX.rexx: -------------------------------------------------------------------------------- 1 | xmax=1000 2 | do i=1 to xmax 3 | fred.i=i". record" 4 | end 5 | FRED.0=xmax 6 | say "Set Time "time('e') 7 | call time('r') 8 | s1=stem2s("fred.") 9 | say "Copy Time "time('e') 10 | call slist s1,xmax-10,xmax 11 | -------------------------------------------------------------------------------- /samples/SUNDARAM.rexx: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------- 2 | * Sieve of Sundaram 3 | * ------------------------------------------------------------- 4 | */ 5 | arg pmax 6 | if pmax='' then pmax=300 7 | call time('r') 8 | ix=icreate(pmax,'SUNDARAM') 9 | /* print all primes */ 10 | line = "" 11 | np = 0 12 | do i = 1 to pmax 13 | line = line right(iget(ix,i),8) 14 | if length(line) <=123 then iterate 15 | say line 16 | line = "" 17 | end 18 | if length(line) > 0 then say line 19 | say pmax "primes found in "time('e')" seconds" 20 | return 21 | -------------------------------------------------------------------------------- /samples/WHOAMI.rexx: -------------------------------------------------------------------------------- 1 | /* REXX */ 2 | SAY USERID() 3 | -------------------------------------------------------------------------------- /src/rxrac.c: -------------------------------------------------------------------------------- 1 | #include "rexx.h" 2 | #include "rxdefs.h" 3 | #include "rxrac.h" 4 | #include "rac.h" 5 | #include "lstring.h" 6 | 7 | void R_raccheck(__unused int func) 8 | { 9 | int rc; 10 | 11 | if (ARGN != 3) 12 | Lerror(ERR_INCORRECT_CALL, 0); 13 | 14 | LASCIIZ(*ARG1) 15 | LASCIIZ(*ARG2) 16 | LASCIIZ(*ARG3) 17 | 18 | get_s(1); 19 | get_s(2); 20 | get_s(3); 21 | 22 | rc = rac_check(LSTR(*ARG1), LSTR(*ARG2), LSTR(*ARG3)); 23 | 24 | Licpy(ARGR, rc); 25 | } 26 | 27 | /* register rexx functions to brexx/370 */ 28 | void RxRacRegFunctions() 29 | { 30 | RxRegFunction("RACCHECK", R_raccheck, 0); 31 | } /* RxRacRegFunctions() */ 32 | -------------------------------------------------------------------------------- /src/rxregex.c: -------------------------------------------------------------------------------- 1 | #include "rexx.h" 2 | #include "rxdefs.h" 3 | #include "rxregex.h" 4 | #include "lstring.h" 5 | #include "re.h" 6 | 7 | void R_match(__unused int func) 8 | { 9 | int match_length; 10 | int match_idx; 11 | 12 | if (ARGN != 2) 13 | Lerror(ERR_INCORRECT_CALL, 0); 14 | 15 | LASCIIZ(*ARG1) 16 | LASCIIZ(*ARG2) 17 | 18 | get_s(1); 19 | get_s(2); 20 | 21 | match_idx = re_match(LSTR(*ARG1), LSTR(*ARG2), &match_length); 22 | 23 | Licpy(ARGR, match_idx); 24 | } 25 | 26 | /* register rexx functions to brexx/370 */ 27 | void RxRegexRegFunctions() 28 | { 29 | RxRegFunction("MATCH", R_match, 0); 30 | } /* RxRacRegFunctions() */ 31 | -------------------------------------------------------------------------------- /test/abbrev.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File abbrev.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("abbrev('Print','Pri')","\== 1",1) 9 | r=r+rtest("abbrev('PRINT','Pri')","== 1",2) 10 | r=r+rtest("abbrev('PRINT','PRI',4)","== 1",3) 11 | r=r+rtest("abbrev('PRINT','PRY')","== 1",4) 12 | r=r+rtest("abbrev('PRINT','')","\== 1",5) 13 | r=r+rtest("abbrev('PRINT','',1)","== 1",6) 14 | /* From: Mark Hessling */ 15 | r=r+rtest("abbrev('information','info',4)","\== 1",7) 16 | r=r+rtest("abbrev('information','',0)","\== 1",8) 17 | r=r+rtest("abbrev('information','Info',4)","== 1",9) 18 | r=r+rtest("abbrev('information','info',5)","== 1",10) 19 | r=r+rtest("abbrev('information','info ')","== 1",11) 20 | r=r+rtest("abbrev('information','info',3)","\== 1",12) 21 | r=r+rtest("abbrev('info','information',3)","== 1",13) 22 | r=r+rtest("abbrev('info','info',5)","== 1",14) 23 | say 'Done abbrev.rexx' 24 | exit r 25 | -------------------------------------------------------------------------------- /test/abs.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File abs.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("abs('12.3')","\= 12.3",1) 9 | r=r+rtest("abs(' -0.307')","\= 0.307",2) 10 | /* From: Mark Hessling */ 11 | r=r+rtest("abs(-12.345)","\== 12.345",3) 12 | r=r+rtest("abs(12.345)","\== 12.345",4) 13 | r=r+rtest("abs(-0.0)","\== 0",5) 14 | r=r+rtest("abs(0.0)","\== 0",6) 15 | say 'Done abs.rexx' 16 | exit r 17 | -------------------------------------------------------------------------------- /test/address.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File address.rexx' 3 | say left('ADDRESS',8,' ') '- test' right('1',3,' '), 4 | ".. PASS - address()" address() 5 | say 'Done address.rexx' 6 | exit 0 7 | -------------------------------------------------------------------------------- /test/b2x.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File b2x.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("b2x('11000011')","\== 'C3'",1) 9 | r=r+rtest("b2x('10111')","\== '17'",2) 10 | r=r+rtest("b2x('101')","\== '5'",3) 11 | r=r+rtest("b2x('1 1111 0000')","\== '1F0'",4) 12 | r=r+rtest("x2d(b2x('10111'))","\== '23'",5) 13 | /* From: Mark Hessling */ 14 | r=r+rtest("b2x('')","\== ''",6) 15 | r=r+rtest("b2x('0')","\== '0'",7) 16 | r=r+rtest("b2x('1')","\== '1'",8) 17 | r=r+rtest("b2x('10')","\== '2'",9) 18 | r=r+rtest("b2x('010')","\== '2'",10) 19 | r=r+rtest("b2x('1010')","\== 'A'",11) 20 | r=r+rtest("b2x('1 0101')","\== '15'",12) 21 | r=r+rtest("b2x('1 01010101')","\== '155'",13) 22 | r=r+rtest("b2x('1 0101 0101')","\== '155'",14) 23 | r=r+rtest("b2x('10101 0101')","\== '155'",15) 24 | r=r+rtest("b2x('0000 00000000 0000')","\== '0000'",16) 25 | r=r+rtest("b2x('11111111 11111111')","\== 'FFFF'",17) 26 | say 'Done b2x.rexx' 27 | exit r 28 | -------------------------------------------------------------------------------- /test/bitand.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File bitand.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("bitand('73'x,'27'x)","\== '23'x",1) 9 | r=r+rtest("bitand('13'x,'5555'x)","\== '1155'x",2) 10 | r=r+rtest("bitand('13'x,'5555'x,'74'x)","\== '1154'x",3) 11 | /* From: Mark Hessling */ 12 | r=r+rtest("bitand( '123456'x, '3456'x )","\== '101456'x",4) 13 | r=r+rtest("bitand( '3456'x, '123456'x, '99'x )","\== '101410'x",5) 14 | r=r+rtest("bitand( '123456'x,, '55'x)","\== '101454'x",6) 15 | r=r+rtest("bitand( 'foobar' )","\== 'foobar'",7) 16 | say 'Done bitand.rexx' 17 | exit r 18 | -------------------------------------------------------------------------------- /test/bitor.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File bitor.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("bitor('15'x,'24'x)","\= '35'x",1) 9 | r=r+rtest("bitor('15'x,'2456'x)","\= '3556'x",2) 10 | r=r+rtest("bitor('15'x,'2456'x,'F0'x)","\= '35F6'x",3) 11 | r=r+rtest("bitor('1111'x,,'4D'x)","\= '5D5d'x",4) 12 | /* From: Mark Hessling */ 13 | r=r+rtest("bitor( '123456'x, '3456'x )","\== '367656'x",5) 14 | r=r+rtest("bitor( '3456'x, '123456'x, '99'x )","\== '3676df'x",6) 15 | r=r+rtest("bitor( '123456'x,, '55'x)","\== '577557'x",7) 16 | r=r+rtest("bitor( 'foobar' )","\== 'foobar'",8) 17 | say 'Done bitor.rexx' 18 | exit r 19 | -------------------------------------------------------------------------------- /test/bitxor.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File bitxor.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("bitxor('12'x,'22'x)","\== '30'x",1) 9 | r=r+rtest("bitxor('1211'x,'22'x)","\== '3011'x",2) 10 | r=r+rtest("bitxor('C711'x,'222222'x,' ')","\== 'E53362'x",3) 11 | r=r+rtest("bitxor('1111'x,'444444'x,'40'x)","\== '555504'x",4) 12 | r=r+rtest("bitxor('1111'x,,'4D'x)","\== '5C5C'x",5) 13 | /* From: Mark Hessling */ 14 | r=r+rtest("bitxor( '123456'x, '3456'x )","\== '266256'x",6) 15 | r=r+rtest("bitxor( '3456'x, '123456'x, '99'x )","\== '2662cf'x",7) 16 | r=r+rtest("bitxor( '123456'x,, '55'x)","\== '476103'x",8) 17 | r=r+rtest("bitxor( 'foobar' )","\== 'foobar'",9) 18 | say 'Done bitxor.rexx' 19 | exit r 20 | -------------------------------------------------------------------------------- /test/c2x.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File c2x.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("c2x('72s')","\== 'F7F2A2'",1) 9 | r=r+rtest("c2x('0123'x)","\== '0123'",2) 10 | /* From: Mark Hessling */ 11 | r=r+rtest("c2x( 'foobar')","\== '869696828199'",3) 12 | r=r+rtest("c2x( '' )","\== ''",4) 13 | r=r+rtest("c2x( '101'x )","\== '0101'",5) 14 | r=r+rtest("c2x( '0123456789abcdef'x )","\== '0123456789ABCDEF'",6) 15 | r=r+rtest("c2x( 'ffff'x )","\== 'FFFF'",7) 16 | r=r+rtest("c2x( 'ffffffff'x )","\== 'FFFFFFFF'",8) 17 | say 'Done c2x.rexx' 18 | exit r 19 | -------------------------------------------------------------------------------- /test/center.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File center.rexx' 3 | r=0 4 | r=r+rtest("centre(abc,7)","\== ' ABC '",1) 5 | r=r+rtest("center(abc,7)","\== ' ABC '",2) 6 | r=r+rtest("center(abc,8,'-')","\== '--ABC---'",3) 7 | r=r+rtest("center('The blue sky',8)","\== 'e blue s'",4) 8 | r=r+rtest("center('The blue sky',7)","\== 'e blue '",5) 9 | /* From: Mark Hessling */ 10 | r=r+rtest("center('****',8,'-')","\=='--****--'",6) 11 | r=r+rtest("center('****',7,'-')","\=='-****--'",7) 12 | r=r+rtest("center('*****',8,'-')","\=='-*****--'",8) 13 | r=r+rtest("center('*****',7,'-')","\=='-*****-'",9) 14 | r=r+rtest("center('12345678',4,'-')","\=='3456'",10) 15 | r=r+rtest("center('12345678',5,'-')","\=='23456'",11) 16 | r=r+rtest("center('1234567',4,'-')","\=='2345'",12) 17 | r=r+rtest("center('1234567',5,'-')","\=='23456'",13) 18 | say 'Done center.rexx' 19 | exit r 20 | -------------------------------------------------------------------------------- /test/changes.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File changes.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("changestr('bc','abcabcabc','xy')","\== 'axyaxyaxy'",1) 9 | r=r+rtest("changestr('bc','abcabcabc','')","\== 'aaa'",2) 10 | r=r+rtest("changestr('','abcabcabc','xy')","\== 'abcabcabc'",3) 11 | /* From: Mark Hessling */ 12 | r=r+rtest("changestr('a','fred','c')","\== 'fred'",4) 13 | r=r+rtest("changestr('','','x')","\== ''",5) 14 | r=r+rtest("changestr('a','abcdef','x')","\== 'xbcdef'",6) 15 | r=r+rtest("changestr('0','0','1')","\== '1'",7) 16 | r=r+rtest("changestr('a','def','xyz')","\== 'def'",8) 17 | r=r+rtest("changestr('a','','x')","\== ''",9) 18 | r=r+rtest("changestr('','def','xyz')","\== 'def'",10) 19 | r=r+rtest("changestr('abc','abcdef','xyz')","\== 'xyzdef'",11) 20 | r=r+rtest("changestr('abcdefg','abcdef','xyz')","\== 'abcdef'",12) 21 | r=r+rtest("changestr('abc','abcdefabccdabcd','z')","\== 'zdefzcdzd'",13) 22 | say 'Done changes.rexx' 23 | exit r 24 | -------------------------------------------------------------------------------- /test/chars.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File chars.rexx' 3 | /* CHARS */ 4 | VER = UPPER(VERSION()) 5 | if index(VER,'(') > 0 then do 6 | VER = DELSTR(VER,INDEX(VER,'('),1) 7 | VER = DELSTR(VER,INDEX(VER,')'),1) 8 | end 9 | F = allocate('ofile',"'BREXX."||VER||".TESTS(CHRTMP)'") 10 | IF F >= 4 THEN return 8 11 | file = OPEN('ofile',"W") 12 | 13 | rc = 0 14 | call lineout file, "Line 1" 15 | call lineout file, "Line 2" 16 | call lineout file 17 | if chars(file)!=162 then do 18 | say 'failed in test 1' 19 | rc = 8 20 | end 21 | Call charin file, 30 22 | if chars(file)!=132 then do 23 | say 'failed in test 2' 24 | rc = 8 25 | end 26 | call lineout file 27 | say 'Done chars.rexx' 28 | exit rc 29 | -------------------------------------------------------------------------------- /test/compare.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File compare.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("compare('abc','abc')","\= 0",1) 9 | r=r+rtest("compare('abc','ak')","\= 2",2) 10 | r=r+rtest("compare('ab ','ab')","\= 0",3) 11 | r=r+rtest("compare('ab ','ab',' ')","\= 0",4) 12 | r=r+rtest("compare('ab ','ab','x')","\= 3",5) 13 | r=r+rtest("compare('ab-- ','ab','-')","\= 5",6) 14 | /* From: Mark Hessling */ 15 | r=r+rtest("compare('foo', 'bar')","\== 1",7) 16 | r=r+rtest("compare('foo', 'foo')","\== 0",8) 17 | r=r+rtest("compare(' ', '' )","\== 0",9) 18 | r=r+rtest("compare('foo', 'f', 'o')","\== 0",10) 19 | r=r+rtest("compare('foobar', 'foobag')","\== 6",11) 20 | say 'Done compare.rexx' 21 | exit r 22 | -------------------------------------------------------------------------------- /test/copies.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File copies.rexx' 3 | r=0 4 | r=r+rtest("copies('abc',3)","\== 'abcabcabc'",1) 5 | r=r+rtest("copies('abc',0)","\== ''",2) 6 | /* From: Mark Hessling */ 7 | r=r+rtest("copies('foo',3)","\== 'foofoofoo'",3) 8 | r=r+rtest("copies('x', 10)","\== 'xxxxxxxxxx'",4) 9 | r=r+rtest("copies('', 50)","\== ''",5) 10 | r=r+rtest("copies('', 0)","\== ''",6) 11 | r=r+rtest("copies('foobar',0 )","\== ''",7) 12 | say 'Done copies.rexx' 13 | exit r 14 | -------------------------------------------------------------------------------- /test/countst.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File countst.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("countstr('bc','abcabcabc')","\= 3",1) 9 | r=r+rtest("countstr('aa','aaaa')","\= 2",2) 10 | r=r+rtest("countstr('','a a')","\= 0",3) 11 | r=r+rtest("countstr('','def')","\== 0",4) 12 | /* From: Mark Hessling */ 13 | r=r+rtest("countstr('','')","\== 0",5) 14 | r=r+rtest("countstr('a','abcdef')","\== 1",6) 15 | r=r+rtest("countstr(0,0)","\== 1",7) 16 | r=r+rtest("countstr('a','def')","\== 0",8) 17 | r=r+rtest("countstr('a','')","\== 0",9) 18 | r=r+rtest("countstr('abc','abcdef')","\== 1",10) 19 | r=r+rtest("countstr('abcdefg','abcdef')","\== 0",11) 20 | r=r+rtest("countstr('abc','abcdefabccdabcd')","\== 3",12) 21 | say 'Done countst.rexx' 22 | exit r 23 | -------------------------------------------------------------------------------- /test/delstr.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File delstr.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("delstr('abcd',3)","\== 'ab'",1) 9 | r=r+rtest("delstr('abcde',3,2)","\== 'abe'",2) 10 | r=r+rtest("delstr('abcde',6)","\== 'abcde'",3) 11 | /* From: Mark Hessling */ 12 | r=r+rtest("delstr('Med lov skal land bygges', 6)","\== 'Med l'",4) 13 | r=r+rtest("delstr('Med lov skal land bygges', 6,10)","\== 'Med lnd bygges'",5) 14 | r=r+rtest("delstr('Med lov skal land bygges', 1)","\== ''",6) 15 | r=r+rtest("delstr('Med lov skal', 30)","\== 'Med lov skal'",7) 16 | r=r+rtest("delstr('Med lov skal', 8 , 8)","\== 'Med lov'",8) 17 | r=r+rtest("delstr('Med lov skal', 12)","\== 'Med lov ska'",9) 18 | r=r+rtest("delstr('Med lov skal', 13)","\== 'Med lov skal'",10) 19 | r=r+rtest("delstr('Med lov skal', 14)","\== 'Med lov skal'",11) 20 | r=r+rtest("delstr('', 30)","\== ''",12) 21 | say 'Done delstr.rexx' 22 | exit r 23 | -------------------------------------------------------------------------------- /test/digits.not_working: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File digits.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | /* not really supported yet */ 9 | r=r+rtest("digits()","\= 9",1) 10 | 11 | say 'Done digits.rexx' 12 | exit r 13 | -------------------------------------------------------------------------------- /test/errorms.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File errorms.rexx' 3 | /* All error msgs to standard output. */ 4 | say "printing all errortext" 5 | rc = 0 6 | do j=0 to 90 7 | call SayIt(j) 8 | end j 9 | say 'Done errorms.rexx' 10 | exit rc 11 | 12 | Sayit: 13 | text = errortext(arg(1)) 14 | if text \== '' then do 15 | say left(arg(1),6)'['text']' 16 | end 17 | return 18 | -------------------------------------------------------------------------------- /test/errorte.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File errorte.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("errortext(16)","\== 'Label not found'",1) 9 | r=r+rtest("errortext(90)","\== ''",2) 10 | /* From: Mark Hessling */ 11 | r=r+rtest("errortext(10)","\== 'Unexpected or unmatched END'",3) 12 | r=r+rtest("errortext(40)","\== 'Incorrect call to routine'",4) 13 | r=r+rtest("errortext( 1)","\== ''",5) 14 | say 'Done errorte.rexx' 15 | exit r 16 | -------------------------------------------------------------------------------- /test/factria.not_working: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File factria.rexx' 3 | numeric digits 1000 4 | arg factorial 5 | do i = 1 to factorial 6 | factorial = factorial * i 7 | end 8 | return factorial 9 | -------------------------------------------------------------------------------- /test/form.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File form.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("form()","\= 'SCIENTIFIC'",1) 9 | say 'Done form.rexx' 10 | exit r 11 | -------------------------------------------------------------------------------- /test/fuzz.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File fuzz.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("fuzz()","\= 0",1) 9 | say 'Done fuzz.rexx' 10 | exit r 11 | -------------------------------------------------------------------------------- /test/insert.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File insert.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("insert(' ','abcdef',3)","\== 'abc def'",1) 9 | r=r+rtest("insert('123','abc',5,6)","\== 'abc 123 '",2) 10 | r=r+rtest("insert('123','abc',5,6,'+')","\== 'abc++123+++'",3) 11 | r=r+rtest("insert('123','abc')","\== '123abc'",4) 12 | r=r+rtest("insert('123','abc',,5,'-')","\== '123--abc'",5) 13 | /* From: Mark Hessling */ 14 | r=r+rtest("insert('abc','def')","\== 'abcdef'",6) 15 | r=r+rtest("insert('abc','def',2)","\== 'deabcf'",7) 16 | r=r+rtest("insert('abc','def',3)","\== 'defabc'",8) 17 | r=r+rtest("insert('abc','def',5)","\== 'def abc'",9) 18 | r=r+rtest("insert('abc','def',5,,'*')","\== 'def**abc'",10) 19 | r=r+rtest("insert('abc' ,'def',5,4,'*')","\== 'def**abc*'",11) 20 | r=r+rtest("insert('abc','def',,0)","\== 'def'",12) 21 | r=r+rtest("insert('abc','def',2,1)","\== 'deaf'",13) 22 | say 'Done insert.rexx' 23 | exit r 24 | -------------------------------------------------------------------------------- /test/left.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File left.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("left('abc d',8)","\== 'abc d '",1) 9 | r=r+rtest("left('abc d',8,'.')","\== 'abc d...'",2) 10 | r=r+rtest("left('abc def',7)","\== 'abc de'",3) 11 | /* From: Mark Hessling */ 12 | r=r+rtest("left('foobar',1)","\== 'f'",4) 13 | r=r+rtest("left('foobar',0)","\== ''",5) 14 | r=r+rtest("left('foobar',6)","\== 'foobar'",6) 15 | r=r+rtest("left('foobar',8)","\== 'foobar '",7) 16 | r=r+rtest("left('foobar',8,'*')","\== 'foobar**'",8) 17 | r=r+rtest("left('foobar',1,'*')","\== 'f'",9) 18 | say 'Done left.rexx' 19 | exit r 20 | -------------------------------------------------------------------------------- /test/length.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File length.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("length('abcdefgh')","\= 8",1) 9 | r=r+rtest("length('')","\= 0",2) 10 | /* From: Mark Hessling */ 11 | r=r+rtest("length('')","\== 0",3) 12 | r=r+rtest("length('a')","\== 1",4) 13 | r=r+rtest("length('abc')","\== 3",5) 14 | r=r+rtest("length('abcdefghij')","\== 10",6) 15 | say 'Done length.rexx' 16 | exit r 17 | -------------------------------------------------------------------------------- /test/max.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File max.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("max(12,6,7,9)","\= 12",1) 9 | r=r+rtest("max(17.3,19,17.03)","\= 19",2) 10 | r=r+rtest("max(-7,-3,-4.3)","\= -3",3) 11 | /* From: Mark Hessling */ 12 | r=r+rtest("max( 10.1 )","\== '10.1'",4) 13 | r=r+rtest("max( -10.1, 3.8 )","\== '3.8'",5) 14 | r=r+rtest("max( 10.1, 10.2, 10.3 )","\== '10.3'",6) 15 | r=r+rtest("max( 10.3, 10.2, 10.3 )","\== '10.3'",7) 16 | r=r+rtest("max( 10.1, 10.2, 10.3 )","\== '10.3'",8) 17 | r=r+rtest("max( 10.1, 10.4, 10.3 )","\== '10.4'",9) 18 | r=r+rtest("max( 10.3, 10.2, 10.1 )","\== '10.3'",10) 19 | r=r+rtest("max( 1, 2, 4, 5 )","\== '5'",11) 20 | r=r+rtest("max( -0, 0 )","\== '0'",12) 21 | r=r+rtest("max( 1,2,3,4,5,6,7,8,7,6,5,4,3,2 )","\== '8'",13) 22 | say 'Done max.rexx' 23 | exit r 24 | -------------------------------------------------------------------------------- /test/min.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File min.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("min(12,6,7,9)","\= 6",1) 9 | r=r+rtest("min(17.3,19,17.03)","\= 17.03",2) 10 | r=r+rtest("min(-7,-3,-4.3)","\= -7",3) 11 | /* From: Mark Hessling */ 12 | r=r+rtest("min( 10.1 )","\== '10.1'",4) 13 | r=r+rtest("min( -10.1, 3.8 )","\== '-10.1'",5) 14 | r=r+rtest("min( 10.1, 10.2, 10.3 )","\== '10.1'",6) 15 | r=r+rtest("min( 10.1, 10.2, 10.1 )","\== '10.1'",7) 16 | r=r+rtest("min( 10.1, 10.2, 10.3 )","\== '10.1'",8) 17 | r=r+rtest("min( 10.4, 10.1, 10.3 )","\== '10.1'",9) 18 | r=r+rtest("min( 10.3, 10.2, 10.1 )","\== '10.1'",10) 19 | r=r+rtest("min( 5, 2, 4, 1 )","\== '1'",11) 20 | r=r+rtest("min( -0, 0 )","\== '0'",12) 21 | r=r+rtest("min( 8,2,3,4,5,6,7,1,7,6,5,4,3,2 )","\== '1'",13) 22 | say 'Done min.rexx' 23 | exit r 24 | -------------------------------------------------------------------------------- /test/pos.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File pos.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("pos('day','Saturday')","\= 6",1) 9 | r=r+rtest("pos('x','abc def ghi')","\= 0",2) 10 | r=r+rtest("pos(' ','abc def ghi')","\= 4",3) 11 | r=r+rtest("pos(' ','abc def ghi',5)","\= 8",4) 12 | /* From: Mark Hessling */ 13 | r=r+rtest("pos('foo','a foo foo b')","\== 3",5) 14 | r=r+rtest("pos('foo','a foo foo',3)","\== 3",6) 15 | r=r+rtest("pos('foo','a foo foo',4)","\== 7",7) 16 | r=r+rtest("pos('foo','a foo foo b',30)","\== 0",8) 17 | r=r+rtest("pos('foo','a foo foo b',1)","\== 3",9) 18 | r=r+rtest("pos('','a foo foo b')","\== 0",10) 19 | r=r+rtest("pos('foo','')","\== 0",11) 20 | r=r+rtest("pos('','')","\== 0",12) 21 | r=r+rtest("pos('b' , 'a')","\== 0",13) 22 | r=r+rtest("pos('b','b')","\== 1",14) 23 | r=r+rtest("pos('b','abc')","\== 2",15) 24 | r=r+rtest("pos('b','def')","\== 0",16) 25 | r=r+rtest("pos('foo','foo foo b')","\== 1",17) 26 | say 'Done pos.rexx' 27 | exit r 28 | -------------------------------------------------------------------------------- /test/qualify.not_working: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File qualify.rexx' 3 | say "Look for path prefix." 4 | 5 | say qualify("qualify.cmd") 6 | 7 | 8 | -------------------------------------------------------------------------------- /test/random.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File random.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("random()","< 0",1) 9 | r=r+rtest("random(5,8)","< 5",2) 10 | r=r+rtest("random(5,8)","> 8",3) 11 | r=r+rtest("random(2)","< 2",4) 12 | rando = "\==" random(,,1989) 13 | r=r+rtest("random(,,1989)",rando,5) 14 | say 'Done random.rexx' 15 | exit r 16 | -------------------------------------------------------------------------------- /test/reverse.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File reverse.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("reverse('ABc.')","\== '.cBA'",1) 9 | r=r+rtest("reverse('XYZ ')","\== ' ZYX'",2) 10 | r=r+rtest("reverse('Tranquility')","\== 'ytiliuqnarT'",3) 11 | /* From: Mark Hessling */ 12 | r=r+rtest("reverse('foobar')","\== 'raboof'",4) 13 | r=r+rtest("reverse('')","\== ''",5) 14 | r=r+rtest("reverse('fubar')","\== 'rabuf'",6) 15 | r=r+rtest("reverse('f')","\== 'f'",7) 16 | r=r+rtest("reverse(' foobar ')","\== ' raboof '",8) 17 | say 'Done reverse.rexx' 18 | exit r 19 | -------------------------------------------------------------------------------- /test/right.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File right.rexx' 3 | r=0 4 | r=r+rtest("right('abc d',8)","\== ' abc d'",1) 5 | r=r+rtest("right('abc def',5)","\== 'c def'",2) 6 | r=r+rtest("right('12',5,'0')","\== '00012'",3) 7 | /* From: Mark Hessling */ 8 | r=r+rtest("right('',4)","\== ' '",4) 9 | r=r+rtest("right('foobar',0)","\== ''",5) 10 | r=r+rtest("right('foobar',3)","\== 'bar'",6) 11 | r=r+rtest("right('foobar',6)","\== 'foobar'",7) 12 | r=r+rtest("right('foobar',8)","\== ' foobar'",8) 13 | r=r+rtest("right('foobar',8,'*')","\== '**foobar'",9) 14 | r=r+rtest("right('foobar',4,'*')","\== 'obar'",10) 15 | say 'Done right.rexx' 16 | exit r 17 | -------------------------------------------------------------------------------- /test/sign.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File sign.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("sign('12.3')","\= 1",1) 9 | r=r+rtest("sign(0.0)","\= 0",2) 10 | r=r+rtest("sign(' -0.307')","\= -1",3) 11 | /* From: Mark Hessling */ 12 | r=r+rtest("sign('0')","\== 0",4) 13 | r=r+rtest("sign('-0')","\== 0",5) 14 | r=r+rtest("sign('0.4')","\== 1",6) 15 | r=r+rtest("sign('-10')","\== -1",7) 16 | r=r+rtest("sign('15')","\== 1",8) 17 | say 'Done sign.rexx' 18 | exit r 19 | -------------------------------------------------------------------------------- /test/sourcel.not_working: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File sourcel.rexx' 3 | say SourceLine(1) 4 | say sourcetest() 5 | -------------------------------------------------------------------------------- /test/strip.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File strip.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("strip(' ab c ')","\== 'ab c'",1) 9 | r=r+rtest("strip(' ab c ','L')","\== 'ab c '",2) 10 | r=r+rtest("strip(' ab c ','t')","\== ' ab c'",3) 11 | r=r+rtest("strip('12.7000',,0)","\== '12.7'",4) 12 | r=r+rtest("strip('0012.7000',,0)","\== '12.7'",5) 13 | /* From: Mark Hessling */ 14 | r=r+rtest("strip(' foo bar ')","\== 'foo bar'",6) 15 | r=r+rtest("strip(' foo bar ','L')","\== 'foo bar '",7) 16 | r=r+rtest("strip(' foo bar ','T')","\== ' foo bar'",8) 17 | r=r+rtest("strip(' foo bar ','B')","\== 'foo bar'",9) 18 | r=r+rtest("strip(' foo bar ','B','*')","\== ' foo bar '",10) 19 | r=r+rtest("strip(' foo bar',,'r')","\== ' foo ba'",11) 20 | say 'Done strip.rexx' 21 | exit r 22 | -------------------------------------------------------------------------------- /test/substr.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File substr.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("substr('abc',2)","\== 'bc'",1) 9 | r=r+rtest("substr('abc',2,4)","\== 'bc '",2) 10 | r=r+rtest("substr('abc',2,6,'.')","\== 'bc....'",3) 11 | /* From: Mark Hessling */ 12 | r=r+rtest("substr('foobar',2,3)","\== 'oob'",4) 13 | r=r+rtest("substr('foobar',3)","\== 'obar'",5) 14 | r=r+rtest("substr('foobar',3,6)","\== 'obar '",6) 15 | r=r+rtest("substr('foobar',3,6,'*')","\== 'obar**'",7) 16 | r=r+rtest("substr('foobar',6,3)","\== 'r '",8) 17 | r=r+rtest("substr('foobar',8,3)","\== ' '",9) 18 | say 'Done substr.rexx' 19 | exit r 20 | -------------------------------------------------------------------------------- /test/subword.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File subword.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("subword('Now is the time',2,2)","\== 'is the'",1) 9 | r=r+rtest("subword('Now is the time',3)","\== 'the time'",2) 10 | r=r+rtest("subword('Now is the time',5)","\== ''",3) 11 | /* From: Mark Hessling */ 12 | r=r+rtest("subword(' to be or not to be ',5)","\== 'to be'",4) 13 | r=r+rtest("subword(' to be or not to be ',6)","\== 'be'",5) 14 | r=r+rtest("subword(' to be or not to be ',7)","\== ''",6) 15 | r=r+rtest("subword(' to be or not to be ',8,7)","\== ''",7) 16 | r=r+rtest("subword(' to be or not to be ',3,2)","\== 'or not'",8) 17 | r=r+rtest("subword(' to be or not to be ',1,2)","\== 'to be'",9) 18 | r=r+rtest("subword(' to be or not to be ',4,2)","\== 'not to'",10) 19 | r=r+rtest("subword('abc de f', 3)","\== 'f'",11) 20 | say 'Done subword.rexx' 21 | exit r 22 | -------------------------------------------------------------------------------- /test/testexc.not_working: -------------------------------------------------------------------------------- 1 | /* Test the EXECCOMM interface */ 2 | 3 | address COMMAND 4 | 5 | say 'Testing EXECCOMM' 6 | 7 | 'ASSEMBLE TESTEXC' 8 | 9 | 'LOAD TESTEXC' 10 | 11 | 'GENMOD TESTEXC' 12 | 13 | say '*****************************' 14 | 15 | say 'Assign value to REXX variable' 16 | 17 | 'TESTEXC SET TESTVAR Use this string for test data' 18 | 19 | Say 'TESTEXC RC='rc 20 | 21 | say 'Rexx variable contents after set are:' testvar 22 | 23 | say '*****************************' 24 | 25 | say 'Retrieve variable value from REXX' 26 | 27 | setvar = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 28 | 29 | say 'Variable value to retrieve is:' setvar 30 | 31 | 'TESTEXC FETCH SETVAR' 32 | 33 | Say 'TESTEXC RC='rc 34 | r = rc 35 | 'ERASE TESTEXC * A' 36 | 37 | exit r 38 | -------------------------------------------------------------------------------- /test/testfac.not_working: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File testfac.rexx' 3 | /* rexx test factorial function */ 4 | 5 | rc = 0 6 | 7 | rc = assertEQ( factrial(1), 1) 8 | 9 | rc = rc + assertEQ( factrial(2), 4) 10 | 11 | rc = rc + assertEQ( factrial(3), 18) 12 | 13 | rc = rc + assertEQ( factrial(4), 96) 14 | 15 | rc = rc + assertEQ( factrial(5), 600) 16 | 17 | rc = rc + assertEQ( factrial(6), 4320) 18 | 19 | rc = rc + assertEQ( factrial(7), 35280) 20 | 21 | rc = rc + assertEQ( factrial(8), 322560) 22 | 23 | rc = rc + assertEQ( factrial(9), 3265920) 24 | 25 | 26 | 27 | say 'factorial:' rc 28 | 29 | -------------------------------------------------------------------------------- /test/trace.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File trace.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("trace()","\== 'N'",1) 9 | r=r+rtest("trace('O')","\== 'N'",2) 10 | /* r=r+rtest("trace('?A')","== O",3) */ 11 | say 'Done trace.rexx' 12 | exit r 13 | -------------------------------------------------------------------------------- /test/transla.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File transla.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("translate('abcdef')","\== 'ABCDEF'",1) 9 | r=r+rtest("translate('abbc','&','b')","\== 'a&&c'",2) 10 | r=r+rtest("translate('abcdef','12','ec')","\== 'ab2d1f'",3) 11 | r=r+rtest("translate('abcdef','12','abcd','.')","\== '12..ef'",4) 12 | r=r+rtest("translate('4123','abcd','1234')","\== 'dabc'",5) 13 | /* From: Mark Hessling */ 14 | r=r+rtest("translate('Foo Bar')","\== 'FOO BAR'",6) 15 | r=r+rtest("translate('Foo Bar',,'')","\== 'Foo Bar'",7) 16 | r=r+rtest("translate('Foo Bar','',)","\== ' '",8) 17 | r=r+rtest("translate('Foo Bar','',,'*')","\== '*******'",9) 18 | r=r+rtest("translate('','klasjdf','woieruw')","\== ''",10) 19 | r=r+rtest("translate('foobar','abcdef','fedcba')","\== 'aooefr'",11) 20 | say 'Done transla.rexx' 21 | exit r 22 | -------------------------------------------------------------------------------- /test/verify.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File verify.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("verify('123','1234567890')","\= 0",1) 9 | r=r+rtest("verify('1Z3','1234567890')","\= 2",2) 10 | r=r+rtest("verify('AB4T','1234567890','M')","\= 3",3) 11 | r=r+rtest("verify('1P3Q4','1234567890',,3)","\= 4",4) 12 | r=r+rtest("verify('ABCDE','',,3)","\= 3",5) 13 | r=r+rtest("verify('AB3CD5','1234567890','M',4)","\= 6",6) 14 | /* From: Mark Hessling */ 15 | r=r+rtest("verify('foobar', 'barfo', N, 1)","\== 0",7) 16 | r=r+rtest("verify('foobar', 'barfo', M, 1)","\== 1",8) 17 | r=r+rtest("verify('', 'barfo')","\== 0",9) 18 | r=r+rtest("verify('foobar', '')","\== 1",10) 19 | r=r+rtest("verify('foobar', 'barf', N, 3)","\== 3",11) 20 | r=r+rtest("verify('foobar', 'barf', N, 4)","\== 0",12) 21 | r=r+rtest("verify('', '')","\== 0",13) 22 | say 'Done verify.rexx' 23 | exit r 24 | -------------------------------------------------------------------------------- /test/word.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File word.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("word('Now is the time',3)","\== 'the'",1) 9 | r=r+rtest("word('Now is the time',5)","\== ''",2) 10 | /* From: Mark Hessling */ 11 | r=r+rtest("word('This is certainly a test',1)","\== 'This'",3) 12 | r=r+rtest("word(' This is certainly a test',1)","\== 'This'",4) 13 | r=r+rtest("word('This is certainly a test',1)","\== 'This'",5) 14 | r=r+rtest("word('This is certainly a test',2)","\== 'is'",6) 15 | r=r+rtest("word('This is certainly a test',2)","\== 'is'",7) 16 | r=r+rtest("word('This is certainly a test',5)","\== 'test'",8) 17 | r=r+rtest("word('This is certainly a test ',5)","\== 'test'",9) 18 | r=r+rtest("word('This is certainly a test',6)","\== ''",10) 19 | r=r+rtest("word('',1)","\== ''",11) 20 | r=r+rtest("word('',10)","\== ''",12) 21 | r=r+rtest("word('test ',2)","\== ''",13) 22 | say 'Done word.rexx' 23 | exit r 24 | -------------------------------------------------------------------------------- /test/wordlen.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File wordlen.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("wordlength('Now is the time',2)","\=2",1) 9 | r=r+rtest("wordlength('Now comes the time',2)","\=5",2) 10 | r=r+rtest("wordlength('Now is the time',6)","\=0",3) 11 | /* From: Mark Hessling */ 12 | r=r+rtest("wordlength('This is certainly a test',1)","\== '4'",4) 13 | r=r+rtest("wordlength('This is certainly a test',2)","\== '2'",5) 14 | r=r+rtest("wordlength('This is certainly a test',5)","\== '4'",6) 15 | r=r+rtest("wordlength('This is certainly a test ',5)","\== '4'",7) 16 | r=r+rtest("wordlength('This is certainly a test',6)","\== '0'",8) 17 | r=r+rtest("wordlength('',1)","\== '0'",9) 18 | r=r+rtest("wordlength('',10)","\== '0'",10) 19 | say 'Done wordlen.rexx' 20 | exit r 21 | -------------------------------------------------------------------------------- /test/words.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File words.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("words('Now is the time')","\= 4",1) 9 | r=r+rtest("words(' ')","\= 0",2) 10 | /* From: Mark Hessling */ 11 | r=r+rtest("words('This is certainly a test')","\== 5",3) 12 | r=r+rtest("words(' This is certainly a test')","\== 5",4) 13 | r=r+rtest("words('This is certainly a test')","\== 5",5) 14 | r=r+rtest("words('This is certainly a test ')","\== 5",6) 15 | r=r+rtest("words(' hepp ')","\== 1",7) 16 | r=r+rtest("words(' hepp hepp ')","\== 2",8) 17 | r=r+rtest("words('')","\== 0",9) 18 | r=r+rtest("words(' ')","\== 0",10) 19 | say 'Done words.rexx' 20 | exit r 21 | -------------------------------------------------------------------------------- /test/x2b.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File x2b.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("x2b('C3')","\== '11000011'",1) 9 | r=r+rtest("x2b('7')","\== '0111'",2) 10 | r=r+rtest("x2b('1 C1')","\== '000111000001'",3) 11 | r=r+rtest("x2b(c2x('C3'x))","\== '11000011'",4) 12 | r=r+rtest("x2b(d2x('129'))","\== '10000001'",5) 13 | r=r+rtest("x2b(d2x('12'))","\== '1100'",6) 14 | /* From: Mark Hessling */ 15 | r=r+rtest("x2b('416263')","\== '010000010110001001100011'",7) 16 | r=r+rtest("x2b('DeadBeef')","\== '11011110101011011011111011101111'",8) 17 | r=r+rtest("x2b('1 02 03')","\== '00010000001000000011'",9) 18 | r=r+rtest("x2b('102 03')","\== '00010000001000000011'",10) 19 | r=r+rtest("x2b('102')","\== '000100000010'",11) 20 | r=r+rtest("x2b('11 2F')","\== '0001000100101111'",12) 21 | r=r+rtest("x2b('')","\== ''",13) 22 | say 'Done x2b.rexx' 23 | exit r 24 | -------------------------------------------------------------------------------- /test/x2c.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File x2c.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("x2c('F')","\== '0F'x",1) 9 | /* From: Mark Hessling */ 10 | r=r+rtest("x2c('C18283')","\== 'Abc'",2) 11 | r=r+rtest("x2c('DeadBeef')","\== 'deadbeef'x",3) 12 | r=r+rtest("x2c('1 02 03')","\== '010203'x",4) 13 | r=r+rtest("x2c('11 0222 3333 044444')","\== '1102223333044444'x",5) 14 | r=r+rtest("x2c('')","\== ''",6) 15 | r=r+rtest("x2c('2')","\== '02'x",7) 16 | r=r+rtest("x2c('1 02 03')","\== '010203'x",8) 17 | say 'Done x2c.rexx' 18 | exit r 19 | -------------------------------------------------------------------------------- /test/xrange.rexx: -------------------------------------------------------------------------------- 1 | say '----------------------------------------' 2 | say 'File xrange.rexx' 3 | r=0 4 | /* From: 5 | The REXX Language A Practical Approach to Programming 6 | Second Edition, MICHAEL COWLISHAW, 1990 7 | */ 8 | r=r+rtest("xrange('a','f')","\== 'abcdef'",1) 9 | r=r+rtest("xrange('03'x,'07'x)","\== '0304050607'x",2) 10 | r=r+rtest("xrange('FE'x,'02'x)","\== 'FEFF000102'x",3) 11 | /* From: Mark Hessling */ 12 | r=r+rtest("xrange('7d'x,'83'x)","\== '7d7e7f80818283'x",4) 13 | r=r+rtest("xrange('a','a')","\== 'a'",5) 14 | say 'Done xrange.rexx' 15 | exit r 16 | --------------------------------------------------------------------------------