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     Converting Dates Between FOCUS and WebFOCUS

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Converting Dates Between FOCUS and WebFOCUS
 Login/Join
 
Member
posted
Hi:

I am in the middle of a conversion from Mainframe FOCUS to WebFOCUS and am in the process of creating synonyms for all the master file descriptions. I have numerous dates in the FOCUS MFD's that have a USAGE=MDYY and a FORMAT of A8YYMD. When I convert the MFD to WebFOCUS the dates come across with a USAGE=MDYY and a FORMAT=DATE.

These date fields work fine when I am only trying to print the date fields. However, when I try to put these dates in to a WHERE test (e.g. WHERE DATE GE '01/01/2006') I get format/conversion errors on the field.

Any thoughts on how to fix this problem?

Stephen A
 
Posts: 18 | Registered: June 17, 2004Report This Post
Platinum Member
posted Hide Post
Stephen,

Try removing the formatting from the date in your where statement.

ie: WHERE DATE GE '01012006'
This is how I have been performing Where tests on smart dates.


WF 7.6.10 / WIN-AIX
 
Posts: 141 | Location: Denver, CO | Registered: December 09, 2005Report This Post
Guru
posted Hide Post
I don't know if this will help but you may want to take a look at the DT function.

Here are some link to stuff in Tech Support:
http://techsupport.informationbuilders.com/sps/10552134.html
http://documentation.informationbuilders.com/masterinde..._func72/05func23.htm
 
Posts: 406 | Location: Canada | Registered: May 31, 2004Report This Post
Member
posted Hide Post
FORMAT=DATE indicates a "SMART DATE"
FORMAT=A8MDYY indicates a "LEGACY DATE"

If you remove the MDYY from the A8MDYY you can bring the dates into WebFocus as "Legacy dates" and all you existing programs will work just as before.

Alternately you can add a define to the WebFocus MFD
LD_DATE/AMDYY = SMART_DATE ;$

You can then test the smart date field using smart-date conventions or test the legacy date using lefacy-date conventions.

Smart-date conventions:
WHERE SD_MDY2 GT '060151'
WHERE SD_MDY2 GT 'JUN 01 51'
WHERE SD_MDY2 GT '06 01 51'
WHERE SD_MDY2 GT '06/01/51'
WHERE SD_MDY2 GT '06/01/1951'

Legacy-date conventions:
WHERE AD_YMD3 GT '510601'
WHERE AD_YMD2 GT '19510601'

You conversion errors sounds more like you have some invalid dates in the converted date fields. The following example is a way to convert from legacy to smart dates elinminating any invalid date in the process.

YYMD_I/I8 = EDIT(AD_YMD2);
DATEOK_A/I6 = DAYMD(YYMD_I,'I6');
A_2_YYMD/YYMD = IF AD_YMD2 EQ ' ' THEN '19001231'
ELSE IF DATEOK_A EQ 0 THEN 0
ELSE AD_YMD2 ;
AD_YMD2 is a legacy date field in format A8YYMD
A_2_YYMD is the converted smart date value.
DAYMD function returns a 0 for any invalid date.

Above examples derived from:
"(Almost) 1001 Ways to Work with Dates in WebFOCUS"
which is available from www.aviter.com

Hope this helps,
John Price
 
Posts: 25 | Location: Fountain Valley, Calif. | Registered: October 24, 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     Converting Dates Between FOCUS and WebFOCUS

Copyright © 1996-2020 Information Builders