View previous topic :: View next topic |
Author |
Message |
brijesh_mca1 Beginner

Joined: 21 Nov 2005 Posts: 19 Topics: 10 Location: India
|
Posted: Thu Sep 13, 2007 2:45 am Post subject: How to find the ASCII values of alphabets in COBOL |
|
|
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 |
|
 |
CICS Guy Intermediate
Joined: 30 Apr 2007 Posts: 292 Topics: 3
|
Posted: Thu Sep 13, 2007 3:41 am Post subject: |
|
|
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 |
|
 |
brijesh_mca1 Beginner

Joined: 21 Nov 2005 Posts: 19 Topics: 10 Location: India
|
Posted: Thu Sep 13, 2007 3:51 am Post subject: |
|
|
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 |
|
 |
brijesh_mca1 Beginner

Joined: 21 Nov 2005 Posts: 19 Topics: 10 Location: India
|
|
Back to top |
|
 |
CICS Guy Intermediate
Joined: 30 Apr 2007 Posts: 292 Topics: 3
|
Posted: Thu Sep 13, 2007 4:14 am Post subject: |
|
|
Not making enough sense, but maybe you are looking for the SPECIAL-NAMES ALPHABET clause? |
|
Back to top |
|
 |
slade Intermediate
Joined: 07 Feb 2003 Posts: 266 Topics: 1 Location: Edison, NJ USA
|
Posted: Sat Sep 15, 2007 5:53 pm Post subject: |
|
|
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 |
|
 |
|
|