On 2017-10-18, at 09:23:12, Ed Jaffe wrote: > On 10/18/2017 1:19 AM, Jonathan Scott wrote: >> ... We normally use code page 1047 for product code anyway, >> where square brackets are hex AD and BD as in TEXT code pages and >> the C/370 compiler. I think that the ASCII translation should >> probably use 819 rather than 7-bit ASCII as the target code page, >> and should be made sensitive to the existing CODEPAGE option, >> which currently only affects Unicode. Also, the CODEPAGE option >> should be extended to cover a wider range, including 1047. > > YES! We've been using code page 1047 for about 20 years or so for all > mainframe programming environments! (Code page 37 is a distant and painful > memory...) > What code pages are supplied for SYSIN? 037? 500? 1047? 819?
Should character constants be converted to binary according to the SYSIN code page or according to a uniform EBCDIC code page? I suspect that under Linux, HLASM presumes 819. How, then, does it handle self-defining character constants? > The assembler's "hard-wired" ASCII<->EBCDIC support has never been of any > value to us. We do literally *everything* dynamically (at run time) based on > the customer's locale and a large CSECT full of accurately hand-crafted > translate tables. > It must be done at run time if you intend to support multiple customer locales. But what if you could dynamically switch translate tables within an assembly to assemble the various tables you need. (Way off-topic, but I know it's related to Ed's specialty: Can one find out from the SDSF API the code page of a SYSOUT? CHARS is close, but no cigar.) "accurately hand-crafted"? Is that better tnan extracting from iconv()? > Having said that, if we had usable ASCII translation support to/from code > page 1047 from the assembler, we would gladly start using some compile-time > ASCII constants. > I understand that HLASM under Linux translates SYSIN from 819(?) to an EBCDIC CP (which?) In HLASM Programmer's Guide, SC26-4941-08, I see: TRANSLATE AS Specifies that characters contained in character (C-type) data constants (DCs) and literals are converted into ASCII characters using the ASCII translation table provided with High Level Assembler. It really, really ought to identify the code pages in the "translation table provided". And if "provided" means 7-bit, 819 ought to be among the supported options, not requiring the programmer to supply a custom table. -- gil
