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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] cutting integers

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] cutting integers
 Login/Join
 
Member
posted
Hi,

I have two tables that I need to join. Part of that join includes a Year field, which is a 4 digit integer in my base table. However, in my join table it is only a 2 digit. So, i want to create a define field that cuts the first two digits out. This seems like it would be basic but I am having a rough time finding what function to use. Any suggestions?

Thanks in advance.

This message has been edited. Last edited by: Kerry,


Web Focus Version 7.6.8
Win XP 2002
 
Posts: 11 | Registered: June 25, 2009Report This Post
Expert
posted Hide Post
YEAR2D/I2 = YEAR - (INT(YEAR / 100) * 100) ;


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
  
YEAR2D/I2=IMOD(YEAR, 100, 'I2');


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, 2006Report This Post
Member
posted Hide Post
Thanks guys, I was so focused on strings that I forgot math.


Web Focus Version 7.6.8
Win XP 2002
 
Posts: 11 | Registered: June 25, 2009Report This Post
Platinum Member
posted Hide Post
How about

YEAR2D/I2= YEAR-2000;

John


WF 7.7.03, Windows 7, HTML, Excel, PDF
 
Posts: 225 | Location: San Francisco Bay Area, California | Registered: October 26, 2006Report This Post
Virtuoso
posted Hide Post
quote:
YEAR2D/I2= YEAR-2000

works unless the date is 1999. You would need to add additional logic to test pre-and post-2000. The logic provide by Daniel and Waz works regardless of the century.

Which brings up the next question - Why in the world would you still have a table containing only a two-digit 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, 2007Report This Post
Master
posted Hide Post
If YEAR is a year field with the format of YY, I do it this way;
YEAR/YY=2009;
YEARD/Y=YEAR;


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, 2006Report This Post
Expert
posted Hide Post
and make sure the field you're joining to has no leading zeros.
if the field is '09' then your integer 9 won't join to it.
if your source file is Oracle, then the EDIT function will trip you up, it doesn't xlate to sql.
and the smart-date is only a virtual mask, so that might not work.
oh my, i sound so cheerful!




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] cutting integers

Copyright © 1996-2020 Information Builders