mvslovers / brexx370

MVS version of Vasilis Vlachoudis awesome rexx implementation
46 stars 11 forks source link

STREAM BiF’s Rexx Standard Open Command Strings #32

Closed reggiemack-310 closed 4 years ago

reggiemack-310 commented 5 years ago

The STREAM BIF’s file/dataset open commands are not the Rexx standard open commands. This leaves a developer burdened with a significant amount of unnecessary coding when developing multi-platform Rexx programs and addressing the BRexx/370 environment, especially when the program is heavily laden with STREAM I/O. Thank goodness that it is quite easily remedied (veritably a no-brainer) by applying an alias to the existing commands in the STREAM BiFs commands’ case (switch) statement in ‘rxfiles.c’. The STREAM BIF has the following syntax:

STREAM( streamid[,[option][,command]] )

To open a file/dataset stream, the [option] must be ‘C’ for command mode and then the file/dataset open directive as ‘COMMAND’ where, for BRexx/370 and its open commands to be standardized, ‘COMMAND’ becomes ‘READ’, ‘WRITE’, ‘APPEND’, ‘UPDATE’ or ‘CREATE’.

The table here references the existing STREAM BIF’s open commands to be aliased and then, associates the equivalent Rexx standard STREAM BIF open, data stream, command string to be added as an alias.

BRexx/370 STREAM BIF Open Command | Rexx STREAM BIF Standard Open Command (Alias)
_______________________________________________________________________________________
‘READ’                            | ‘OPEN’
‘READ’                            | ‘OPEN READ’
‘WRITE’                           | ‘OPEN WRITE’
‘APPEND’                          | ‘OPEN WRITE APPEND’
‘UPDATE’                          | ‘OPEN BOTH’
‘CREATE’                          | ‘OPEN WRITE REPLACE’
_______________________________________________________________________________________

For the BRexx/370 binary versions of the above, like ‘READBINARY’, BINARY is can be added to the end of its non-BINARY counterpart as an alias. So the BINARY version of “OPEN READ would be ‘OPEN READ BINARY’. Likewise, APPENDBINARY’s alias would then become ‘OPEN WRITE APPEND BINARY’ for example …

reggiemack-310 commented 5 years ago

Hi Mike!

This issue is sister to and has the same ramifications of issue #26https://github.com/mgrossmann/brexx370/issues/26. That’s why it was the only issue broken out ahead of time. I’m not sure where you are on release 2 of BRexx/370 but if you can squeeze this issue in that would be magic! Without this side of issue 26 one still has to write BRexx/370 code or carry 2 versions of the code when it comes to using the Stream I/O BiFs. There’s not any significant logic that needs to be integrated. The developer impact is negligible, slightly more than say adding a few table entries. I realize there’s a lot going on as you get closer to release 2. But please, check it out and let me know if it is doable for the next release. Thanks.

Ciao!

mgrossmann commented 5 years ago

Hi Reggie,

we will implement these aliases. That‘s indeed an good idea.

Mike

reggiemack-310 commented 5 years ago

That’s great! Thank-you …

mgrossmann commented 4 years ago

implemented