From: Jeff H. <Je...@Je...> - 2023-01-04 19:10:41
|
<html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body> I have made a major update to the <b>SPEC</b> stage (and expect it is the last for it for a while). It will be in the next release of NetRexx. It is currently available from SourceForge. Since it uses the "stageExit" method, it can only be compiled into the full NetRexxC.jar.<br> <p>CMS Pipelines has built into the SPEC stage its own programming language. It is Rexx-like-but-not-quite-Rexx. For NetRexx Pipelines, I did not -- and recommend we do not -- attempt to duplicate it. What we have built in, and I have used instead, is the worlds best scripting language: <b>NetRexx</b>. This gives all the power, but with a somewhat different syntax, of the CMS version. I have incorporated this into the "Conversion" phase, with the key word <b>NETREXX</b> (or <b>NR</b>) and a delimitedString containing the NetRexx source. In running, this code is encapsulated in a method. The data selected in the Input phase is available as the variable <font face="monospace"><b>data</b></font>. And whatever is returned is passed to the Output phase of the stage. (As a convenience, if the last statement is not RETURN, the statement "return data" is automatically added.) So all of these pipes work the same (giving cba):</p> <ul> <li><font face="monospace">pipe "literal abc | <b>spec 1-* NR /return data.reverse/</b> 1 | cons"</font></li> <li><font face="monospace">pipe "literal abc | <b>spec 1-* NR @rev = data.reverse; return rev@</b> 1 | cons"</font></li> <li><font face="monospace">pipe "literal abc | <b>spec 1-* NR %data = data.reverse%</b> 1 | cons"</font></li> </ul> <p>CMS also has <b>COUNTER</b>s. Here in NetRexx, <b>COUNTER</b> is a class property and can be used as a full fledged NetRexx indexed variable, for example <font face="monospace">counter[3] </font>or <font face="monospace">counter['gold']</font>. Counters are persistent for the life of the stage and shared across all <b>NR</b> invocations within a SPEC stage. (CMS has a limited number of counters available, and suggests specifying the number needed in the SPEC options. NetRexx has no such limitations and the COUNTERS option is ignored.)</p> <p>This NetRexx code can also use Identified Fields, below, similarly to counters. The syntax is <font face="monospace"><b>field["a"]</b></font>, for example. Like CMS, fields are identified by a single letter, case sensitive, so up to 52 are available.</p> <blockquote> <p><b>DANGER</b>: Since the full power of NetRexx is available, you can get yourself in trouble! Also, this code is three levels deep, and error messages may point to the wrong thing, at the "wrong time." Debugging can be a bear. You have been warned.<br> </p> </blockquote> <p>These new Field Identifiers are are specified by a letter and colon before an input range. (There may be no blank between the letter and colon, there may be a space between the identifier and the range specifier.) The letter is any of the 52 a-zA-Z, and is case sensitive.<br> </p> <p>Another new feature may make the sometimes dense options string a little easier to read. Groups of Id-Input-Convert-Output may now have a non-functional comma separating them. (At least at this time, the comma must have a BLANK after it, and optionally before it and must be in the right place.) <br> </p> <p>This update now fully supports multiple output streams as well as inputs. The output range of "." has been added, it is of use with Identified Fields and NR. It causes no output from that input range. Also,in NetRexx Pipelines only, an input range of "." gives a data field of "". This may be of use with the new <b>NETREXX</b> converter phase.<br> </p> <p>There are confirmation tests for (I think) all of the relevant options in the <font face="monospace">examples/pipes</font> directory.<br> </p> <p>The documentation is now:<br> </p> <p> <img src="cid:par...@Je..." alt=""></p> <p><img src="cid:par...@Je..." alt=""></p> <p>.<img src="cid:par...@Je..." alt=""></p> <p><img src="cid:par...@Je..." alt=""></p> <p>.<img src="cid:par...@Je..." alt=""></p> <p>=========</p> <p>Jeff<br> </p> </body> </html> |