Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Using ASCII in COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
srajendran2

New User


Joined: 13 May 2008
Posts: 43
Location: Chennai

PostPosted: Wed Jan 07, 2009 5:26 pm    Post subject: Using ASCII in COBOL
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: 8125
Location: East Dubuque, Illinois, USA

PostPosted: Wed Jan 07, 2009 6:09 pm    Post subject:
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

Site Director


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

PostPosted: Thu Jan 08, 2009 12:11 am    Post subject:
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    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 XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us