When you call
data.getBytes(ebcdic)
You are encoding the text in data into EBCDIC bytes. Then you create a string from these bytes as if they stood for some string in the default character encoding for your system: this causes breakage because the bytes don't have to encode valid text in any other encoding than EBCDIC.
To fix this, keep bytes as bytes:
byte[] result= data.getBytes(ebcdic);
System.out.printf("EBCDIC: %s\n",asHex(result));