Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Special characters which are NOT allowed in a Alphanumeric

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Special characters which are NOT allowed in a Alphanumeric
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Wed Apr 18, 2012 7:04 pm    Post subject: Reply to: COBOL:Special Characters in Alphanumeric field
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: 1775
Location: Bloomington, IL

PostPosted: Wed Apr 18, 2012 7:07 pm    Post subject: Re: COBOL:Special Characters in Alphanumeric field
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: 6968
Location: porcelain throne

PostPosted: Wed Apr 18, 2012 7:12 pm    Post subject:
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: 2504
Location: Atlanta, Georgia, USA

PostPosted: Wed Apr 18, 2012 7:17 pm    Post subject: Reply to: COBOL:Special Characters in Alphanumeric field
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Binary to display characters Roy Ware SYNCSORT 3 Tue Sep 19, 2017 8:46 pm
No new posts Remove junk values in a file and rite... KP1125 DFSORT/ICETOOL 2 Wed Jan 25, 2017 9:58 pm
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
This topic is locked: you cannot edit posts or make replies. Alphanumeric to Numeric move on UNIX mistah kurtz COBOL Programming 16 Wed Jul 27, 2016 8:47 pm
No new posts Remove Special Characters from Mainfr... Rodger Zhang All Other Mainframe Topics 6 Wed Jul 06, 2016 1:12 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us