As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
USER person who has submitted the report PROC the report they have called RUNDATE the date the report was submitted STARTED the time the report was submitted
MODIFY FILE USERLOG FIXFORM USER/8 X1 PROC/8 X1 RUNDATE/8 X1 STARTED/8 MATCH USER PROC RUNDATE STARTED ON MATCH REJECT ON NOMATCH INCLUDE DATA &USER &PROC &RUNDATE &STARTED END
If the variables &USER and &PROC have been fully populated then the record is correctly written
However if the data in USER or PROC is not the max length, as it can vary, then the whole file gets misaligned:
USER____ PROC____ RUNDATE_ STARTED_ ENDED___ RETURNED 1234ABCD2007/12/12 15.48.15 0
This is the first time I have used Modify file and I am not sure how to pad out my variables so that the length is always that of the field it is being written to?
I am sure there must be a very simple solution to this, but I have yet to stumble across it!!
Many thanks
Mark.This message has been edited. Last edited by: mark66,
WebFocus 765. iSeries v5r4
Posts: 175 | Location: England | Registered: April 11, 2006
Change to use FREEFORM, and sepearte the &fields with a comma, end with a $
-SET &USER = &G_USER;
-SET &RUNDATE = &YYMD;
-SET &PROC = &REPORT;
-SET &STARTED = HHMMSS('A8');
MODIFY FILE USERLOG
FREEFORM USER PROC RUNDATE STARTED
MATCH USER PROC RUNDATE STARTED
ON MATCH REJECT
ON NOMATCH INCLUDE
DATA
&USER, &PROC, &RUNDATE, &STARTED,$
END
Which should allow for variable lengths of hte fields.
Alan. WF 7.705/8.007
Posts: 1451 | Location: Portugal | Registered: February 07, 2007
And finally my last question (I hope) is how can I calculate the difference in two time stamps?
My process is basically -
1, Write initial entry to log (as coded above) 2, Call report 3, Update Initial entry to log with an endtime and number of rows returned.
So my log file contains two fields, STARTED and ENDED, and in the file that was suggested to me the time fields were declared as A8 and are populated in the style:
I want to calculate the run time (difference between the two fields in seconds), however I cannot run a calculation on Alpha fields. Do I need to change the field format for STARTED and ENDED? If so, what format would be appropriate and what would be the correct method to populate the variables?
Thanks again for everyone’s help!!
WebFocus 765. iSeries v5r4
Posts: 175 | Location: England | Registered: April 11, 2006
Basically splitting the time in to component parts with EDIT, then using EDIT to convert to integer. then you can simply subtract the 2 fields. This can be done in a define in the TABLE request.
Alan. WF 7.705/8.007
Posts: 1451 | Location: Portugal | Registered: February 07, 2007
It appears to be an interesting procedure, how do you create the log entries and at what moment are you putting this in the database? When does the record get the endtime and what is the field returned for?
Is this not a build in function in Webfocus?
BTW you can put the calculated seconds in a computed field in the master.
Frank
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006
Basically splitting the time in to component parts with EDIT, then using EDIT to convert to integer. then you can simply subtract the 2 fields. This can be done in a define in the TABLE request.
Awesome, again that has worked just great!!
However, I don't quite understand why the final EDIT to extract the seconds only uses five dollar symbols and not six?
I would have thought it needed 6 as the format of the time is : 12:34:56, therefore it needs to ignore the first 6 characters? It does work with both 5 and 6 dollars, but why?
Again, thank you for all your help today
WebFocus 765. iSeries v5r4
Posts: 175 | Location: England | Registered: April 11, 2006
Oh Error, It should be 6 $s' Mark, not 5, and because the time delimiter is a '.' (not a ':'), it is legal to put that into a numeric field. Well spotted
Alan. WF 7.705/8.007
Posts: 1451 | Location: Portugal | Registered: February 07, 2007
Originally posted by FrankDutch: It appears to be an interesting procedure, how do you create the log entries and at what moment are you putting this in the database? When does the record get the endtime and what is the field returned for?
Is this not a build in function in Webfocus?
BTW you can put the calculated seconds in a computed field in the master.
Frank
Hi Frank, I am not sure if this is already a built in function of WebFocus as I do not know the product very well yet, but I would imagine there must be some similar log functionality?
Basically I am trying to improve a process that we already have running here:
Every one of our reports starts with a:
-INCLUDE STARTUP
This procedure sets many things like what data libraries on the AS400 our user should be pointed to depending on their location etc. There is also a bit of script that does a WRITE to a log.fex. This includes the users id, the report they have submitted (FOCFOCEXEC), the system date and system time and their location.
And again every one of our reports ends with a:
-INCLUDE FINISH
This procedure does a similar 2nd WRITE to log.fex, again with the same details.
Therefore every report that runs creates 2 lines on what is really just a text file. The problem is that this is not a true database file and so when I want to query the file to see who has run a report today it takes a very long time. We also have a problem with users requesting too much data and extracting thousands of records that takes a long time. Therefore the start and end records can be 50 log records apart and are not the easiest to match up.
So I decided to create a Focus log file, with the aim to write a record on the report being called and then to locate and update the same record when the report finishes, with extra data like the runtime and the number of rows extracted.
I will now replace the old writes to log.fex in the STARTUP and FINISH procedures with the new code I have refined today. And hopefully I should now be able to create some snazzy reports to help us really analyse the use of WebFocus in the company and target the problem reports and users. We can also analyse who is actually using the resource and how frequently they logon, to help us manage who needs a license etc.
WebFocus 765. iSeries v5r4
Posts: 175 | Location: England | Registered: April 11, 2006
My log file has been running just great for the last week, but has suddenly decided to stop working.
For some reason the programs just hang when trying to write or update any record on the Focus Database file.
I can still read from the file and run any reports against it, but I cannot do any modifications? I have tried to delete a record and again it just hangs when trying to modify the file and does not return any error message.
The file is showing as being 592KB in size and has around 3366 records in it. Is this too big? I did a quick Google search and it says the max size is 2gb!
I have created a new Focus file and the process works just fine, but for some reason my proper log file is broke!!
Anyone have any ideas?
Many thanks
Mark
WebFocus 765. iSeries v5r4
Posts: 175 | Location: England | Registered: April 11, 2006
There should be no problems with the size you have, though an S4 like you have can get a bit disorganised. Again that should not stop a maintenence process, just slow it down.
What platform are you on?
Are you using the FOCUS sink machine, FOCSUnn?
Alan. WF 7.705/8.007
Posts: 1451 | Location: Portugal | Registered: February 07, 2007
As I see it, for every FOCEXEC which is run you are updating the FOCUS file. It is probable that there were 2 procedures who tried to update your FOCUS file simultaneously and this could have caused some type of corruption of the file, pointers creating a loop.
I would suggest one of 2 possibilities: 1. Using a Simultaneous User Focus file. 2. Using a relational database.
Personally I would go with the 2nd suggestion.
Good luck!
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006