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

Using ASCII in COBOL


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

New User


Joined: 13 May 2008
Posts: 56
Location: Chennai

PostPosted: Wed Jan 07, 2009 5:26 pm
Reply with quote

Hi,

In one of the applications they have few characters defined at the 88 level. which would be used to check every letter in a record of the input file. The characters defined in the 88 level variable is given below
Code:

    ' '  '-'  '='                                       
   '¢'  '.'  '<'  '('  '+'  '|'  '&'  '!'  '$'  '*'  ')'  ';'   

   '¬' '/' '¦' ',' '%' '_' '>' '?' ':' '#' '@' '{'   

   'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' '}' 'J' 'K'   

   'L' 'M' 'N' 'O' 'P' 'Q' 'R' '\' 'S' 'T' 'U' 'V'   

   'W' 'X' 'Y' 'Z' X'79' '0' '1' '2' '3' '4' '5' '6'

   '7' '8' '9' X'A1' X'A2' X'A3' X'A4' X'A5' X'A6'   

   X'A7' X'A8' X'A9' X'7D' X'7F' X'81' X'82' X'83'   

   X'84' X'85' X'86' X'87' X'88' X'89' X'91' X'92'   

   X'93' X'94' X'95' X'96' X'97' X'98' X'99'.   
   


For all the characters shown above there is an equivalent ASCII value. Is there function available which i can use to check ASCII value of a letter in the record instead of using the 88 level variable to check it?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Jan 07, 2009 6:09 pm
Reply with quote

It is not possible to tell an ASCII character from an EBCDIC character without knowing the context of the file creation.

For example, an EBCDIC '<' character is hex 4C. Hex value 4C in ASCII is an 'L'. So when you see a hex '4C' character in the file, is it a less than sign or an L? The answer is that it depends -- it could be either. There is absolutely no way by inspection to determine if a given set of characters is in EBCDIC or ASCII.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jan 08, 2009 12:11 am
Reply with quote

Hello,

Quote:
Is there function available which i can use to check ASCII value of a letter in the record instead of using the 88 level variable to check it?
What is the problem with the current implementation? It is quite clear.

What would you want in place of this?

It sounds like there is more to your question than you have posted. If you clarify what you are really trying to do, someone may have another suggestion.
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