Need a Translate Table?

By | August 16, 2013

Back before z/OS had Unicode Services available to do character transactions before code pages, there was something called CDRA. As of z/OS 1.13 it is still there as a part of DFHSMSdfp but it is only briefly mentioned.  There is more documentation here. IBM has been a leader in keeping track of internationalization issues, as you might expect. See IBM Globalization Character Data Representation Architecture.

I was looking for some translate tables and I could find them all over the place, but they were inconsistent.  I mean, what did TCPIP consider to be ASCII and why was it different than some other product’s version of ASCII?  I wanted to generate tables that I could use in my Assembler or Rexx source. Obviously, or probably, my programs could have just used the services themselves, but just having good tables was good enough for me.

To use the CDRA services, someone has to have run the CDRA initialization job.  The job creates some datasets with what I presume are fixed dataset names.  Currently, I find the job in SYS1.SAMPLIB(CDRAINIT).  I would put the datasets on the SYSRES since they are SYS1 and I’m pretty sure you can’t use other names.

I started with an IBM sample, and ended up with this: cdratbl.c.

The program must be linkedited into a PDSE or, I suppose, an HFS directory.  I used a job like this:

//*
// JCLLIB ORDER=CBC.SCCNPRC
//*
//CC        EXEC EDCCLG,
// LIBPRFX='CEE',
// LNGPRFX='CBC',
// INFILE='XXXXXXX.SRC.C(CDRATBL)',
// OUTFILE='XXXXXXX.LIBRARY(CDRATBL),DISP=SHR',
// CPARM='LIS,SO,XR,LOC,NOMARGIN,NOSEQ,OPT(2),TUN(8),ARCH(8)',
// LPARM='MAP,RENT,XREF',
// GPARM='-s 1047 037'
//*
//LKED.SYSLIB DD
//            DD DISP=SHR,DSN=SYS1.CSSLIB
//GO.SYSPRINT DD SYSOUT=*
//GO.SYSOUT   DD SYSOUT=*

The GO step of this job generates a sparse table showing the changes between CCSID 1047 and 037, which isn’t so much useful as it is instructive:

  Conversion Table for 01047 (ccsid 01047) to 00037 (ccsid 00037)
     -0  -1  -2  -3  -4  -5  -6  -7  -8  -9  -A  -B  -C  -D  -E  -F
0- : --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
1- : --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
2- : --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
3- : --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
4- : --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
5- : --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  B0
6- : --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
7- : --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
8- : --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
9- : --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
A- : --  --  --  --  --  --  --  --  --  --  --  --  --  BA  --  --
B- : 5F  --  --  --  --  --  --  --  --  --  AD  BD  --  BB  --  --
C- : --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
D- : --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
E- : --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
F- : --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --

Using the program it’s fairly easy to generate table to convert to & from many single-byte code pages. For example 819<->037. 819 is otherwise known as iso8859-1.

//JOBLIB   DD DISP=SHR,DSN=XXXXXXX.LIBRARY
//TO037    EXEC PGM=CDRATBL,PARM='819 037'
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//TO819    EXEC PGM=CDRATBL,PARM='037 819'
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*

The job gives:

  Conversion Table for 00819 (ccsid 00819) to 00037 (ccsid 00037)
     -0  -1  -2  -3  -4  -5  -6  -7  -8  -9  -A  -B  -C  -D  -E  -F
0- : 00  01  02  03  37  2D  2E  2F  16  05  25  0B  0C  0D  0E  0F
1- : 10  11  12  13  3C  3D  32  26  18  19  3F  27  1C  1D  1E  1F
2- : 40  5A  7F  7B  5B  6C  50  7D  4D  5D  5C  4E  6B  60  4B  61
3- : F0  F1  F2  F3  F4  F5  F6  F7  F8  F9  7A  5E  4C  7E  6E  6F
4- : 7C  C1  C2  C3  C4  C5  C6  C7  C8  C9  D1  D2  D3  D4  D5  D6
5- : D7  D8  D9  E2  E3  E4  E5  E6  E7  E8  E9  BA  E0  BB  B0  6D
6- : 79  81  82  83  84  85  86  87  88  89  91  92  93  94  95  96
7- : 97  98  99  A2  A3  A4  A5  A6  A7  A8  A9  C0  4F  D0  A1  07
8- : 20  21  22  23  24  15  06  17  28  29  2A  2B  2C  09  0A  1B
9- : 30  31  1A  33  34  35  36  08  38  39  3A  3B  04  14  3E  FF
A- : 41  AA  4A  B1  9F  B2  6A  B5  BD  B4  9A  8A  5F  CA  AF  BC
B- : 90  8F  EA  FA  BE  A0  B6  B3  9D  DA  9B  8B  B7  B8  B9  AB
C- : 64  65  62  66  63  67  9E  68  74  71  72  73  78  75  76  77
D- : AC  69  ED  EE  EB  EF  EC  BF  80  FD  FE  FB  FC  AD  AE  59
E- : 44  45  42  46  43  47  9C  48  54  51  52  53  58  55  56  57
F- : 8C  49  CD  CE  CB  CF  CC  E1  70  DD  DE  DB  DC  8D  8E  DF
  Conversion Table for 00037 (ccsid 00037) to 00819 (ccsid 00819)
     -0  -1  -2  -3  -4  -5  -6  -7  -8  -9  -A  -B  -C  -D  -E  -F
0- : 00  01  02  03  9C  09  86  7F  97  8D  8E  0B  0C  0D  0E  0F
1- : 10  11  12  13  9D  85  08  87  18  19  92  8F  1C  1D  1E  1F
2- : 80  81  82  83  84  0A  17  1B  88  89  8A  8B  8C  05  06  07
3- : 90  91  16  93  94  95  96  04  98  99  9A  9B  14  15  9E  1A
4- : 20  A0  E2  E4  E0  E1  E3  E5  E7  F1  A2  2E  3C  28  2B  7C
5- : 26  E9  EA  EB  E8  ED  EE  EF  EC  DF  21  24  2A  29  3B  AC
6- : 2D  2F  C2  C4  C0  C1  C3  C5  C7  D1  A6  2C  25  5F  3E  3F
7- : F8  C9  CA  CB  C8  CD  CE  CF  CC  60  3A  23  40  27  3D  22
8- : D8  61  62  63  64  65  66  67  68  69  AB  BB  F0  FD  FE  B1
9- : B0  6A  6B  6C  6D  6E  6F  70  71  72  AA  BA  E6  B8  C6  A4
A- : B5  7E  73  74  75  76  77  78  79  7A  A1  BF  D0  DD  DE  AE
B- : 5E  A3  A5  B7  A9  A7  B6  BC  BD  BE  5B  5D  AF  A8  B4  D7
C- : 7B  41  42  43  44  45  46  47  48  49  AD  F4  F6  F2  F3  F5
D- : 7D  4A  4B  4C  4D  4E  4F  50  51  52  B9  FB  FC  F9  FA  FF
E- : 5C  F7  53  54  55  56  57  58  59  5A  B2  D4  D6  D2  D3  D5
F- : 30  31  32  33  34  35  36  37  38  39  B3  DB  DC  D9  DA  9F

Now, I like to try this with Unicode Services, but why mess with something that works? We’ll see.
[Update: here it is.]

More about CCSIDs.  I really which I had this kind of documentation available in the early 1990s.

Leave a Reply

Your email address will not be published. Required fields are marked *