View previous topic :: View next topic
|
Author |
Message |
shaktiprasad
New User
Joined: 20 Aug 2006 Posts: 34 Location: chennai
|
|
|
|
Hi ,
Anybody has any idea or any reference which describes about whether DB2 supports any kind of newline character like \n or \t. If yes then how to process the field in any COBOL. I mean any special datatype w need to use to extract thru a COBOL or Stored procedure.
Thanks
Shakti |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
What do you want this newline character to do? You can use EBCDIC X'15' as a "newline" character, but as far as the system is concerned, it's just another byte.
Enterprise COBOL now allows the use of null-terminated variables, but again whether or not they make sense for you depends, entirely, upon what you think you're going to do with them. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Why do you actually want to store them?
If you are sending data to unix/windows-type systems you can do something when formatting the file to be sent. Process them out on receipt. I suppose it might be convenient to store them for some particular requirement (maybe a lump of text).
Each has a particular single value. The "\" is an "escape code" and then the letter following has a particular meaning, but this is just a convention so that you can easily use them in a program/script. They are actually stored as a single binary value.
Cobol doesn't directly understand the escape sequence, but you can put them on/strip them off in the "usual sort of way" (look at STRING, UNSTRING and I always throw in INSPECT, among other possible techniques). Cobol does understand "null terminated strings", which may or may not help you in what you are doing (I could only guess, so far). |
|
Back to top |
|
|
shaktiprasad
New User
Joined: 20 Aug 2006 Posts: 34 Location: chennai
|
|
|
|
Hi ,
Thanks for the quick reply. It was just an initial discussion going on whether on Mainframe can handle any new line character provided by Unix/Abinitio. Hence thought of understanding how to do the same.
I will try to understand the requirements more and get back to this topic. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
It was just an initial discussion going on whether on Mainframe can handle any new line character provided by Unix/Abinitio. |
If thesse are sent to the mainframe, certainly the mainframe "can handle" them. Not as Unix/Windows might, but as simply other data bytes.
If you expect some action based on these, you will have to provide processes to do what you believe is needed.
Personally (with rather incomplete informaton) i would not use them on the mainframe. . . I suppose i could be convinced to consider otherwise |
|
Back to top |
|
|
|