Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
krishna_Murty
Warnings : 2

New User

Joined: 17 Sep 2006
Posts: 24

 Posted: Wed Aug 13, 2008 9:21 pm    Post subject: Binary Number 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.

Robert Sample

Global Moderator

Joined: 06 Jun 2008
Posts: 8280
Location: Dubuque, Iowa, USA

 Posted: Wed Aug 13, 2008 9:29 pm    Post subject: 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?
krishna_Murty
Warnings : 2

New User

Joined: 17 Sep 2006
Posts: 24

 Posted: Wed Aug 13, 2008 9:41 pm    Post subject: Reply to: Binary Number 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.
Robert Sample

Global Moderator

Joined: 06 Jun 2008
Posts: 8280
Location: Dubuque, Iowa, USA

 Posted: Wed Aug 13, 2008 10:44 pm    Post subject: 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.
dick scherrer

Site Director

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

 Posted: Thu Aug 14, 2008 2:31 am    Post subject: 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.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Repeat Sequence Number Until change i... rahulabvp DFSORT/ICETOOL 6 Thu Mar 29, 2018 12:51 pm add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 11 Thu Feb 22, 2018 5:37 pm PARSE GDG name to separate generation... Abid Hasan SYNCSORT 2 Sun Feb 11, 2018 3:40 pm Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm Binary to display characters Roy Ware SYNCSORT 3 Tue Sep 19, 2017 8:46 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us