search cancel

z/OS to Linux migration - EBCDIC - ASCII compare notes


Article ID: 203027


Updated On:


PanAudit Plus Easytrieve Report Generator PAN/SQL Easytrieve Report Generator for Common Services


How to get the same results on Linux like on z/OS when using CA Easytrieve for Linux?


Release : 11.6



Due to the different hexadecimal values of the EBCDIC and ASCII encoding schemes, there are sometimes different results when, for example, comparing fields.
For example, "a" is less than "A" in EBCDIC, but "a" is greater than "A" in ASCII.
Also numeric characters are less than alphabetic letters in ASCII but are greater than letters in EBCDIC.


When using CA Easytrieve there is a way to get the same results on Linux (or other ASCII systems) like on z/OS (EBCDIC).
The solution is to use CMPUSINGALTSEQ(YES) at the PARM statement in your CA Easytrieve application (source), together with an appropriate alternate sequence table (ALTSEQ).
Alternatively set the CMALTSEQ option in the EZOPTBL options table to Y (an appropriate alternate sequence table (ALTSEQ) is required as well).
This is a CA Easytrieve for Linux source example:
PARM CMPUSINGALTSEQ(YES)                                           
* when using CMPUSINGALTSEQ(YES) you also need an EBCDIC
* alternate sequence table (for example "eztpaqtt_ebcdic.def")          
* and run:                                                          
* cd /opt/CA/ezt/bin                                                
* etaltseq -b <eztpaqtt_ebcdic.def                                  
* furthermore set:                                                  
* ALTSEQ   EZTPAQTT                                                 
* in the EZOPTBL                                                    
DEFINE a-FIELD     S  1  A VALUE 'a'                                
DEFINE A-FIELD     S  1  A VALUE 'A'                                
JOB INPUT NULL                                                      
  IF A-FIELD > a-FIELD                                              
     DISPLAY 'A GREATER a'                                          
     DISPLAY 'expected on z/OS or when using CMPUSINGALTSEQ(YES)'   
     DISPLAY 'a GREATER A'                                           
     DISPLAY 'expected on Linux with CMPUSINGALTSEQ(NO)'            
When compiling and running the above example on Linux the result is:
A GREATER a                                       
expected on z/OS or when using CMPUSINGALTSEQ(YES)
Without CMPUSINGALTSEQ, or with CMPUSINGALTSEQ(NO), the result is:
expected on Linux with CMPUSINGALTSEQ(NO)
As outlined in the above source example, when using CMPUSINGALTSEQ(YES) you also need an EBCDIC alternate sequence table (for example "eztpaqtt_ebcdic.def") and run, for example:
cd /opt/CA/ezt/bin
etaltseq -b <eztpaqtt_ebcdic.def
Furthermore you need:
in the EZOPTBL.

Here is an example - the content of "eztpaqtt_ebcdic.def":
//0 1 2 3     4 5 6 7     8 9 A B     C D E F
0x00010203  0x1A091A7F  0x1A1A1A0B  0x0C0D0E0F   // 0
0x10111213  0x3C3D3226  0x18193F27  0x1C1D1E1F   // 1
0x404F7F7B  0x5B6C507D  0x4D5D5C4E  0x6B604B61   // 2
0xF0F1F2F3  0xF4F5F6F7  0xF8F97A5E  0x4C7E6E6F   // 3
0x7CC1C2C3  0xC4C5C6C7  0xC8C9D1D2  0xD3D4D5D6   // 4
0xD7D8D9E2  0xE3E4E5E6  0xE7E8E94A  0xE05A5F6D   // 5
0x79818283  0x84858687  0x88899192  0x93949596   // 6
0x979899A2  0xA3A4A5A6  0xA7A8A9C0  0x6AD0A107   // 7
0x80818283  0x84858687  0x88898A8B  0x8C8D8E8F   // 8
0x90919293  0x94959697  0x98999A9B  0x9C9D9E9F   // 9
0xA0A1A2A3  0xA4A5A6A7  0xA8A9AAAB  0xACADAEAF   // A
0xB0B1B2B3  0xB4B5B6B7  0xB8B9BABB  0xBCBDBEBF   // B
0xC0C1C2C3  0xC4C5C6C7  0xC8C9CACB  0xCCCDCECF   // C
0xD0D1D2D3  0xD4D5D6D7  0xD8D9DADB  0xDCDDDEDF   // D
0xE0E1E2E3  0xE4E5E6E7  0xE8E9EAEB  0xECEDEEEF   // E
0xF0F1F2F3  0xF4F5F6F7  0xF8F9FAFB  0xFCFDFEFF   // F
//0 1 2 3     4 5 6 7     8 9 A B     C D E F

But, this is just an "eztpaqtt_ebcdic.def" example. Use at your own risk!
Maintaining and customizing the EZTPAQTT is in the responsibility of the CA Easytrieve administrator at your site.

Additional Information