Strange Quiz data conversion error
Chris Sharman
chris.sharman@ccagroup.co.uk
Fri, 15 Feb 2002 13:36:03 -0000
This one bites frequently.
The defines are evaluated before the select processing, which means they're
evaluated on the header and trailer too.
You can either rewrite them to evaluate cleanly on the unselected records
too, live with the conversion errors, or, as you say, do two passes.
The select seems to contain some redundancy - checking that the first
character is "&", and also that it isn't any of "$", "W", or "\" ??
; this define should always work ...
def di-amt int*10 = 0 if ("&"<>dc-rec080[1:1]) &
else nconvert(dc-rec080[30:10])
Chris
-----Original Message-----
From: Mike Palandri [mailto:palandri@eug4ja.lane.edu]
Sent: 15 February 2002 13:21
To: mx% powerh-l@lists.swau.edu
Subject: Strange Quiz data conversion error
Powerhouse 7.10F3 OpenVMS Alpha
I have subfile whose records conatain a single 80 byte char element,
DC-REC080. There are 3 header records, 2 trailer records, and 305
detail records. The detail records contain a right justified integer
in bytes 30-39 that needs to be totaled.
I have a select statement that correctly selects the 305 details, and
defined items to extract the integer. (This is done with two defines
because I need the character item DC-AMOUNT for another purpose.)
ACCESS *GLST426
SELECT IF DC-REC080[1:1] <> "$" AND DC-REC080[1:1] <> "W" &
AND DC-REC080[1:1] <> "\" AND DC-REC080[1:1] = "&"
DEF DC-AMOUNT CHAR*10 = DC-REC080[30:10]
DEF DI-AMT INT*10 = NCONVERT(DC-AMOUNT)
The problem is that the DI-AMT define always results in a single data
conversion error. It doesn't matter if I set the report limit to 1, 100
or NOLIMIT, ther is always one error. However, when I report both items,
DI-AMT is always converted correctly.
The SELECT *is* selecting the correct records, as only 305 are processed,
and
I've examined them all.
Here's what's odd: I used the same SELECT to create a second subfile that
contains only the 305 detail records. The code runs fine against that
file. Somehow the presence of the header and trailer records in the
original
subfile is causing the data conversion error, despite them being selected
out.
I can't use a second subfile in production, and even though the data
conversion error doesn't seem to harm anything, I'd like to eliminate it.
Any ideas?
Thanks,
Mike
.
= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l@lists.swau.edu
Subscribe: "subscribe" in message body to powerh-l-request@lists.swau.edu
Unsubscribe: "unsubscribe" in message body to
powerh-l-request@lists.swau.edu
http://lists.swau.edu/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.
----------------------------------------------------------------------------
----
Date: Fri, 15 Feb 2002 05:07:00 -0800
-----------------------------------------------------------------------
Any views expressed in this message are those of the sender and not
necessarily those of CCA Group. The unauthorized use, disclosure,
copying or alteration of this message is forbidden. The contents of
this message may be confidential and/or privileged, copyright CCA Group
and are intended solely for the use of the individual or entity to whom
they are addressed. Whilst this message has been scanned, CCA Group
cannot guarantee that it is virus free or compatible with your systems
and accepts no responsibility for any loss or damage arising from its
use. The recipient is advised to run their own anti-virus software. If
you receive this message in error please contact
postmaster@ccagroup.co.uk immediately, destroy any copies and delete it
from your computer systems.