Focal Point
7.1.6 vs 7.6.4 Problem

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

May 27, 2008, 04:36 PM
ColdWhiteMilk
7.1.6 vs 7.6.4 Problem
I've got the following define in WebFOCUS 7.6.4 to translate out a date value (this came from the focal point article "Zulu Time" - Zulu Time).

DEFINE FILE SOC_CLR_AUDITLOG
-*Reformat CH_CREATE_DATE>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
TEMP1/A16= SUBSTR(16,EDIT(CH_CREATE_DATE),7,16,16,TEMP1);
TEMP2/D13= EDIT(TEMP1);
GMTBASE/I8YYMD WITH CH_CREATE_DATE = 19700101;
GMTBASE2/YYMD= GMTBASE;
GMTBASE2DTM/HYYMDIA= HDTTM(GMTBASE2,8,'HYYMDIA');
FOCUSDATE/HYYMDIA= HADD(GMTBASE2DTM,'SECONDS',TEMP2,8,'HYYMDIA');
-* You have to adjust this result by your GMT offset.
FOCUSDATE/HYYMDIA= HADD(FOCUSDATE,'HOUR', -4,8,'HYYMDIA');
-* Downloadable form:
CH_CREATE_DT/A20 = HCNVRT(FOCUSDATE,'(HYYMDIA)',20,'A20');
END

When I run this in 7.6.4, with a value of "1152189445" for CH_CREATE_DATE, I get "2006/07/06 8:37AM" for CH_CREATE_DT.

When I run this in 7.1.6, with a value of "1152189445" for CH_CREATE_DATE, I get "1969/12/31 8:00PM" for CH_CREATE_DT.

Since this is same data source, and the same defines, why would this be happening?


Production - 7.6.4
Sandbox - 7.6.4
May 28, 2008, 08:42 AM
jnc
1969/12/31 is the 0 date.

Here is what I've used for 7.1....

-SET &OFFSETHOURS = 8;
DEFINE FILE CAR
CH_CREATE_DATE/D16 WITH COUNTRY = 1152189445;

OFFSETHOURS/D5.1 WITH COUNTRY = &OFFSETHOURS ;
OFFSETDAYS/D7.5 = IF OFFSETHOURS LT 0 THEN 1+OFFSETHOURS/24 ELSE
OFFSETHOURS/24;
GMTCORRECT/D6.4 = OFFSETDAYS + .00005 ;

-* use this if alpha.....
-*TEMP1/A13 = SUBSTR(32,CH_CREATE_DATE,20,32,13,TEMP1);
-*TEMP2/D13 = EDIT(TEMP1);

TEMP2/D13 = CH_CREATE_DATE;
tMINUTES/I10 = TEMP2/(60*1000) ;
tDAYS/D10.4 = tMINUTES/(60*24);
tDATE/D10.4 = tDAYS + 25567 + GMTCORRECT ;
EXCELDATE/D10.4 = tDATE + 1 ;
GETDATE/I5 = tDATE ;
DAYSHARE/D6.4 = tDATE - GETDATE ;
HOURSHARE/D6.2 = DAYSHARE * 24 ;
HOURS/I2L = HOURSHARE ;
MINUTESSHARE/D6.2 = HOURSHARE - HOURS;
MINUTES/I2L = MINUTESSHARE * 60;
iDATE/I8YYMD = DTYMD(tDATE,iDATE);
CDATE/A14 = EDIT(iDATE)|EDIT(HOURS)|EDIT(MINUTES);
CH_CREATE_DT/HYYMDS = HINPUT(14, CDATE, 8, 'HYYMDS');
END
TABLE FILE CAR
PRINT CH_CREATE_DT
END


WebFocus 7x, 8x, Win / Linux, any output format
May 28, 2008, 09:50 AM
ColdWhiteMilk
Thanks. I'll give this a shot.

Any idea why the defines that work in 7.6.4 would not work in 7.1.6?


Production - 7.6.4
Sandbox - 7.6.4
May 28, 2008, 10:00 AM
Prarie
Code tightening.

Do a search of 7.1. on this forum and you'll see lots of discussion on the topic.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
and whats goofier, the article was written on 5.2.8.
I just tried some versions of the 2 examples you all wrote above in 765 and i got gibberish.
I'll research, and update the article, but probably not till after Summit.
-S




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
correction:
i tried this example in 765 and it worked fine
DEFINE FILE CAR
-*TEMP1/A16= SUBSTR(16,EDIT(CH_CREATE_DATE),7,16,16,TEMP1);
-*TEMP2/D13= EDIT(TEMP1); 
TEMP2/D13 WITH COUNTRY= 1152189445 ;
GMTBASE/I8YYMD WITH COUNTRY= 19700101;
GMTBASE2/YYMD= GMTBASE;
GMTBASE2DTM/HYYMDIA= HDTTM(GMTBASE2,8,'HYYMDIA');
FOCUSDATE/HYYMDIA= HADD(GMTBASE2DTM,'SECONDS',TEMP2,8,'HYYMDIA');
-* You have to adjust this result by your GMT offset.
FOCUSDATE/HYYMDIA= HADD(FOCUSDATE,'HOUR', -4,8,'HYYMDIA');
-* Downloadable form:
CH_CREATE_DT/A20 = HCNVRT(FOCUSDATE,'(HYYMDIA)',20,'A20');
END
  
TABLE FILE CAR
PRINT CH_CREATE_DT
END





In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
cwm
can we see a dump of eachof your defined variables, 1 by 1, for the 71 execution and for the 76 execution.
That way we can see exactly where the oops is.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
I also thought that since the article was written on 5.2.*, that there would not be a difference between 7.1.6 and 7.6.4.

7.1.6:

CH_CREATE_DATE 1152189445
TEMP1 1152189445
TEMP2 1,152,189,445
GMTBASE 1970/01/01
GMTBASE2 1970/01/01
GMTBASE2DTM 1970/01/01 12:00AM
FOCUSDATE 1969/12/31 8:00PM
CH_CREATE_DT 1969/12/31 8:00PM

7.6.4:

CH_CREATE_DATE 1152189445
TEMP1 1152189445
TEMP2 1,152,189,445
GMTBASE 1970/01/01
GMTBASE2 1970/01/01
GMTBASE2DTM 1970/01/01 12:00AM
FOCUSDATE 2006/07/06 8:37AM
CH_CREATE_DT 2006/07/06 8:37AM


Production - 7.6.4
Sandbox - 7.6.4
One "code tighting" that happenned somewhere between v 5.2.1 and 7.1.3 was in HADD:

The argument "MILLISECONDS" has to be "MILLISECOND". That one took me a while to figure out in our last upgrade. I remember someone else pointed this out also not too long ago.


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
quote:
The argument "MILLISECONDS" has to be "MILLISECOND". That one took me a while to figure out in our last upgrade. I remember someone else pointed this out also not too long ago.


Oh, jeez. That worked.

I don't think I ever would have figured out that one.


Production - 7.6.4
Sandbox - 7.6.4