Focal Point
maintain - testing date field values

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3921020252

October 15, 2007, 02:07 PM
Dave Ayers
maintain - testing date field values
I seem to be having some trouble testing date fields within Maintain. When I went looking for info, the DS 5.3 documentation didn't say much, then found a bit here from Mark D. that said Maintain can't test literals, only variables (which sounds a bit lacking).

So one question is: can I test for an empty value ? Would I use a ' ' or 0 for the test literal, or do I have to assign that to a variable ?

ie. If stk.Date_Fld EQ ' ' (or EQ 0) ???

also: For all DbNam.Seg.KeyFld Into stk
Where date_Fld NE ' ' (or EQ 0) ???

And why would maintain lack the capability to test for literal values in date fields and not other format types ?

Thanks,

This message has been edited. Last edited by: Dave Ayers,


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
October 16, 2007, 09:44 AM
Maintain Wizard
Morning Dave,
I have a technique that always works for me. Some of the other ways, testing for either blank or 0 can be inconsistent. Here is what I do:

Compute EmptyDate/YMD;
For all next field into stk
where date_field NE EmptyDate;

or

If date_field EQ EmptyDate then...

Just make sure that the format of EmptyDate is the same as your date fields. Now, as for having to use a variable instead of a literal, what is the value of an unset date? Should it be blank? Dec 31, 1900? Zero? I'm not really sure. I find that using a variable removes the question.

Mark
November 02, 2007, 03:10 PM
Dave Ayers
Mark,

Thanks for the tip. It seems to have worked, through I had so many issues (business rules as well as technical) with that particular program it's hard to tell at this point.

Also that is something that should be clearly stated in the Maintain documentation ! I can only say that there was no mention of it in the 5.3 online docs.

Heres another little nugget I discovered recently:

In the current set of Maintain programs I'm working on, I am using mostly focexecs to source data for record selection from HTML tables. Some of them have no Calls at all in them. Fine as far as it goes, but I was getting a FOC03839 'Invalid In State' errors on my remote deployment compile.

After a Tech Support Case to find out what in the world that error meant, , and trying 'EXEC xxx Drop' without consistent success, I inserted a Call to a dummy, no op, .mnt before the first EXEC, and no more errors. It's a damn, dumb workaround, but it works !

Thanks for your help,


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server