Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 8165
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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us