Try this, each value is padded on the right with x'40', so your values are this:
those become your result
From: Alan <cfuture@xxxxxxxxxxx>
To: midrange-l <midrange-l@xxxxxxxxxxxxxxxxxx>
Date: Thursday, 22 September 2022 2:58 PM CDT
Subject: SQL function LOR
I came across this researching something else in the SQL reference and
it puzzles me.
It's a new function for me...
The LOR function returns a string that is the logical OR of the argument
This function takes the first argument string, does an OR operation with
string, and then continues to do OR operations for each successive
the previous result. If a character-string argument is shorter than the
result, it is padded with blanks. If a binary-string argument is shorter
previous result, it is padded with hexadecimal zeros.
Assume the host variable L1 is a CHARACTER(2) host variable with a value of
X'0101', host variable L2 is a CHARACTER(3) host variable with a value of
X'F0F000', and host variable L3 is a CHARACTER(4) host variable with a value
Returns the value X'F1F1404F'.
My understanding of "the logical OR of the argument strings is that each
byte from string L1 is compared to L2 and L3, and for each bit position,
bits are compared. If any of the corresponding bits is 1, then the
result bit will be 1. So looking at the values of the arguments, I
don't get how it can get those 404 half-bytes.
Does anybody want to un-confuse me here? I assume the example isn't
wrong, though in all these years I think I did come across one, just
Thanks, -- Alan Cassidy
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.