HP3000-L Archives

March 2007, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Roy Brown <[log in to unmask]>
Reply To:
Roy Brown <[log in to unmask]>
Date:
Mon, 26 Mar 2007 21:36:26 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (64 lines)
Calling all DataExpress (MBF UDA-whatever-it's-called-these-days) 
mavens.

I have a YYMMDD field that I am outputting as part of a report going to 
a SLK file.

I defined it as 8 long, DY, which is supposed to add a century to it.

Well it does, but it always adds '19' - there seems to be no pivot point 
that would get 2000 dates rendered correctly.

The manual talks about an ODBC_CENTURY_DATE var that you can set, though 
as ever, you cannot be quite sure this applies to the bit of MBF 
UDA-whatever-it's-called-these-days that you are trying to use. But I 
set it to 50 anyway; it made no difference.

Ho hum. No problem, I thought, and did my own pivot point logic, for 
CC-DATE:

"19"+DATE IF DATE > "500000"
"20"+DATE IF DATE <= "500000"

This works fine if I define CC-DATE as X8, and I get the expected 
representation, but of course, it's not a date field in the output.

If I give CC-DATE the type DY - and you don't seem to be able to give 
computed fields the subtype DY - the output is 01/01/1900, or some other 
strange corruption of a date, seemingly based on DXC reading the X(6) 
part of the date as if it were a DC date number.

I tried having CC-DATE as X, and then OUT-CC-DATE as =CC-DATE; but 
again, if it is type DY, I get 01/01/1900 or something in 2038....

Noting that when you work on DY dates, they are converted into and out 
of the intermediate field, I have something working, sort of, along the 
lines of

CC-DATE (8DY) is:

DATE  IF DATE > "500000"
DATE + 36525 IF DATE <= "500000"

and I guessed right to say 'C' rather than 'M' for the conversion...

I got the 36525 by doing 01/01/2000 - 01/01/1900 in Excel.

But there's a small range of dates for which the calculation gives the 
wrong answer, so I would need a further IF, if my users were handling 
any dates in that range...

This 'simple' change took me 2 hours, and I was going to let sleeping 
dogs lie, but now the user wants another date representation field 
added, and this time of a field whose X6 presentation figures largely in 
the sorting and summarising - so I don't want to redefine that as DY.

So someone, please put me out of my misery; how do I do what I need 
simply? What am I missing, or misunderstanding, in the DXC manuals?
-- 
Roy Brown        'Have nothing in your houses that you do not know to be
Kelmscott Ltd     useful, or believe to be beautiful'  William Morris

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2