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.
I need to create a computation that will divide X by the total days in current year through the end of the current month. So if the report ran in Feb of this year it would have used a value of 59 for this computation. I wanted to approach this by creating a hold file in my procedure that returned the value for days of year through current month. So for example my hold file names would have one field named with a value of 59 if run in February. I then was going to set a variable such that
-SET &&TESTDATE = 'DATEHOLD.DAYOFYEAR';
My expectation is that this would set &&TESTDATE = 59 and then in my final report I could just say WHERE DAYOFYEAR=&&TESTDATE to provide me the correct value for my computation. I am getting errors with my SET statement and figure I am doing something incorrect with the syntax. Does this approach make sense and/or is there a better way I should approach this?
Thanks, BobThis message has been edited. Last edited by: bcook278,
WebFOCUS 7.6.8 WebFOCUS Client and Server running on RedHat Linux, Developer Studio on Windows XP All output formats
close. FIrst, you probably want to be using single &variables, not double. When you figure out the days, i'm assuming you are doing some work and creating a hold file called DATEHOLD which contains a field called DAYOFYEAR? is that right? .. TABLE FILE whatever SUM COMPUTE DAYOFYEAR/I3= whatever is your calc; ON TABLE SAVE AS DATEHOLD END -RUN -READ DATEHOLD &DAYOFYEAR.A3 TABLE FILE whateverelse IF DAYOFYEAR EQ &DAYOFYEAR SUM whatever END .. Having shown you how to read back a value from a SAVE file (or HOLD FORMAT ALPHA) into an &var, there is a way to directly figure out the number of days since the beginning of the year using a function on the todays date &YYMD. I'll get back to you in a minute.. or another one of us will zip in and address that...
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
Why bother with a hold file? Just use a -SET to calculate another &variable containing that value and then use that &var in your procedure. Steps:
1. Get current date 2. Use edit to create 01/01/current year (DATEMOV also works, but requires more steps) 3. Use DATECVT and DATEDIF functions to calculate number of days elapsed. (you must use DATECVT in dialogue manager for date functions) MAKE SURE YOU ADD ONE (+1) to this to get the current day of the year.
If you create a hold file, you'll just have to -READ the value back into a parameter, so forget about creating a file and stick with the parameter.
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007
Thanks for the great feedback. I tested a few of these options and they appear to give me what I am looking for. Now off to study more about Dialog Manager. This was something we didn't review during our initial introduction to WebFOCUS but seems incredibly powerful if you understand the appropriate syntax.
WebFOCUS 7.6.8 WebFOCUS Client and Server running on RedHat Linux, Developer Studio on Windows XP All output formats