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: 8004
Location: Bellevue, IA

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 RULES(NOEVENPACK) in cobol jackzhang75 COBOL Programming 5 Wed Mar 29, 2017 12:47 am
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm


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