MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to find the ASCII values of alphabets in COBOL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
brijesh_mca1
Beginner


Joined: 21 Nov 2005
Posts: 19
Topics: 10
Location: India

PostPosted: Thu Sep 13, 2007 2:45 am    Post subject: How to find the ASCII values of alphabets in COBOL Reply with quote

Hi,

My requirement is to find ASCII values of alphabets thru COBOL program.
or any continous integer values will solve the purpose.

I used ORD function
COMPUTE X = FUNCTION ORD('A')

It gives the integer value , However values are not continous,there are brakes , It start with 194, and at J it resets to 210.

Thanks in Advance
_________________
Brijesh(India Is Great)
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Thu Sep 13, 2007 3:41 am    Post subject: Reply with quote

ASCII or EBCDIC?
The hex value?
Not contiguous? Of course not, there other values between I and J, X'CA' to X'D0'.....
Back to top
View user's profile Send private message
brijesh_mca1
Beginner


Joined: 21 Nov 2005
Posts: 19
Topics: 10
Location: India

PostPosted: Thu Sep 13, 2007 3:51 am    Post subject: Reply with quote

II have a string, anf based on albhabet I need to make a Numeric String.

For eg , say A=10, B=11,C=13,D=14........

And I am having a string say Hello
so I need to convert it to 17 14 21 21 24.

Hex will also do. If I use ORD function, A is having value equal to 194, till I for each alphabet its increasing by 1. However for J its suddenly become 210 and so on.
_________________
Brijesh(India Is Great)
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
brijesh_mca1
Beginner


Joined: 21 Nov 2005
Posts: 19
Topics: 10
Location: India

PostPosted: Thu Sep 13, 2007 4:02 am    Post subject: Reply with quote

I mean ORD is converting Alphabets to EBCDIC codes, However I need ASCII values.


http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3LR10/APPENDIX1.3.1?SHELF=&DT=20020920180651&CASE=

Shows EBDCI values
_________________
Brijesh(India Is Great)
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Thu Sep 13, 2007 4:14 am    Post subject: Reply with quote

Not making enough sense, but maybe you are looking for the SPECIAL-NAMES ALPHABET clause?
Back to top
View user's profile Send private message
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Sat Sep 15, 2007 5:53 pm    Post subject: Reply with quote

Hi Brijesh,

This may be of some help. It was submitted at another COBOL site by Michael C. Mattias.

http://www.talsystems.com/tsihome_html/downloads/C2IEEE.htm
_________________
Regards, Jack.

"A problem well stated is a problem half solved" -- Charles F. Kettering
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group