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] Date Conversion

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Date Conversion
 Login/Join
 
Gold member
posted
I need to convert a alpha to a smart date.

The alpha format is: 070523, YMD.

I need it to be a smart date in this format YYMD.

I've tried the following with no success.

NLETY/A2 = EDIT ('&LETTING', '$$99');
NLETM/A2 = EDIT ('&LETTING', '$$$$99');
NLETD/A2 = EDIT ('&LETTING', '$$$$$$99');
NLETDATE/A16 = '20'||NLETY||'-'||NLETM||'-'||NLETD||' 00:00';
LETTING/YYMD = HDATE(NLETDATE, 'YYMD');


&LETTING = CT070523
Thanks

This message has been edited. Last edited by: Kerry,
 
Posts: 84 | Location: Tallahassee, Fl. | Registered: December 02, 2005Report This Post
Guru
posted Hide Post
Try-

 
LETTING=DATECVT('&LETTING','A6MDY','YYMD');
 


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
 
Posts: 391 | Location: California | Registered: April 14, 2003Report This Post
Gold member
posted Hide Post
Nope, returned .00
 
Posts: 84 | Location: Tallahassee, Fl. | Registered: December 02, 2005Report This Post
Gold member
posted Hide Post
I tried this with success...

-SET &DAYIN = '070523';
-SET &DAYIN = '20' || &DAYIN;

DEFINE FILE CAR
DATEIN/YYMD = &DAYIN;
END

TABLE FILE CAR
PRINT DATEIN
BY MODEL
IF RECORDLIMIT EQ 5
END


or with the year threshold to get it in the year 2000

SET DEFCENT=19
SET YRTHRESH=56 
-SET &DAYIN = '070523';
DEFINE FILE CAR
DATEIN/YYMD = &DAYIN;
END

TABLE FILE CAR
PRINT DATEIN
BY MODEL
IF RECORDLIMIT EQ 5
END

*thanks Alan B for that one.. I knew it was simple... just never needed it.

This message has been edited. Last edited by: Leo L,


Prod: WebFOCUS 7.6.4 - Self Service - Windows Server2003 - Apache Tomcat 5.5
Dev: WebFOCUS 7.6.4 - Self Service - Windows XP SP2 - Apache Tomcat 5.5
 
Posts: 96 | Location: Winnipeg, Manitoba, Canada | Registered: January 22, 2004Report This Post
Virtuoso
posted Hide Post
Nick forgot to put a format on, that's all.

LETTING/YYMD=DATECVT('&LETTING','A6YMD','YYMD');

You may want to SET DEFCENT=19 and SET YRTHRESH=56 as well.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Virtuoso
posted Hide Post
quote:
The alpha format is: 070523, YMD.


Using defines, this works too;
-SET &LETTING= 070515;
SET DEFCENT=19
SET YRTHRESH=56

DEFINE FILE EMPLOYEE
IDATE1/I6YMD = EDIT('&LETTING');
MYDATE/YYMD=IDATE1;
END
TABLE FILE EMPLOYEE
SUM CURR_SAL FST.IDATE1 FST.MYDATE
END


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Gold member
posted Hide Post
Not sure what I'm doing wrong but none of the suggestions are working.

SET DEFCENT=19
SET YRTHRESH=56
DEFINE FILE EMPLOYEE
NDATE/A6 = EDIT ('$LETTING', '$$999999');
NLETDATE/I6 = EDIT(NDATE);
LETTING/YYMD = NLETDATE;
-*LETTING/YYMD=DATECVT('&LETTING','A6MDY','YYMD');
END

Don't forget that &LETTING = 'CT070523' NOT '070523'
 
Posts: 84 | Location: Tallahassee, Fl. | Registered: December 02, 2005Report This Post
Gold member
posted Hide Post
quote:
SET DEFCENT=19
SET YRTHRESH=56
-SET &DAYIN = '070523';
DEFINE FILE CAR
DATEIN/YYMD = &DAYIN;


Sorry, I overlooked one sugguestion. the following one worked Thanks alot for the quick response.

SET DEFCENT=19
SET YRTHRESH=56
-SET &DAYIN = '070523';
DEFINE FILE CAR
DATEIN/YYMD = &DAYIN;
 
Posts: 84 | Location: Tallahassee, Fl. | Registered: December 02, 2005Report This Post
Gold member
posted Hide Post
Hi All,

My date format is 2009/10/23
how to convert the same to 200910


In Focus since 2008
WebFOCUS 8.2.0.1
Windows 7 - IE,Chrome,Firefox
Excel, PDF, HTML, AHTML, XML
JavaScript, jQuery, D3.js, Highcharts
 
Posts: 79 | Location: New York | Registered: February 04, 2010Report This Post
Virtuoso
posted Hide Post
If your date is in an ampersand variable, you can use the EDIT function:

-SET &NEWDATE = EDIT(&OLDDATE,'9999$99$$$');


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Virtuoso
posted Hide Post
If it isn't an ampersand variable but an actual date field instead, then you will need to convert it from DATE to ALPHA and then extract the pieces you need.

Please review the documentation for DATECVT and other DATE functions which you will surely need in the future.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report 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] Date Conversion

Copyright © 1996-2020 Information Builders