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     Help- Trying to suppress the zeros for the day and Month.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Help- Trying to suppress the zeros for the day and Month.
 Login/Join
 
Silver Member
posted
WebFocus's date formats attach a leading 0 for days (i.e. 1 thru 9) or months (1 thru 9). If I don't want these leading zeros how do I suppress them? For example, instead of 01/01/2008, I want 1/1/2008. Thanks a million Cool
 
Posts: 31 | Registered: November 17, 2005Report This Post
Guru
posted Hide Post
What a shame that you have to tear apart a smart date, this should do it, but now you loose all the functionality of the smart dates!

DATE/MDYY 01012008 ;
ADATE/A8MDYY = DATE;
MONTH/A2 = EDIT(ADATE,'99$$$$$$');
IMONTH/I2S=EDIT(MONTH);
DAY/A2=EDIT(ADATE,'$$99$$$$');
IDAY/I2S = EDIT(DAY);
YEAR/A4 = EDIT(ADATE,'$$$$9999');
IYEAR/I4=EDIT(YEAR);
YOURDATE/A10 = EDIT(IMONTH) | '/' | EDIT(IDAY) | '/' |EDIT(IYEAR);

Lastly, please update your signiture so we can better help you.

Thank you.



WebFOCUS 7.6.6/TomCat/Win2k3
 
Posts: 428 | Location: Springfield, MA | Registered: May 07, 2003Report This Post
Expert
posted Hide Post
Unfortunately, this doesn't do it.

DEFINE FILE CAR
DATE/MDYY = 01012008 ;
ADATE/A8MDYY = DATE;
MONTH/A2 = EDIT(ADATE,'99$$$$$$');
IMONTH/I2S=EDIT(MONTH);
DAY/A2=EDIT(ADATE,'$$99$$$$');
IDAY/I2S = EDIT(DAY);
YEAR/A4 = EDIT(ADATE,'$$$$9999');
IYEAR/I4=EDIT(YEAR);
YOURDATE/A10 = EDIT(IMONTH) | '/' | EDIT(IDAY) | '/' |EDIT(IYEAR);
END

TABLE FILE CAR
PRINT
COUNTRY
DATE
YOURDATE
END


You still get the leading zeros because the S (zero suppress) in I2S is ignored when using EDIT - EDIT(IMONTH).

This message has been edited. Last edited by: Francis Mariani,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Extremely ugly, but this will do it:

DEFINE FILE CAR
DATE/MDYY = 01012008 ;
ADATE/A8MDYY = DATE;
AMONTH/A2    = EDIT(ADATE,'99$$$$$$');
IMONTH/F2    = EDIT(AMONTH);
FMONTH/A2    = FTOA(IMONTH, '(D2S)', FMONTH);
ADAY/A2      = EDIT(ADATE,'$$99$$$$');
IDAY/F2      = EDIT(ADAY);
FDAY/A2      = FTOA(IDAY, '(D2S)', FDAY);
AYEAR/A4     = EDIT(ADATE,'$$$$9999');
YOURDATE/A10 = STRIP(2, FMONTH, ' ', 'A2')|| '/' || STRIP(2, FDAY, ' ', 'A2')|| '/' || AYEAR;
YOURDATEX/A10 = FMONTH || '/' || FDAY || '/' || AYEAR;
END

TABLE FILE CAR
PRINT
COUNTRY
DATE
YOURDATE
YOURDATEX
END


FTOA converts the numeric field to alpha, respecting the zero suppress. YOURDATEX is here to illustrate my puzzlement as to why the hard concatenation doesn't work with FMONTH and FDAY without the STRIP function.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Guru
posted Hide Post
You're right Francis, thanks for the correction in the ugly code! Eeker Brings back the old days coding memories.

I'd vote to keep the leading zeros and smart date format myself.



WebFOCUS 7.6.6/TomCat/Win2k3
 
Posts: 428 | Location: Springfield, MA | Registered: May 07, 2003Report This Post
Silver Member
posted Hide Post
DEFINE FILE GEORGE
FRED/MDYY = 01012008;
FOO/A10 = DATETRAN(FRED, '(MDYY)', '(dm/)', 'EN', 10, 'A10');

...
 
Posts: 38 | Registered: October 10, 2006Report This Post
Expert
posted Hide Post
Jud,

Thank you - you've trumped us!
DATETRAN Function: Formatting Dates in International Formats was added in v7.

One day my client will upgrade...


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Guru
posted Hide Post
Jud, that's much better! Good One



WebFOCUS 7.6.6/TomCat/Win2k3
 
Posts: 428 | Location: Springfield, MA | Registered: May 07, 2003Report This Post
Virtuoso
posted Hide Post
I had a feeling it was out there...just couldn't find it...Thanks. What version you have Denny?


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 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     Help- Trying to suppress the zeros for the day and Month.

Copyright © 1996-2020 Information Builders