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  iWay Software Product Forum on Focal Point    [SOLVED] Date conversion help

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Date conversion help
 Login/Join
 
Member
posted
Hi ,
I need to convert an alphanumeric
'Sat 02/03/13' to a YYMD Date format.

I have tried
DEFINE NEW_FINISH/DMY=DATECVT(EDIT(GETTOK(FINISH,50,-1,' ',50,'A50'),'99$99$99'),'A6DMY','DMY');

with above I could able to convert it to DMY date format however from DMY to YYMD its transalting as 1913/03/02 , I need 2013/03/02.
how can I achieve this ? seems Y2K issue.
Regards
VS

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS8,IWAY DM
Windows, All Outputs
 
Posts: 9 | Registered: July 29, 2014Report This Post
Virtuoso
posted Hide Post
There are 2 parameters for setting the century, often referred to as the sliding window technique. These are DEFCENT and YRTHRESH. Any value below YRTHRESH has century set to DEFCENT+1.

I would use:
DEFINE ALPHA_FINISH/A6DMY= EDIT(GETTOK(INPUT,50,-1,' ',8,'A8'),'99$99$99');
DEFINE YYMD_FINISH/YYMD DEFCENT 19 YRTHRESH 52  = ALPHA_FINISH;

to get the correct century.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Master
posted Hide Post
Alan's version is probably cleaner. But there are several ways - here's another one. (You could just use the edit once to strip of the 'Sat ' and then CHGDAT to change the display order, for example.) I haven't used GETTOK in a long time and it's nice to be reminded that it exists.

(If you have dates going back to the previous century you'll have to make adjustments of course. The DEFCENT and YRTHRESH are one way of checking if a date belongs in that last century or this one - but of course you can do the same with IF ... ELSE statements).

quote:
'Sat 02/03/13'

DEFINE FILE CAR
OLDDATE/A12='Sat 02/03/13';
NEWDATE1/A8='20' | EDIT(OLDDATE, '$$$$$$$$$$99') | EDIT(OLDDATE, '$$$$$$$99$$$') | EDIT(OLDDATE, '$$$$99$$$$$$$$');
NEWDATE2/YYMD=DATECVT(NEWDATE1, 'A8YYMD', 'YYMD');
END

TABLE FILE CAR
PRINT NEWDATE1 
NEWDATE2 
BY CAR NOPRINT
BY OLDDATE
WHERE RECORDLIMIT EQ 1
END

This message has been edited. Last edited by: George Patton,


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Report This Post
Member
posted Hide Post
thanks , both methods are working ..

Regards
VS


WebFOCUS8,IWAY DM
Windows, All Outputs
 
Posts: 9 | Registered: July 29, 2014Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [SOLVED] Date conversion help

Copyright © 1996-2020 Information Builders