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 am trying to calculate age for dateof birthcloumn. I have following code DEFINE FILE STAGE_CHILD_POS CURRENTDT/Y=&DATEYYMD; Birthday/YYMD=HDATE(STAGE_CHILD_POS.STAGE_CHILD_POS.BIRTHDATE, 'YYMD'); AGE/D12.2=DATEDIF(Birthday, CURRENTDT, 'Y'); END
I am getting error message: (FOC36355) INVALID TYPE OF ARGUMENT #2 FOR USER FUNCTION DATEDIF What am I doing wrong?
ArifThis message has been edited. Last edited by: Kerry,
If you're wanting to calculate age from a date of birth, you should be subtracting today's date and the date of birth. Just using today's year may or may not give you the correct age. It would depend on whether or not the birthday has already occurred in this year.
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
DEFINE FILE STAGE_CHILD_POS CURRENTDT/YYMD=&YYMD; Birthday/YYMD=HDATE(STAGE_CHILD_POS.STAGE_CHILD_POS.BIRTHDATE, 'YYMD'); AGE/D12.2=DATEDIF(Birthday, CURRENTDT, 'Y'); END
I think it was very helpful. I used DEFINE FILE STAGE_CHILD_POS CURRENTDT/YYMD=&YYMD; Birthday/YYMD=HDATE(STAGE_CHILD_POS.STAGE_CHILD_POS.BIRTHDATE, 'YYMD'); AGE/D12.2=DATEDIF(Birthday, CURRENTDT, 'Y'); END
DEFINE FILE SOMETABLE AGE/I3=BIRTHDATE/365.25; END
Jimmy, you can do that if you want the wrong answer. What that calculation will give you is an estimate of the number of years since 1/1/1901. Smart dates (those with a format of YYMD or MDYY or DMYY, etc.) are stored internally as the number of days since 12/31/1900. -1 is 12/30/1900, 0 is 12/31/1900, 1 is 1/1/1901, 2 is 1/2/1901, etc. If Birthday is 7/13/2005, as an integer it is 38180, divide that by 365.25 you get 104.53... years.
In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006