Does isCOBOL support EBCDIC? How? |
isCOBOL supports EBCDIC in data files, working-storage, and linkage parameters.
To configure isCOBOL to treat all data as EBCDIC set the iscobol.encoding property. For example,
iscobol.encoding=Cp037
iscobol.encoding can be set to any of the Java Canonical Names for java.io and java.lang API. You can find these listed in the Java SE Documentation Supported Encodings.
isCOBOL also provides a library routine C$CODESET that can be used to convert from one encoding to another. See the isCOBOL Documentation : Appendices : Library Routines.
For example, the following code converts "test string" from ASCII to EBCDIC:
working-storage section.
01 TRANS-FLAG PIC 9(2) COMP-X.
01 TRANS-LENGTH PIC 9(9) COMP-X.
01 TRANS-STRING PIC X(80).
01 ENCODING PIC X(6) value "Cp037".
01 RETURN-VALUE PIC 9(04) VALUE 0.
procedure division.
main-logic.
move 1 to TRANS-FLAG.
move 80 to TRANS-LENGTH.
move "test string" to TRANS-STRING.
CALL "C$CODESET"
USING TRANS-FLAG, TRANS-LENGTH,
TRANS-STRING , ENCODING
GIVING RETURN-VALUE
|
Authored
by: Veryant Support
This question has been viewed 6297 times so far.
|
Click
Here to View all the questions in Mainframe COBOL
category. |
File Attachments |
There are no attachment file(s) related to this question. |
|
User Comments |
|
|
There are no user comments for this question. Be the first to post a comment. Click Here |
Related Questions
|
- What compile options and properties do you recommend for migrations?
|