Hi Dave,
Sounds like the Binary_Module[1] will help you. This is the BaseX implementation of the EXPath standard [2] E.g.
``` let $byte:=bin:from-octets(4) let $DTFLSYSS:=bin:from-octets(8) let $new:= bin:or($byte,$DTFLSYSS) return bin:to-octets($new) ```
Regards /Andy
[1] http://docs.basex.org/wiki/Binary_Module [2] http://expath.org/spec/binary
On 7 September 2017 at 21:01, Dave Day David.Day@duke-software.com wrote:
Greetings list,
I don't know if I am asking this question correctly. I'm new to the XML world. I can google this, get some hits, but when I read the posts, it is not really clear to me. Any help is appreciated.
On an IBM mainframe, I've got a one byte hex field defined as follows:
PCDTFLAG DS XL1 FLAG TO INDICATE ORIGIN OF INFO
DTFLENTP EQU B'10000000' INFO CAME FROM MODULE ENTRY POINT DTFLMEPS EQU B'01000000' DB2 MEPL LIST HAS BEEN SEARCHED DTFLMEPL EQU B'00100000' INFO CAME FROM DB2 MEPL LIST DTFLDB2S EQU B'00010000' DSNMODS HAS BEEN SEARHCED DTFLDSNM EQU B'00001000' INFO CAME FROM DSNMODS SEARCH DTFLSYST EQU B'00000100' INFO CAME FROM SYSTEM TABLE DTFLSYSS EQU B'00000010' SYSTEM TABLE HAS BEEN SEARCHED DTFLCMNC EQU B'00000001' COMMON AND NUC HAS BEEN SEARCHED
I need to be able to create XML for the field PCDTFLAG. OK, define an
element as hexBinary. But then how do I define the bits within the byte.
On the mainframe side, with the equated values, I can OR the flag
byte with the equated value, and this will set the correct bit on in the byte.
OI PCDTFLAG,DTFLENTP will turn on bit 0 in the 1 byte field if it
is not on already.
I can test for the bit on or off. TM PCDTFLAG,DTFLENTP JZ some-other-area-of-code will branch if the bit is off JO another-area-of-code will branch if the bit is on So, I guess I am asking two questions. One, how to give definition to
bits within a byte, and two, how to manipulate and test those defined bits.
Regards, -- Dave Day