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
 

 

Binary Number

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

New User


Joined: 17 Sep 2006
Posts: 24

PostPosted: Wed Aug 13, 2008 9:21 pm    Post subject: Binary Number
Reply with quote

I have one requirement, I have my current copybook as

05 PPQ-NUM-DAYS PIC 9(2).
Now there is a change of copybook , which says
05 PPQ-NUM-DAYS PIC 9(4) COMP.
05 PPQ-NUM-DAYS-XTL REDEFINES
PPQ-NUM-DAYS PIC 9(2)..

Now when i look at my data through File Aid

I am seeing like this
PPQ-NUM-DAYS::::: PPQ-NUM-DAYS-XTL
2/BI :::::::::: 2/NUM
(71-72) ::::: (71-72)R
9-------------- ::::: 10---------------
61681 ::::: 1
61682 ::::: 2
61683 ::::: 3
61684 ::::: 4

Can you please explaim me on these Binary Integers, and how is it equivalent to the non comp numbers, I mean (BI) 61682 = (NUM) 2.
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Wed Aug 13, 2008 9:29 pm    Post subject:
Reply with quote

61681 in hex is F0F1. The USAGE DISPLAY value of a PIC 9(02) field with value 1 (that is 01) is ... F0F1.

Redefining a PIC 9(02) field as PIC 9(04) COMP can be quite problematic ... what's the business case for this?
Back to top
View user's profile Send private message
krishna_Murty
Warnings : 2

New User


Joined: 17 Sep 2006
Posts: 24

PostPosted: Wed Aug 13, 2008 9:41 pm    Post subject: Reply to: Binary Number
Reply with quote

Can you explain me please how can it be problematic, The business need is that Number of days , they forsee that they may increase to more number of dizits. Also F0F1 = 01, but how 61681 = 01, please can you explain. Like how we have HEX ON compand , can we have Binary on comand

Please guide me here. And thank you for your sooner reply.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Wed Aug 13, 2008 10:44 pm    Post subject:
Reply with quote

The problem is that a COMP field accepts everything as a valid value. So the hex value for a DISPLAY field of 01 is F0F1; the COMP value for this number is 61681. So how do you know if F0F1 represents a DISPLAY value of 01 days or 61681 days?

Fire up the Windows calculator in scientific mode, enter 61681 as a decimal value then hit the HEX button. The display changes to F0F1, which is the hex value of 61681. Numbers only have meaning as agreed, and there are conflicting agreements possible with F0F1 -- as a COMP field it is 61681 decimal; as a COBOL DISPLAY field it is 01. You pays your money and takes your pick -- change the agreement you change the value. This is why I said it's problematic to do this.
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 Aug 14, 2008 2:31 am    Post subject:
Reply with quote

Hello,

Also, keep in mind that if the change is to accomodate more "days", all of the current values would need to be "converted" when the new copybook was activated. To do otherwise would become a maintenance nightmare. . .

Looking a bit further, "old" versions of the file (if this copybook is part of a file) may need to be converted as well if they are to be used.
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 SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm
No new posts how to mask the phone number kumarinfy DB2 4 Mon Apr 03, 2017 5:23 pm
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts what is meaning of the number in dcl Martylin PL/I & Assembler 2 Thu Mar 09, 2017 7:18 am


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