If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
Testb (test bit Pattern) = compares the bits specified in factor 2 to the result field.
There are eight bits in a byte in EBCDIC.
Bits can be equal to either on ('1') or off ('0')
ex. if only bits 5 and 7 are on then the byte = X'05' (hex) and
B'00000101' and numeric value of 5
I have attached a PDF with some examples just open and search for testb.
Back in the days of old I have used the testb combined with biton/bitoff to convert upper/lower case letters.
bit 1 on = upper case
bit 1 off = lower case
I have also used it to save user switches prior to calling an external program which may re-set the switches.
C bitoff '01234567' bit
C u1 biton '0' bit
C u2 biton '1' bit
etc.
C SETOFF U1U2U3
C SETOFF U4U5U6
C SETOFF U7U8 C call 'otherpgm'
C SETOFF U1U2U3
C SETOFF U4U5U6
C SETOFF U7U8
C TESTB '0' BIT U1
C TESTB '1' BIT U2
C TESTB '2' BIT U3
C TESTB '3' BIT U4
C TESTB '4' BIT U5
C TESTB '5' BIT U6
C TESTB '6' BIT U7
C TESTB '7' BIT U8
I think all will agree this is really old school and I haven't seen this type of coding in recent years
The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln
Comment