mvslovers / brexx370

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

ADDRESS LINKMVS #102

Open philmpv opened 2 years ago

philmpv commented 2 years ago

I am trying to use ADDRESS LINKMVS to call object code and according to the official IBM documentation with regards to LINKMVS and ATTCHMVS, the rexx variables being used as parameters should be updated with any changes made in the called object module - quoted verbatim from the z/OS 2.4 documentation:

When the LINKMVS or ATTCHMVS environment routine regains control, it determines whether to update the values of the REXX variables before returning to the REXX exec. To determine whether to update the value of a variable for a specific parameter, the LINKMVS or ATTCHMVS environment checks the value in the halfword length field. Depending on the value in the length field, LINKMVS or ATTCHMVS updates the variable, does not update the variable, or sets the variable to the null string. If the value in the length field is less than 0, the LINKMVS or ATTCHMVS environment does not update the variable for that parameter. If the value in the length field is 0, the LINKMVS or ATTCHMVS environment sets the variable for that parameter to the null string. If the value in the length field is greater than 0, the LINKMVS or ATTCHMVS environment updates the variable for that parameter with the value the program returned in the parameter list. If the length field is a positive number, LINKMVS or ATTCHMVS simply updates the variable using the length in the length field. If the original length of the value is less than 500 bytes, TSO/E provides a storage area of 500 bytes regardless of the length of the value of the variable. For example, if the length of the value of the variable on entry to the program were 8 bytes, the halfword length field would contain the value 8. However, there are 500 bytes of storage available for the parameter itself. This allows the program to increase the length of the variable without having to obtain storage. If the invoked program changes the length of the variable, it must also update the length field.

If the original length of the value is 500 or more bytes, there is no additional space allotted. For example, suppose you specify a variable whose value has a length of 620 bytes. The invoked program can return a value with a maximum length of 620 bytes. TSO/E does not provide an additional buffer area. In this case, if you expect that the linked or attached program may want to return a larger value, pad the original value to the right with blanks.

Could you confirm if your version of the LINKMVS/ATTCHMVS environments do this ?

Many thanks.

mgrossmann commented 8 months ago

We are very sorry for missing your question. We don't update the REXX variable values, at the moment. Currently we are preparing our next relase of BREXX/370. So we are unable to fix this, today.

But we consider enhancing the ADDRESS LINK*** stuff accordingly.

philmpv commented 8 months ago

I wish you all the best for the up coming release of this excellent Rexx interpreter.