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

criteria to decide non-printable character for cobol


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

New User


Joined: 23 Jan 2013
Posts: 2
Location: India

PostPosted: Thu Apr 11, 2013 12:43 pm
Reply with quote

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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Apr 11, 2013 12:53 pm
Reply with quote

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 icon_cool.gif
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: Thu Apr 11, 2013 1:38 pm
Reply with quote

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

New User


Joined: 23 Jan 2013
Posts: 2
Location: India

PostPosted: Thu Apr 11, 2013 2:23 pm
Reply with quote

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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Apr 11, 2013 3:04 pm
Reply with quote

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

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Thu Apr 11, 2013 6:21 pm
Reply with quote

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

Active User


Joined: 29 Oct 2010
Posts: 121
Location: Puerto Rico

PostPosted: Thu Apr 11, 2013 7:08 pm
Reply with quote

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
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 COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top