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

pic x redefining comp val.


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

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Mon Apr 21, 2008 4:25 pm
Reply with quote

i have the following definitions..

Code:
01 Char-Value                      PIC  9(4)  COMP
                                              VALUE ZERO.

01 Char-Value-R                    REDEFINES  Char-Value.
   05  FILLER                      PIC  X(01).
   05  Char-Value-LSB              PIC  X(01).
       88  Uppercase-Char          VALUE 'A' THRU 'I'
                                         'J' THRU 'R'
                                         'S' THRU 'Z'
                                         X'4A' X'5A' X'80'
                                         X'9E' X'E0'.
       88  Lowercase-Char          VALUE 'a' THRU 'i'
                                         'j' THRU 'r'
                                         's' THRU 'z'
                                         X'6A' X'70' X'A1'
                                         X'9C' X'C0' X'D0'.



when i move 'P' to Char-Value-LSB i get the value of Char-Value as 0215.
Can anyone explain this ?

ashimer
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Apr 21, 2008 4:37 pm
Reply with quote

ashimer wrote:
when i move 'P' to Char-Value-LSB i get the value of Char-Value as 0215.
Can anyone explain this ?
That is 215 decimal, aka D7 hex, aka 'P' character........Why shouldn't you get a value of 215?
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Mon Apr 21, 2008 9:58 pm
Reply with quote

got it ... i was assuming decimal value of P to be 0223 ...
thanks cics guy ...
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 COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts Interviewers are surprised with my an... Mainframe Interview Questions 6
No new posts Cobol COMP-2 fields getting scrambled... Java & MQSeries 6
No new posts convert alphanumeric PIC X(02) to hex... COBOL Programming 3
Search our Forums:

Back to Top