ASCII

You can change ASCII to EBCDIC in a file using ATOE function. Also EBCDIC to ASCII conversion can be done by using ETOA function. Translation features of INREC, OUTREC and OUTFIL make it easy to

  • Change ASCII characters to their equivalent EBCDIC characters using the default standard TCP/IP service.
  • ATOE – Instructs MFX to translate characters in a specified field from ASCII to EBCDIC. The maximum input length is 32752.
  • Change EBCDIC characters to their equivalent ACSCII characters using the default standard TCP/IP service EBCDIC to ASCII table.
  • ETOA – Instructs MFX to translate characters in a specified field from EBCDIC to ASCII. The maximum input length is 32752

ASCII to EBCDIC or EBCDIC to ASCII

Here’s how you could change to ASCII characters in a 100-byte character field starting at position 51 and in a 40-byte character field starting in position 301, in an FB data set with an LRECL of 500:

OUTREC OVERLAY=(51:51,100,TRAN=ETOA,301:301,40,TRAN=ETOA)

Of course, you could change the case in the entire record as well. For example, here’s how you could change to EBCDIC in the records of an FB data set with an LRECL of 200:

OUTREC BUILD=(1,200,TRAN=ATOE)

And here’s how you could change to ASCII in the records of a VB data set with any LRECL:

OUTREC BUILD=(1,4,5,TRAN=ETOA)

HEX – Instructs MFX to transform data to printable hexadecimal. The number of output bytes will be 2x the number of input bytes. The maximum input length is 16376. For example, C’B9′ is transformed into C’C2F9′.

BIT – Instructs MFX to transform data to printable binary. The number of output bytes will be 8x the number of input bytes. The maximum input length is 4094. For example, C’F12′ is equivalent to X’C6F1F2′ and is transformed into C’110001101111000111110010′.

UNHEX – Instructs MFX to transform data from printable hexadecimal to its character representation. Each two-input byte are translated to one output byte, so the number of output bytes will be one-half the number of input bytes, rounded up. If the input length is an odd number, the output will be padded with binary zeros in the last half-byte. The maximum input length is 32752. Input bytes that are not in the range 0-9 or A-F will be treated as 0. For example, C’C4FX5′ is interpreted as C’C4F050′ and is transformed into C’D0&’.

UNBIT – Instructs MFX to transform data from printable binary to its character representation. Each eight input bytes are translated to one output byte, so the number of output bytes wil be one-eighth the number of input bytes, rounded up. If the input length is not a multiple of 8, the output will be padded with binary zeros in the last byte. The maximum input length is 32752. Input bytes that are not 0 or 1 will be treated as 0. For example, C’1111a02111001′ is interpreted as C’1111000111001000′ (or X’F1C8′) and is transformed into C’1H’.

Read JCL blogs – Click Here SYNCSORT Manual: Click Here

Scroll to Top