Sorry for answering a question with a question. Aside from the bit manipulation advice given, do you really need to be storing a representation of bits in XML?
Often people store an intermediate form of data in XML. A decoder transforms data into the intermediate form when constructing XML and an encoder transforms the intermediate form to the external form when serializing the XML. That way in XML you are manipulating things like an element named db2-mepl-list rather than 00100000 or 40.
Kendall
On 9/7/17, 1:01 PM, "basex-talk-bounces@mailman.uni-konstanz.de on behalf of Dave Day" <basex-talk-bounces@mailman.uni-konstanz.de on behalf of 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