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.
Or you could use legacy date function DAMDY. However, this approach assumes the input dates are always in the format 'mm/dd/yyyy', including leading zeroes.
I used the above line in my define and it doesn't seem to work, I can't seem to get this define working, is there an alturnative way, like calculating it with a compute?
If you want a DEFINE/COMPUTE, try something like this:
-SET &SDATE = '4/30/2011';
-SET &EDATE = '5/6/2011';
-*
DEFINE FILE CAR
SDATE/MDYY WITH COUNTRY = '&SDATE';
EDATE/MDYY WITH COUNTRY = '&EDATE';
WEEK_DIFF/F3 = (DATEDIF(SDATE,EDATE,'D')) / 7 ;
END
-*
TABLE FILE CAR
PRINT SDATE EDATE WEEK_DIFF
WHERE RECORDLIMIT EQ 1 ;
END
This message has been edited. Last edited by: Dan Satchell,
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
Remove it and find out. In multi-segment files (like the CAR file) DEFINEs must reference a real field, a previously defined field, or must have an explicit field reference (e.g., 'WITH COUNTRY'). Otherwise FOCUS does not know to which segment it should attach the DEFINEd field.This message has been edited. Last edited by: Dan Satchell,
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
Im still recieveing a 0 as the output, i even took the " / 7 " (divid by seven) out just to see if i get the difference in days and still a 0. I put the varible SDATE and EDATE in the header just to see what is getting put in them and the dates look exactly how they are suppose to, I don't know what I am doing wrong...
UPDATE: it seems to be working, but the output is 5,727
for SDATE 04/30/2011 EDATE 05/06/2011This message has been edited. Last edited by: Charles Richards,
I believe 5,727 is the number of weeks between 1/1/1901 and 5/6/2011. So it appears your code is using 1/1/1901 for SDATE instead of 4/30/2011. This would indicate an error somewhere in the code that handles the incoming value for &SDATE. The value for SDATE is therefore defaulting to the FOCUS base date of 1/1/1901. Put the following statement at the top of your program so you can see what is happening in your code.
-SET &ECHO = ALL ;
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
Hello charles you might want to check the date output from the date control, it gives you the option to automatically pass the date as yyyymmdd otherwise you have to convert the date from mm/dd/yyyy to yyyymmdd then use the datedif function.
I sometimes forget about my WF environment settings. For the code below to work, DMPRECISION must be set to zero so Dialogue Manager will round up instead of truncating decimals. With DMPRECISION=0, both of these examples should work.