View previous topic :: View next topic
|
Author |
Message |
Susanta
Active User
Joined: 17 Nov 2009 Posts: 126 Location: India
|
|
|
|
Need to convert text string from EBCDIC to UTF-8.
Based on functionality need to have linefeeds in between the string. How to achieve that. provided the receiving applciation don't want to add any code change. They want us to send the string with necessary line feeds so that the text string gets line breaks in front end without any more effort by them. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Your post is pretty confusing as it is NOT clear what you want. Questions that come up from reading your post include:
- Do you need help in adding line feeds to a variable (COBOL does not have strings -- it has variables; strings behave in specific ways that COBOL does not support)?
- Do you need help in converting EBCDIC to UTF-8?
- What do you mean "between the string"?
- How are you transferring the data?
- Does the data to be transferred contain nothing but USAGE DISPLAY variables?
You need to go back and explain what you are wanting to do, what you have tried so far, what is not working for you and WHY it is not working (that is, error messages you are getting with the message identifier on the front), and include some sample data for us. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Well, you can have a look here, but exactly what you mean about inserting linefeeds, I don't know. Can you can some examples of the data you have and what you'd like to see for that output? |
|
Back to top |
|
|
Susanta
Active User
Joined: 17 Nov 2009 Posts: 126 Location: India
|
|
|
|
I want to insert line break in between a text string(of display format).
I need the hex code in EBCDIC which represents line break. |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
Do you mean the "new line" character as it exists in the C language? In other words, are you asking, Is there a mainframe COBOL equivalent to the C language "new line" character as used in something like
printf("Line 1\nLine 2\n"); ? |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
I believe that X'15' is the EBCDIC 'newline' whereas X'0A' is the UTF-8 coding.
Garry |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
We still have no clue of what "in between" some text means, and if it is there that you have a problem.
If you are converting to UTF-8 in the COBOL program, you need the target-system value, if the conversion is done outside the COBOL program you need the EBCDIC value, both of which have been pointed out to you already.
If you're now good-to-go, fine. If not, we need better description and sample data and expected output. |
|
Back to top |
|
|
|