On 06/14/2017 10:30 AM, John McKown wrote:
This is just a kind of "speculation" on my part. It is to avoid problems
when doing transfers of data between z/OS and Intel based platforms. I.e.
when I want to do a binary transfer of a file from Linux or <blech> Windows
to z/OS for processing, perhaps due to the complexity of the data and the
"non z/OS end" people being uncooperative about translating their data to
something like non-binary XML or JSON.
I would like a way to specify that either specific integer variables be in
"Little-Endian" format instead of the IBM z's "Big Endian". It seems to me
that this should be "simple" by just using the "Load Reverse" and "Store
Revere" instructions instead of the normal "Load" and "Store" instructions.
There are 2, 4, & 8 byte variants of these instructions.
In addition to the above, I am wondering about the
reading/writing/processing of character data in ASCII instead of EBCDIC. I
know of the ASCII compile option (which I can't review right now due the
the abominable KC being unavailable right now - I am really PISSED at IBM
for this unreliability). Well, enough on that digression. Does the ASCII
compile option allow for reading, writing, and processing of ASCII char
data? Of course, that I'd really like is a "simple" (not iconv) way to
intermix ASCII & EBCDIC characters. And, yes, I know that I'm opening up a
whole can of mega-worms with this "easy desire".
John,
When I write C programs that have to move data between little and
big-endian systems, I generally use a byte-swapping function to
manipulate the specific fields. If you know that data coming into z/OS
is little-endian, then you could just perform the translation once on
each field, and then treat it as a native value for the rest of its life.
There are some specific built-in C functions that perform little to big
endian byte swaps (htons, htonl), but they are more intended for an x86
machine working with network data. However,m GCC seems to have some
extensions that you can call to perform this byte swapping, as detailed
here:
https://stackoverflow.com/a/105339/9816
I don't know if XLC has something similar, as I haven't used it in over
a decade.
--
Anthony Giorgio
Advisory Software Engineer
IBM z Systems Platform Performance Manager
Twitter: @a_giorgio
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN