Dazed and Confused
Ohmes, Matt
Matt.Ohmes@COGNOS.com
Thu, 22 Jul 1999 16:01:29 -0400
Hi Jeff,
I wish I could tell you exactly why you are 2 bytes off, but there are some
issues the may effect the storage size that you neglected to mention. But I
can at least discuss the issues involved.
There are two characteristics we need to separate when talking about passing
numeric items to subfiles; logical size and physical storage.
This is seen most easily in the dictionary. Elements describe the logical
characteristics of the data item. Items (within Record structures) define
physical storage. For example, in your case, this was the element:
Element FOE-QTY-ORDERED NUMERIC Size 11
...
Default Item Datatype IEEE FLOAT SIZE 8 &
...
This says logically that you will have up to 11 digits in this element. It
also LOOKS like the item will be 8 physical bytes of storage. However, the
Default Item datatype is only used when you create a new record in the
dictionary and don't specify a different storage. It's possible that YOUR
record may look like:
RECORD X
ITEM FOE-QTY-ORDERED INTEGER SIGNED SIZE 6
So, without knowing the exact data type from the data file, we don't know
the size of the item we write out to the subfile.
Additionally, you didn't mention if you are writing out a SUBTOTAL to the
subfile. If we report summary operations, we write the results of the
summary calculation to the subfile. And that result may be in floating
point even if the original item was integer.
I'm going to assume that the problem is as follows:
FOE-QTY-ORDERED is NOT a floating point item in the actual data record. (It
is probably an INTEGER Size 6) I'm also assuming you are reporting the item
directly, not a subtotal.
Now, your current defined item is:
DEF FOE-ORD-QTY NUM*11 = 0
This creates a floating point item of size 8, which would account for the 2
byte difference.
What we need to do is create two subfile items that match in internal
representation and physical length. You do this by specifying the datatype
and by using the SIZE option on the define statement.
So try this:
1. In the initial subfile
DEFINE D-FOE-QTY-ORDERED INTEGER*11 SIZE 6 = FOE-QTY-ORDERED
2. In the appended subfile
DEFINE D-FOE-QTY-ORDERED INTEGER*11 SIZE 6 = 0
I think that will work.
Good luck,
Matt
Matt.Ohmes@Cognos.Com
Cognos Corporation
909 E. Las Colinas Blvd.
Suite 1900
Irving, TX 75039
214-259-6200
"Matt doesn't really know anything. He just likes to pontificate a lot.
We refuse to acknowledge that he works for Cognos or that we have ever
met him or anyone with whom he's ever been associated. Don't lend him
money and don't let him talk to your sister!" ;-)
Jeff wrote:
>>>>>>>
I have two work arounds but it they are ugly:
1. In the initial subfile
DEF D-FOE-QTY-ORDERED NUM*11 = FOE-QTY-ORDERED
2. In the append subfile
DEF D-FOE-ORD-QTY CHAR*11 = "0"
I have put in the first work around but am still looking for the "real"
solution. Thanks to everyone who have offered the above suggestions.
*Due to the length of the original note, I have omitted it from this note.
Jeff Keepers
3M Valley, NE
<<<<<
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.