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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
Date formats
 Login/Join
 
<mohith>
posted
I need to print the date in 01-AUG-05 format. I am doing the following:
testdate/D=HDATE(REC_EFF_D,'YYMD');
testdate1/TM=HDATE(REC_EFF_D,'YYMD');
testdate2/Y=HDATE(REC_EFF_D,'YYMD');
daypart/A2=EDIT(testdate);
monthpart/A12=EDIT(testdate1);
yearpart/A2=EDIT(testdate2);
totyear/A100 = daypart || '-' || monthpart ||'-'|| yearpart;

But with this i get 01-08-05. How do I get Aug???
 
Report This Post
Expert
posted Hide Post
The value of MYDATE2 will give you what you want, however, you MUST use LEADZERO=ON to ensure that the Day portion is a full two character.

-* Full month name in a date
SET LEADZERO=ON
DEFINE FILE GGSALES
-* DATE is I8YYMD format so change it to alpha as that
-* is what CHGDAT expects - A8YYMD is no good.
MYDATE/A8 = EDIT(DATE);
MYDATE1/A17 = CHGDAT('YYMD', 'DTMY', MYDATE, 'A17');
MYDATE2/A9 = EDIT(MYDATE1,'99-$999-$99');
END

TABLE FILE GGSALES
SUM MAX.MYDATE AS 'MYDATE'
MAX.MYDATE1 AS 'MYDATE1'
MAX.MYDATE2 AS 'MYDATE2'
BY DATE
WHERE RECORDLIMIT EQ 10
END
-EXIT
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
Hi mohith,

Have you got a chance to try Tony's suggestion? Has this issue regarding date formats been resolved?

I tried Tony's code on my side and it will show the format you are looking for. Good tricks Tony!!

Here is my modified code along with other examples found, so it may be a bit easier for other newbies to read:


DEFINE FILE EMPDATA
ALPHA_HIRE/I6YMD = HIREDATE; -* CONVERT YMD FORMAT TO I6YMD
ALPHA_HIRE1/A17 = EDIT(ALPHA_HIRE); -* CONVERT I6YMD TO ALPHANUMERIC
HIRE_DMY/A17 = CHGDAT('YMD', 'DTMY', ALPHA_HIRE1, 'A17');
HIRE_DMY1/A20 = EDIT (HIRE_DMY, '99-$999-$99'); -* "MASK" THE DATE END

TABLE FILE EMPDATA
-*COMPARISON OF DIFFERENT DATE FORMATS
PRINT
HIREDATE
ALPHA_HIRE
ALPHA_HIRE1
HIRE_DMY
HIRE_DMY1
BY LASTNAME
END


Hope this helps. Big Grin

Cheers,

Kerry
 
Posts: 1948 | Location: New York | Registered: November 16, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders