support: Customer Portal
Focused on delivering choice, investment protection and flexibility to organizations with valuable COBOL assets
 

Veryant Knowledge Base
Home > All Categories > Transitioning to isCOBOL > Mainframe COBOL > Does isCOBOL support EBCDIC? How?
Question Title 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 File Attachments
There are no attachment file(s) related to this question.
How helpful was this article to you?
User Comments User Comments Add Comment
There are no user comments for this question. Be the first to post a comment. Click Here
Related Questions Related Questions
  1. What compile options and properties do you recommend for migrations?
Article Information Additional Information
Article Number: 127
Created: 2010-05-05 1:15 PM
Rating: No Rating
 
Article Options Article Options
Print Question Print this Question
Email Question Email Question to Friend
Export to Adobe PDF Export to PDF File
Export to MS Word Export to MS Word
Bookmark Article
Subscribe to Article Subscribe to Article
 
Search Knowledge Base Search Knowledge Base



 
 

© Veryant - All Rights Reserved
Veryant and isCOBOL are trademarks or registered marks of Veryant in the United States and other countries. All other marks are the property of their respective owners.