Class EbcdicConvertor

java.lang.Object
com.softwaremining.jcl.EbcdicConvertor

public class EbcdicConvertor extends Object
EBCDIC To ASCII Data Migration utility class
LIMITATION: May not work on classes which have complicated REDEFINIONS. The system will convert all characters apart from those associated with Packed-Decimal (PD) fields. Ie even when a NON-PD field REDEFINES a PD field, the presence of the PD field will cause the characters at that position to be excluded from conversion

Usage:
 
    java com.softwaremining.jcl.EbcdicConvertor direction full-ClassName input-filename output-filename [forceNewLine (true or false)] [-GRP_SELECTOR=(pos,length,condType,condValue,GRP_NAME,AND/OR, ...)]
   where 
direction: e2a (for EBCDIC to ASCII), a2e (for ASCII to EBCDIC) full-ClassName or record-definition e.g. com.myapp.idata.TestWrapper or JCL Type Record Definition (1,20,CH,21,4,PD,24,60,CH)
input-filename e.g. ../data/input-record.txt output-filename e.g. ../data/output-record.txt [OPTIONAL] forceNewLine : (deprecated use -forceNewLine]): the fifth argument (without a prefix) can be true or false. When true, FORCES the output-file records to be delimited by new line char. Default is false When 'false' the system will CR/LF characters (if any) at end of each record. [OPTIONAL] -forceNewLine=true/false [Optional] :true or false. Default is false. When true, FORCES the output-file records to be delimited by new line char. When 'false' the system will CR/LF characters (if any) at end of each record [OPTIONAL] -GRP_SELECTOR=(pos,length,condType,condValue,GRP_NAME,AND/OR, ...) e.g. (1,1,EQ,A,GRP_1 ,OR,1,1,EQ,X'F3',GRP_2 )" [OPTIONAL] -rdw=true/false)"
note on JCL Type Record Definition above
  • 1,20,CH - characters position 1 through 20 (length=20) characters of data to be Alphanumeric and requiring EBCDIC <-> ASCII conversion
  • 21,4,PD - defines characters position 21 through 24 (Length=4) to be PACKED-DECIMAL and excluded from character-set conversions
  • 25,60,CH- defines characters position 25 through 65 (length=60) to be Alphanumeric and requiring EBCDIC <-> ASCII conversion
Notes on NEW Line characters: Use softwaremining.properties CRLF_FORMAT=windows or CRLF_FORMAT=unix to control Line-Sequential Terminators

Notes on GRP_SELECTOR: useful when the record contains REDEFINES. It allows specifying conditions where each REDEFINE group can be applied.
     E.g: 1,1,EQ,A,GRP_1 means when first character equals "A" then perform Ebcdic conversion using structure defined by GRP_1
     and 1,1,EQ,X'F3',GRP_2 means when first character equals 0xF3 then perform Ebcdic conversion using structure defined by GRP_2
        Please note the names come from the generated Data-Access-Objects (DAO). In the DAO's all '-' characters would have been replaced by underscore '_' characters. Ie GRP_1 instead of GRP-1 .