Focal Point
BOTLOG

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

November 27, 2007, 05:48 PM
Don Robison
BOTLOG
I am trying to convert the following and I not having any success.

DEFINE FILE BOTLOG
BOT_START/D14=EDIT(START_STAMP);
BOT_END/D14=EDIT(END_STAMP);
BASE_DATE/YYMD=19700101;
HBASE_DATE/HYYMDIA=HDTTM(BASE_DATE,8,'HYYMDIA');
BOTLOG_START/HYYMDS=
HADD(HBASE_DATE,'MILLISECONDS',BOT_START,8,'HYYMDS');
BOTLOG_END/HYYMDS=
HADD(HBASE_DATE,'MILLISECONDS',BOT_END,8,'HYYMDS');
END
TABLE FILE BOTLOG
PRINT START_STAMP
END_STAMP
BOT_START
BOT_END
BASE_DATE
HBASE_DATE
BOTLOG_START
BOTLOG_END
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT EXL2K
END


My results:

START_STAMP END_STAMP BOT_START BOT_END BASE_DATE HBASE_DATE BOTLOG_START BOTLOG_END
00000000000000000001194577551931 00000000000000000001194579067022 1,194,577,551,931 1,194,579,067,022 1970/01/01 1970/01/01 12:00AM 1970/01/01 00:00:00 1970/01/01 00:00:00
00000000000000000001194577202240 00000000000000000001194577553121 1,194,577,202,240 1,194,577,553,121 1970/01/01 1970/01/01 12:00AM 1970/01/01 00:00:00 1970/01/01 00:00:00
00000000000000000001194508801697 00000000000000000001194508801767 1,194,508,801,697 1,194,508,801,767 1970/01/01 1970/01/01 12:00AM 1970/01/01 00:00:00 1970/01/01 00:00:00
00000000000000000001194505201392 00000000000000000001194505219347 1,194,505,201,392 1,194,505,219,347 1970/01/01 1970/01/01 12:00AM 1970/01/01 00:00:00 1970/01/01 00:00:00
00000000000000000001194927008648 00000000000000000001194927602587 1,194,927,008,648 1,194,927,602,587 1970/01/01 1970/01/01 12:00AM 1970/01/01 00:00:00 1970/01/01 00:00:00
00000000000000000001194926206507 00000000000000000001194927008972 1,194,926,206,507 1,194,927,008,972 1970/01/01 1970/01/01 12:00AM 1970/01/01 00:00:00 1970/01/01 00:00:00
00000000000000000001194925335878 00000000000000000001194926206941 1,194,925,335,878 1,194,926,206,941 1970/01/01 1970/01/01 12:00AM 1970/01/01 00:00:00 1970/01/01 00:00:00


Version 7.17
November 27, 2007, 06:18 PM
GinnyJakes
Here is one that I use. You can copy the define to multiple programs or make a define function out of it.

DEFINE FILE WBF_BOTLOG
BOT_START/D14=EDIT(START_STAMP);
BOT_END/D14=EDIT(END_STAMP);
BASE_DATE/YYMD=19700101;
HBASE_DATE/HYYMDS=HDTTM(BASE_DATE,8,'HYYMDS');
BOTLOG_START/HYYMDS=
      HADD(HBASE_DATE,'MILLISECONDS',BOT_START,8,'HYYMDS');
BOTLOG_END/HYYMDS=
      HADD(HBASE_DATE,'MILLISECONDS',BOT_END,8,'HYYMDS');
PRT_START/HYYMDS=HADD(BOTLOG_START,'HOUR',-6,8,'HYYMDS');
PRT_YYMD/YYMD=HDATE(PRT_START,'YYMD');
PRT_END/HYYMDS=HADD(BOTLOG_END,'HOUR',-6,8,'HYYMDS');
DIFFMIN/D12.4=(HDIFF(PRT_END,PRT_START,'SECOND','D12.4'))/60;
BEGHR/I2=HPART(PRT_START,'HOUR','I2');
END
TABLE FILE WBF_BOTLOG
SUM
     CNT.SCHED_ID AS 'Row Count'
BY PRT_YYMD AS 'Run Date'
HEADING
"BOTLOG on P2 as of  <+0>&DATEMDYY<+0> "
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='TIMES NEW ROMAN',
     SIZE=10,
     RIGHTGAP=0.125000,
$
TYPE=DATA,
     BACKCOLOR=( RGB(217 179 255) 'WHITE' ),
$
TYPE=TITLE,
     STYLE=BOLD,
$
TYPE=HEADING,
     FONT='ARIAL',
     SIZE=12,
     BACKCOLOR=RGB(196 136 255),
     STYLE=BOLD,
$
ENDSTYLE
END
  


Mine is almost the same as yours but I added the PRT dates to adjust from GMT.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
February 11, 2008, 01:53 PM
Tim J
Don:

Were you able to get your calculations to come out correctly?

I am getting the same results when I use the formulas as well:

BOTLOG_START
1970/01/01 00:00:00

BOTLOG_END
1970/01/01 00:00:00

When I use Ginny's suggestion, I get:
PRT_START
1969/12/31 18:00:00

PRT_END
1969/12/31 18:00:00

Thanks,
Tim J
February 11, 2008, 02:06 PM
GinnyJakes
Tim,

I don't know why my defines aren't working for you. I wrote this code when we were using 5.3.3 and we are now up to 7.6.2 and the code still works. BTW, WBF_BOTLOG is a synonym that we created for BOTLOG just in case that makes a difference.

Can you post your code so that I can compare it to mine?

Also, please update your profile signature to show your product suite, releases, and platforms so that we can better help you.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
February 11, 2008, 02:43 PM
Tim J
Here is the code I am using:

DEFINE FILE MKT_BOTLOG
BOT_START/D14=EDIT(START_STAMP);
BOT_END/D14=EDIT(END_STAMP);
BASE_DATE/YYMD=19700101;
HBASE_DATE/HYYMDIA=HDTTM(BASE_DATE,8,'HYYMDIA');
BOTLOG_START/HYYMDS=
      HADD(HBASE_DATE,'MILLISECONDS',BOT_START,8,'HYYMDS');
BOTLOG_END/HYYMDS=
      HADD(HBASE_DATE,'MILLISECONDS',BOT_END,8,'HYYMDS');
PRT_START/HYYMDS=HADD(BOTLOG_START,'HOUR',-6,8,'HYYMDS');
PRT_YYMD/YYMD=HDATE(PRT_START,'YYMD');
PRT_END/HYYMDS=HADD(BOTLOG_END,'HOUR',-6,8,'HYYMDS');
END

TABLE FILE MKT_BOTLOG
PRINT 
BOTLOG_START
BOTLOG_END
PRT_START
PRT_END
MKT_BOTLOG.START_STAMP
MKT_BOTLOG.END_STAMP
MKT_BOTLOG.ERROR
BY MKT_BOTLOG.JOB_DESC AS 'Job Description'



Here are some START_STAMP Values, so I know they are different:

START_STAMP
00000000000000000001202704381936
00000000000000000001200804241360
00000000000000000001200804181330
00000000000000000001201883101332

We have WF 7.6.4

Thanks,
Tim J
February 11, 2008, 03:29 PM
GinnyJakes
I took your code and ran it in my environment after changing only the master name and the dates looked fine. Here is an example:

BOTLOG_START BOTLOG_END PRT_START PRT_END START_STAMP END_STAMP ERROR 
2008/01/17 12:20:01 2008/01/17 12:20:18 2008/01/17 06:20:01 2008/01/17 06:20:18 00000000000000000001200572401265 00000000000000000001200572418661 1 



Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
February 11, 2008, 04:08 PM
Kevin Sherrard
I tried to run your code and I still get...

BOTLOG_START = 01/01/1970 00:00:00
BOTLOG_END = 01/01/1970 00:00:00
PRT_START = 1969/12/31 18:00:00
PRT_END = 1969/12/31 18:00:00


WebFOCUS 7.6.11 HF 6 Client Reporting Server/Caster
7.6.11 PDS Server on MVS DB2
1.46R Tandem
7.6.11 IWAY SQL Server 2000
Access
February 11, 2008, 04:57 PM
susannah
DOn,Your botlog is a focus repository?
You don't say, actually.
I don't know that it matters,
Ginny,if yours is focus you shouldn't have to make your own master, you should be able to use the botlog.mas. or am i missing something?
Don, Have a look at this article on reading botlog.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
February 11, 2008, 06:05 PM
GinnyJakes
Mine is DB2 and I know I don't have to make a master. They were already in place when I got here so I just use them.

As for Don and Kevin's problem, Kevin's code works fine in my environment. But if Kev's repository is FOCUS, that might make a difference. Would have to see the master he is using. Kevin, can you post, please?


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
February 12, 2008, 11:05 AM
Kevin Sherrard
We are using DB2 on MVS....

Here is the Master I created....

FILENAME=MKT_BOTLOG, SUFFIX=EDA , $
SEGMENT=MKT_BOTLOG, SEGTYPE=S0, $
FIELDNAME=STAT_BT_NAME, ALIAS=STAT_BT_NAME, USAGE=A12, ACTUAL=A12, $
FIELDNAME=JOB_DESC, ALIAS=JOB_DESC, USAGE=A90V, ACTUAL=A90V, $
FIELDNAME=SCHED_ID, ALIAS=SCHED_ID, USAGE=A12, ACTUAL=A12, $
FIELDNAME=CASTER_USER, ALIAS=CASTER_USER, USAGE=A48V, ACTUAL=A48V, $
FIELDNAME=START_STAMP, ALIAS=START_STAMP, USAGE=A32, ACTUAL=A32, $
FIELDNAME=END_STAMP, ALIAS=END_STAMP, USAGE=A32, ACTUAL=A32, $
FIELDNAME=TELLME, ALIAS=TELLME, USAGE=A1, ACTUAL=A1, $
FIELDNAME=ERROR, ALIAS=ERROR, USAGE=A1, ACTUAL=A1, $


WebFOCUS 7.6.11 HF 6 Client Reporting Server/Caster
7.6.11 PDS Server on MVS DB2
1.46R Tandem
7.6.11 IWAY SQL Server 2000
Access
February 12, 2008, 12:13 PM
GinnyJakes
Your master looks just like mine. Have you tried refreshing your synonym? I am at a loss to explain the behaviour you are getting.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
February 12, 2008, 12:40 PM
susannah
the botlog.FOC master is different in that it doesn't have /An V
FILE=BOTLOG         ,SUFFIX=FOC                                                 
SEGNAME=SEG01   ,SEGTYPE=S01                                                    
FIELDNAME   =STAT_BT_NAME       ,E01         ,A12      , $                      
FIELDNAME   =JOB_DESC           ,E02         ,A90      , $                      
FIELDNAME   =SCHED_ID           ,E03         ,A12      , $                      
FIELDNAME   =CASTER_USER        ,E04         ,A48      , $                      
FIELDNAME   =START_STAMP        ,E05         ,A32      ,                        
      INDEX=I,$                                                                 
FIELDNAME   =END_STAMP          ,E06         ,A32      , $                      
FIELDNAME   =TELLME             ,E07         ,A1       , $                      
FIELDNAME   =ERROR              ,E08         ,A1       , $





In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
February 12, 2008, 02:24 PM
Kevin Sherrard
I took out the Vs but that did not help either.


WebFOCUS 7.6.11 HF 6 Client Reporting Server/Caster
7.6.11 PDS Server on MVS DB2
1.46R Tandem
7.6.11 IWAY SQL Server 2000
Access
February 14, 2008, 10:18 AM
susannah
Kevin, try redefining those V fields rather than editing the master
Do a straight dump
PRINT E01 NEWJOBDESC E03 NEWUSER
E05 E06 E07 E08
and then look at the records in a text file
and see if they contain what you expect them to contain...




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
February 14, 2008, 12:01 PM
Tim J
Susannah:

I used your code in the article you submitted and I was able to get the "real dates" I needed! For some reason, I can't get the WebFOCUS date functions to get me anything except "1970/01/01 00:00:00".

I will use your logic to convert my START_STAMP and END_STAMP values in my BOTSCHED file.

Thank you to all who responded and contributed to this topic! These Date and Time topics can create some interesting threads.

Tim J
February 20, 2008, 01:58 PM
Kevin Sherrard
The problem was with the define.

I had to change this...

BOTLOG_START/HYYMDS=
HADD(HBASE_DATE,'MILLISECONDS',BOT_START,8,'HYYMDS');
BOTLOG_END/HYYMDS=
HADD(HBASE_DATE,'MILLISECONDS',BOT_END,8,'HYYMDS');

to this...

BOTLOG_START/HYYMDS=
HADD(HBASE_DATE,'MILLISECOND',BOT_START,8,'HYYMDS');
BOTLOG_END/HYYMDS=
HADD(HBASE_DATE,'MILLISECOND',BOT_END,8,'HYYMDS');

I changed MILLISECONDS to MILLISECOND.

Kevin


WebFOCUS 7.6.11 HF 6 Client Reporting Server/Caster
7.6.11 PDS Server on MVS DB2
1.46R Tandem
7.6.11 IWAY SQL Server 2000
Access
February 21, 2008, 01:19 AM
susannah
ah. good find. congrats.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID