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

Special characters which are NOT allowed in a Alphanumeric


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

New User


Joined: 06 Aug 2008
Posts: 9
Location: India

PostPosted: Wed Apr 18, 2012 6:45 pm
Reply with quote

Hello friends,
Are there any special characters which are NOT allowed in a alphanumeric field in COBOL?
I've searched in google but couldn't find proper answer.
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: Wed Apr 18, 2012 7:04 pm
Reply with quote

Nope, not a one. An alphanumeric, PICTURE X, can contain any bit value from zero to 255, with ease.

So can numerics, for that matter. You may well have trouble with using it, but they can contain any of those bit values previously mentioned.

I've a feeling there is a deeper question lurking behind this...
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Wed Apr 18, 2012 7:07 pm
Reply with quote

Anil Kumar Govindula wrote:
Hello friends,
Are there any special characters which are NOT allowed in a alphanumeric field in COBOL?
I've searched in google but couldn't find proper answer.

You did not Google hard enough; this manual page definitely states
Quote:
The content of alphanumeric literals, comment lines, and comment entries can include any of the characters in the computer's compile-time character set, and can include both single-byte and DBCS characters.

I recommend that you save the link to the Application Development Help Center (languages and tools), and not rely on Googled information of questionable accuracy.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Apr 18, 2012 7:12 pm
Reply with quote

this will probably be a good read for you: E-Cobol Programmers Guide

afterwards, download E-COBOL Language Reference
so that you have a handy reference as you code.

If you are not using Enterprise Cobol, then there are 'buttons' at the top of the page for manuals.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Apr 18, 2012 7:17 pm
Reply with quote

Are you attempting to eliminate and replace unwanted characters from a given COBOL field?

This can be done easily with an INSPECT CONVERTING, using a 256-byte FROM table consisting of X'00' through X'FF' values and a 256-byte TO table (initialized to SPACES) and then populated with the byte-values you want to keep. All other byte-values are converted to SPACE.

For example, in the TO table, you want to keep all NUMERICS, 0-9, so you move bytes 241 through 250 of the FROM table to bytes 241 through 250 of the TO table, before issuing the INSPECT.

Same concept applies to upper and lower-case letters and other "keepers"....
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 Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
No new posts Count the number of characters in a f... CA Products 1
No new posts convert alphanumeric PIC X(02) to hex... COBOL Programming 3
No new posts Tilde Characters Changing to COLONs i... CLIST & REXX 22
Search our Forums:

Back to Top