@Itschak, I don't know if you have resolved your issue but I had some further 
thoughts and wanted to close the loop. If you were to encode your non-printable 
data in hex (true hex, each nibble converted to a printable character 0-9, a/A 
- f/F)) or Base64 (https://en.wikipedia.org/wiki/Base64) then it would solve 
both your original problem and my objection below to non-printable data in 
source code.

Hex has the advantage that it is extremely straightforward, well-known and 
more-or-less human-readable. It has the disadvantage that it exactly doubles 
the size of your data. Uuencoding (https://en.wikipedia.org/wiki/Uuencoding) 
has been suggested because of the advantage that it only expands the data by a 
third. The problem with uuencode is that both ' (apostrophe) and " (quote) can 
appear in the encoded data, preventing their use as string terminators. Base64 
is not so straightforward nor human-readable as hex but has the same "only" 4:3 
expansion advantage and does not include apostrophe or quote in its encoded 
character set. 

With your non-printable data encoded in hex or Base64, your original problem 
becomes trivial:

MyData =
    'first part of encoded data' || ,
    'second part of encoded data' || ,
     etc.
    'last part'

The || sequence concatenates the quoted literals with no intervening blank. 
Alternatively, your decode routine could skip over blanks. The comma continues 
the Rexx statement onto the next line.

You will of course need to encode your data (once) and decode it on every 
execution. I would assume you can handle that.
        
Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of Charles Mills
Sent: Thursday, October 27, 2016 3:02 PM
To: [email protected]
Subject: Re: Rexx and hex data strings

@Gil, the below would imply it is "non-print" data rather than true hex data.

And @Itschak I don't of course grasp all of the ramifications of the problem 
you are trying to solve, but I would say program source code should be 
generally printable, displayable characters. Anything else is asking for 
trouble. I don't grasp the exact problem you are trying to solve, but I have to 
think there must be a better solution. For example, would it make sense to put 
this binary data in a separate file of its own, and read it in when needed?

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to