Focal Point Banner


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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
Report Time
 Login/Join
 
Silver Member
posted
Is there a way to display the time it took to run a report?


WebFocus Reporting 7.1.1 Windows
 
Posts: 34 | Registered: November 22, 2005Report This Post
Guru
posted Hide Post
I have used the HHMMSS function to grab the current time and assign it to an amper variable that I later can see when I view source. I get the time at the top of the FEX, the bottom, and around routines of interest then do a -TYPE of the various variables at the end.
It may not be dead accurate but it has helped me demonstrate where the time is being spent.
 
Posts: 252 | Location: USA | Registered: April 15, 2003Report This Post
Silver Member
posted Hide Post
Does assigning a function to an amper variable mean that I'd have to create a virtual field (define) on a table? Could you provide more information on the 'TYPE', I'm relatively new to WebFocus (using it for about a month now) so forgive me for my ignorance. Thanks so much for your reply, I really appreciate it!


WebFocus Reporting 7.1.1 Windows
 
Posts: 34 | Registered: November 22, 2005Report This Post
Guru
posted Hide Post
Hi Sara-
Here is the syntax:
-SET &VAR_NAME = HHMMSS('A08');

-TYPE THE TIME WAS &VAR_NAME

To really get the best use of WF, I recommend the IB training and the manuals. Take a look at the Technical Documentation Library button at the top of this page. You will find it very helpful.
 
Posts: 252 | Location: USA | Registered: April 15, 2003Report This Post
Platinum Member
posted Hide Post
Process time. Technique 1/2:

Difference between two hours (real time):

-* The process... Report, Maintain, Loop...
-* (Test case... Do nothing 250,000 times)
-REPEAT LABEL1 250000 TIMES
-LABEL1

-* Function to calculate seconds between two hours.
DEFINE FUNCTION TIME(HOUR1/A8, HOUR2/A8)
  HRS1/I2 = EDIT(EDIT(HOUR1, '99'));
  MIN1/I2 = EDIT(EDIT(HOUR1, '$$$99'));
  SEC1/I4 = EDIT(EDIT(HOUR1, '$$$$$$99'));
  HRS2/I2 = EDIT(EDIT(HOUR2, '99'));
  MIN2/I2 = EDIT(EDIT(HOUR2, '$$$99'));
  SEC2/I4 = EDIT(EDIT(HOUR2, '$$$$$$99'));
  TIM1/I9 = HRS1 * 60 * 60 + MIN1 * 60 + SEC1 ;
  TIM2/I9 = HRS2 * 60 * 60 + MIN2 * 60 + SEC2 ;
  TIME/I9 = TIM2 - TIM1 ;
END
-RUN

-* Calculate seconds between final and initial time.
-* &TOD         - System variable with initial time.
-* HHMMSS('A8') - Current time
-SET &TIME1 = &TOD ;
-SET &TIME2 = HHMMSS('A8') ;
-SET &TIME  = TIME(&TIME1, &TIME2) ;

-* Output.
-TYPE From...: &TIME1 
-TYPE To.....: &TIME2 
-TYPE Seconds: &TIME seconds (real time)


Regards,
Mikel


WebFOCUS 8.1.05, 8.2.01
 
Posts: 173 | Location: Madrid, Spain | Registered: May 09, 2003Report This Post
Platinum Member
posted Hide Post
Process time. Technique 2/2 (¿MVS ONLY?):

Difference between final CPU time and initial CPU time:
(Using &FOCCPU - Calculates the OS CPU time)

-* Initial CPU time.
-SET &CPUTIM1 = &FOCCPU ;

-* The process... Report, Maintain, Loop...
-* (Test case... Do nothing 250,000 times)
-REPEAT LABEL1 250000 TIMES
-LABEL1

-* Final CPU time.
-SET &CPUTIM2 = &FOCCPU ;

-* Difference and output.
-SET &CPUTIME = &CPUTIM2 - &CPUTIM1 ;
-TYPE Initial CPU time: &CPUTIM1
-TYPE Final   CPU time: &CPUTIM2
-TYPE .................
-TYPE         CPU time: &CPUTIME miliseconds (CPU time)


Regards,
Mikel


WebFOCUS 8.1.05, 8.2.01
 
Posts: 173 | Location: Madrid, Spain | Registered: May 09, 2003Report This Post
Silver Member
posted Hide Post
Thank you both very very much, I really appreciate it! I'm going to try these out, hopefully it will save me a bunch of development time waiting to see which technique performs more efficiently!


WebFocus Reporting 7.1.1 Windows
 
Posts: 34 | Registered: November 22, 2005Report This Post
Platinum Member
posted Hide Post
I have taken Mikel's very good idea (combined with some info from IBI support docs) and expanded it a bit to handle the scenario where the job spans more than one calendar day. I have used the TODAY function, since I believe it is dynamically retrieved from the OS when called, whereas I believe the amper date variables are static (please correct me if I am wrong).

I also needed to pass a dummy parameter to function CURRDATE. Does anyone know if FUNCTIONs can take no arguments? (syntax?)

-*--------------------------------------------------------
-* FUNCTION GETTIME
-* Get date and time into format YYYY/MM/DD HH:MM:SS
-* Parameters:
-* DATE: Date in format YYYY/MM/DD
-* TIME: time in format HH.MM.SS
-*--------------------------------------------------------

DEFINE FUNCTION GETTIME(DATE/A10, TIME/A8)
TIMEFMT/A8 = EDIT(TIME, '99$:99$:99');
GETTIME/A20 = DATE | ' ' | TIMEFMT;
END

-*--------------------------------------------------------
-* FUNCTION CURRDATE
-* Get current date from OS (in format MM/DD/YYYY)
-* Parameters:
-* X: Dummy
-*--------------------------------------------------------

DEFINE FUNCTION CURRDATE(X/A1)
DAY/A10 = TODAY(DAY);
YR/A4 = EDIT(DAY, '$$$$$$9999');
MN/A2 = EDIT(DAY, '99$$$$$$$$');
DY/A2 = EDIT(DAY, '$$$99$$$$$');
CURRDATE/A10 = YR | '/' | MN | '/' | DY;
END


-*--------------------------------------------------------
-* FUNCTION ELAPSED
-* Find time difference (in seconds) between a start date
-* and an end date
-* Parameters:
-* STARTTIME: Start datetime in format YYYY/MM/DD HH:MM:SS
-* ENDTIME : End datetime in format YYYY/MM/DD HH:MM:SS
-*--------------------------------------------------------

DEFINE FUNCTION ELAPSED(STARTTIME/A20, ENDTIME/A20)

DATE_TIME1/HYYMDSA=HINPUT(20,STARTTIME,10,'HYYMDS');
DATE_TIME2/HYYMDSA=HINPUT(20,ENDTIME,10,'HYYMDS');
-* THESE ARE THE LINES YOU NEED
-* ESTABLISH THE CONSTANTS FOR HOURS/MIN/SEC PER DAY
SEC_PER_HR/I5=60 * 60;
SEC_PER_DAY/I5=SEC_PER_HR * 24;
-*SUBTRACT THE TWO TIME STAMPS, GETTING DIFFERENCE IN SECONDS
DIFF_SEC/D12.2=HDIFF(DATE_TIME2, DATE_TIME1, 'SECOND', 'D12.2');
-*GET THE DIFF IN WHOLE DAYS
DAYS/I3=IF DIFF_SEC LT SEC_PER_DAY THEN 0 ELSE DIFF_SEC/SEC_PER_DAY ;
-*GET THE DIFF IN WHOLE HOURS
HOURS/I2= IF DAYS NE 0 THEN (DIFF_SEC - (DAYS * SEC_PER_DAY))/SEC_PER_HR ELSE
DIFF_SEC /SEC_PER_HR;
-*GET THE DIFF IN WHOLE MIN
MINT/I2=IF DAYS NE 0 THEN (DIFF_SEC - (DAYS * SEC_PER_DAY + HOURS *
SEC_PER_HR))/60
ELSE (DIFF_SEC - (HOURS * SEC_PER_HR))/60;
-*GET THE DIFF IN WHOLE SEC
SEC/I2=IF DAYS NE 0 THEN DIFF_SEC - ((DAYS * SEC_PER_DAY) + (HOURS *
SEC_PER_HR) + (MINT * 60))
ELSE DIFF_SEC - ((HOURS * SEC_PER_HR) + (MINT * 60)) ;
-*PUT IT TOGETHER
ELAPSED/I10 = (DAYS*24*60*60) + (HOURS*60*60) + (MINT*60) + SEC;
END

-RUN

-* Get starting time of job
-SET &START = GETTIME(CURRDATE('X'), HHMMSS('A8'));
-* -SET &START = GETTIME('2004/07/06', HHMMSS('A8'));

-* Do all your work here (simulated with empty repeat loop)
-REPEAT LABEL1 250000 TIMES
-LABEL1

-* Get ending time of job
-SET &END = GETTIME(CURRDATE('X'), HHMMSS('A8'));

-* Find elapsed time
-SET &ELAPSED = ELAPSED(&START, &END);

-TYPE Elapsed Time (in seconds): &ELAPSED


------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
 
Posts: 210 | Location: Ottawa | Registered: November 03, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders