View previous topic :: View next topic
|
Author |
Message |
Viplav Modi
New User
Joined: 23 Jan 2013 Posts: 2 Location: India
|
|
|
|
Hello everyone,
This is my first post and I am a little scared to post a new topic as I am only going to dig something which has already been discussed in past several times so please accept my apologies in advance before I go forward and post my query.
This is with reference to the post COBOL NON PRINTABLE CHARACTERS
(http://ibmmainframes.com/about45429-0-asc-15.html).
As suggested by Ronald blur we can achieve this by coding two 256-byte working storage elements ..........
Using the code mentioned in that post I am able to change non-printable to characters to spaces.
Here as per the source and target table mapping I can see x'BA' which is character '[' getting replaced by x'40' (spaces). As per my understanding this '[' shouldn't be non-printable for cobol.
I tried to enter some of the source characters in a file to check how they will look like and figured out that this table mapping would replace some of the symbols (for ex:^ ) to spaces.
My query is on what basis we can decide a character is non-printable for cobol or not? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
My query is on what basis we can decide a character is non-printable for cobol or not? |
a <character>/byte is printable/non printable displayable/non displayable according to the CODE PAGE used,
not according to the programming language used PERIOD
( or in simpler words, according to the DEVICE used to <display>/<print> it )
the characters You showed apart the x'B3' are all perfectly displayable |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
As enrico alludes, only you can tell what is/is not "displayable" for your requirement.
Take a 256-byte table of 00 to FF. Display it in HEX and "character" simultaneously. On your "output" mark off/note the hex values for the things you want to exclude (or include, probably, as there will be fewer, likely). Amend the program. |
|
Back to top |
|
|
Viplav Modi
New User
Joined: 23 Jan 2013 Posts: 2 Location: India
|
|
|
|
Thanks alot for such a quick response Enrico and Bill .
So far all I know is that x'12' is invalid/bad character/non-printable in my case. As per my requirement I am replacing this x'12' with apostrophe(').
But then the complete requirement states that other than this x'12' rest of the non-printable characters should be replaced by spaces.
It is not mentioned anywhere as what other characters are non-printable.
As enrico pointed out that a character is printable/non-printable according to the DEVICE used so I will try to figure out which device is being used here. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
but apart the <hardware> capabilities
You should also keep in mind the APPLICATION point of view
not alway what You can print/display is valid for the APPLICATION |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Maybe you should consider READABLE instead of PRINTABLE.
You have to decide if chars from B0 to BF are just "noise" or are worth the ink. |
|
Back to top |
|
|
Jose Mateo
Active User
Joined: 29 Oct 2010 Posts: 121 Location: Puerto Rico
|
|
|
|
Good day to all!
You have misunderstood Enrico on code-page. Code-page is not a device. Read on code-page so you could understand what Enrico is telling you. |
|
Back to top |
|
|
|