Re: USING Format for DATES
Posted in 1998
On Wed, 9 Sep 1998, Lars Johansson wrote: > Working on Y2K Problems I have encountered a problem when using > DISPLAY DATEVAR USING "yyyymm". The "yyyymm" format has worked in > older versions of Informix 4GL, that will be version < 6.00. Now, on > both 6.05.UD1 (DataGeneral) and 7.20.UD1 (Sun Solaris), I have the > problem that it gives me a empty string but ONLY when linking with > -shared option. The -static linking works. If the behaviour of a program is altered by the linking method and is not due to uninitialized variables, then it is a bug, almost inevitably. I can't immediately think of a circumstance where it wouldn't be a bug. I can reproduce the problem on Solaris 2.6 with 7.20.UD1 using the following code: MAIN DEFINE dv DATE WHENEVER ANY ERROR STOP LET dv = MDY(1, 1, 2345) DISPLAY dv USING "yyyymm" END MAIN With both p-code and static c-code, I get the expected 234501 output; with shared c-code, I get a null. > I would assume that it must have been a Informix "feature" that the > "yyyymm" format has ever worked. Well, yes, I suppose. The USING clause is supposed to work in all configurations and should produce a valid answer given valid input. > I suppose that a DATE format always must include both Y, M and D parts > in the format (otherwise, it wouldn't be a DATE would it?) No. There are some problems on the input side of I4GL where the newest versions don't let you enter partial dates but older versions did allow you to do so, but on the output side (eg DISPLAY), there has never been any question but that partial output is valid. > But Why does it work on -static linking ?? Because it is supposed to work. The fact that it doesn't work with -shared linking is a bug. The p-code system handles it fine. > Anyone likes to comment on this ?? It will probably be surprisingly painful to fix; it probably involves some complex interaction between multiply defined global variables in different dynamically loaded libraries, or something equally esoteric. > Would there be any work around ?? Either don't use shared linking or use p-code or don't do it. Nothing particularly simple or useful, I regret to say -- just flippant answers along the lines of "Doctor, it hurts when I do this?". Yours, Jonathan Leffler (jleffler@informix.com) #include <witticism.h> Guardian of DBD::Informix v0.60 -- http://www.perl.com/CPAN Informix IDN for D4GL & Linux -- http://www.informix.com/idn