IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Adding line breaks in between a text string


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Susanta

Active User


Joined: 17 Nov 2009
Posts: 126
Location: India

PostPosted: Mon Aug 10, 2015 6:15 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Aug 10, 2015 6:54 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Aug 10, 2015 6:55 pm
Reply with quote

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
View user's profile Send private message
Susanta

Active User


Joined: 17 Nov 2009
Posts: 126
Location: India

PostPosted: Tue Aug 11, 2015 10:56 am
Reply with quote

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
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Tue Aug 11, 2015 12:31 pm
Reply with quote

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
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Tue Aug 11, 2015 12:50 pm
Reply with quote

I believe that X'15' is the EBCDIC 'newline' whereas X'0A' is the UTF-8 coding.

Garry
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Aug 11, 2015 2:43 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
Search our Forums:

Back to Top