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] Convert Dates

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Convert Dates
 Login/Join
 
Member
posted
This is always a big topic in WebFOCUS and I ordered the 1000 ways for Dates but have an issue in front of me now while waiting on book.

MFD
DATE1 FORMAT=MDYY, ACTUAL=DATE
(i.e. 11/25/2008)

Within a focexec, in the Define File, I need to convert this to an alpha as:

YYMD (i.e. 20081125 - an alpha value)

DATE2/A8 = ??

How do I do this?

DATE1

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


WebFOCUS 7.6.2 client
WebFOCUS 7.6.0 server
Windows 2000 and 2003 Server.
Windows XP Professional for Dev Studio
Output: HTML, Excel, and PDF
 
Posts: 5 | Registered: September 27, 2007Report This Post
Platinum Member
posted Hide Post
hi whitaker,

This is a 2 step process.

First you have to convert the date format to a date-time foramt using HDTTM function.

Then you can convert the Date-time format to alpha format using HCNVRT function

Thank you


WebFOCUS 714
Windows XP
Output: HTML,PDF,Excel
 
Posts: 189 | Registered: January 30, 2008Report This Post
Platinum Member
posted Hide Post
hi whitaker,

Please search the forum for a lot more examples in date functions..This is a huge repository.

Thank you ...


WebFOCUS 714
Windows XP
Output: HTML,PDF,Excel
 
Posts: 189 | Registered: January 30, 2008Report This Post
Expert
posted Hide Post
D.R.

You'll wonder how you ever managed without the book once you get it and it will (should!) never be more than an arm's length away.

To get you further forward, understand that there are alpha versions of internal dates formats such as A8MDYY that you can use as alpha. You can use functions to do this for you but understanding the basic date formats and how they can be used is - imho - the best point at which to start. When the function syntax then asks for a "smart date" or alpha date and quotes formats such as A8YYMD etc. you'll be better placed to proceed -

TABLE FILE CAR
PRINT COMPUTE DATE1/MDYY   = '11/25/2008';
      COMPUTE DATE2/A8MDYY = DATE1;
      COMPUTE DATE3/A8     = DATE2;
   BY COUNTRY NOPRINT
IF RECORDLIMIT EQ 10
END

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Platinum Member
posted Hide Post
I think IBI should deliver free of cost "1000 ways for Dates" manual...lol...


WF Server: 7.1.4 on Z/OS and Linux, ReportCaster
Data: DB2, DB2/UDB, Adabas, SQL Server, Oracle Output: HTML,PDF,Excel2K
WF Client: Servlet, CGI
 
Posts: 133 | Registered: May 12, 2007Report This Post
Platinum Member
posted Hide Post
Wink Smiler


WebFOCUS 714
Windows XP
Output: HTML,PDF,Excel
 
Posts: 189 | Registered: January 30, 2008Report This Post
Expert
posted Hide Post
I suppose that you also think that training should be free? or that a Dummies guide to Windows Vista should be supplied FOC by MicroShaft?

The thing to remember is that the Almost 1000 ways etc. etc. is not an IB originated book (just like the Dummies guides etc.) so I guess that it is not theirs to give away for free?

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Platinum Member
posted Hide Post
hi sir ,

That was a bouncer for me Smiler


WebFOCUS 714
Windows XP
Output: HTML,PDF,Excel
 
Posts: 189 | Registered: January 30, 2008Report This Post
Virtuoso
posted Hide Post
D.R.,

Yes, Tony is showing you the right way.
  
TABLE FILE CAR
PRINT COMPUTE DATE1/MDYY   = '11/25/2008';
      COMPUTE DATE2/A8MDYY = DATE1;
      COMPUTE DATE3/A8     = DATE2;
   BY COUNTRY NOPRINT
END

Note that if your field doesn't have to be displayed but just written to a file, you probably could forego the the last assignment.

Note also that if you want the year-month-day order, Focus will also do it for you:
  
TABLE FILE CAR
PRINT COMPUTE DATE1/MDYY   = '11/25/2008';
      COMPUTE DATE2/A8YYMD = DATE1;
      COMPUTE DATE3/A8     = DATE2;
   BY COUNTRY NOPRINT
END


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
arvind, Thanks... What you provided worked !!!


WebFOCUS 7.6.2 client
WebFOCUS 7.6.0 server
Windows 2000 and 2003 Server.
Windows XP Professional for Dev Studio
Output: HTML, Excel, and PDF
 
Posts: 5 | Registered: September 27, 2007Report This Post
Platinum Member
posted Hide Post
quote:
TABLE FILE CAR
PRINT COMPUTE DATE1/MDYY = '11/25/2008';
COMPUTE DATE2/A8YYMD = DATE1;
COMPUTE DATE3/A8 = DATE2;
BY COUNTRY NOPRINT
END


This looks like it will work, but my input is in the format 'September 1, 2010' and I want that as an alpha. This code doesn't do it. Can you tell my why?


7.7.02
Windows
EXCEL, PDF, CSV, TEXT
 
Posts: 106 | Registered: June 25, 2009Report This Post
<FreSte>
posted
Ted,

I think you have to use the DATETRAN function:

TABLE FILE CAR
PRINT COMPUTE DATE1/MDYY = 'September 1, 2010';
COMPUTE DATE2/A8YYMD = DATE1;
COMPUTE DATE3/A8 = DATE2;

COMPUTE DATE4/A25=DATETRAN(DATE1, '(MDYY)', '(trDd)', 'EN', 25, 'A25') ;

BY COUNTRY NOPRINT
END 


-Fred-
 
Report 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] Convert Dates

Copyright © 1996-2020 Information Builders