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]Change the date format from DD-MON-YY format to MM/DD/YY format

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Change the date format from DD-MON-YY format to MM/DD/YY format
 Login/Join
 
Guru
posted
Hi,

I have a field/column having the value as 18-AUG-16 and today it shows as this date and few days later,it might show a different date value(I mean this field's value is dynamic)which is in A12 format and I need to display it in MM/DD/YY(8/18/16) format but Iam unable to achieve it.

I tried CHGDAT,HINPUT etc but nothing seems to be working.

Could anyone please help me on this.

Any help is appreciated.Thanks a lot in advance!

Thanks,
IP

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


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
 
Posts: 270 | Registered: October 30, 2014Report This Post
Platinum Member
posted Hide Post
Do you have a snippet of code for us?

Try change it to a smart date with a two or maybe three step define:

1) NEWFIELDA/A8YYMD = DATE;
2) NEWFIELDB/YYMD = NEWFIELDA;
3) NEWFIELDC/[ desired format ] = NEWFIELDB;

or maybe it would even work as:

1) NEWFIELDA/A8YYMD = DATE;
2) NEWFIELDB/[ desired format ] = NEWFIELDA;


WebFOCUS 8105m
Windows 7, All Outputs

Member of the Benelux Usergroup
 
Posts: 198 | Location: Amsterdam | Registered: August 24, 2011Report This Post
Virtuoso
posted Hide Post
I'm afraid there isn't a function that does this automatically. So, you can write your own:
  
DEFINE FUNCTION INFO4PAL (INFO/A12) 
AMON/A3=EDIT(INFO,'$$$999');
MON/A2=DECODE AMON(JAN 01 FEB 02 MAR 03 APR 04 MAY 05 JUN 06 JUL 07 AUG 08 SEP 09 OCT 10 NOV 11 DEC 12);
ADATE/A6MDY=MON | EDIT(INFO,'99') | EDIT(INFO,'$$$$$$$99');
INFO4PAL/MDY=ADATE;
END



DEFINE FILE CAR
INFO/A12='19-AUG-16';
DATE/MDYY=INFO4PAL(INFO);
END
TABLE FILE CAR
PRINT INFO DATE 
BY COUNTRY
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
Platinum Member
posted Hide Post
Danny, then I would definitely prefer to use:

-SET &MDYY  = DATETRAN(DATECVT(&YYMD,'I8YYMD','MDYY'), '(MDYY)', '(t-)', 'EN', 16, 'A16');

-TYPE &MDYY


This DATETRAN function can just as easily be used in a DEFINE as well...


WebFOCUS 8105m
Windows 7, All Outputs

Member of the Benelux Usergroup
 
Posts: 198 | Location: Amsterdam | Registered: August 24, 2011Report This Post
Guru
posted Hide Post
Hi,

Thanks Swes and Danny for the inputs but this is not the expected result which Iam looking for Frowner

This is the piece of code which Iam using:
TABLE FILE REPORT1 PRINT DATE_FLD1 DATE_FLD2 HEADING "DATE_FLD1 WHICH IS IN MM/DD/YY" ENDSTYLE END  


The date fields DATE_FLD1 and DATE_FLD2 are in A12V format.
When I run my report,I will get the result in 02-JUL-16 but I need to print it in the Heading as 07/02/16 format.Could you or anyone please help me to achieve it.

Thanks a lot in advance!

Regards,
IP


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
 
Posts: 270 | Registered: October 30, 2014Report This Post
Platinum Member
posted Hide Post
In any case you will need to transform the ALPHA field to a smart date, from there you can have it in any format you like... and also put that field in the heading using HEADING "

WebFOCUS 8105m
Windows 7, All Outputs

Member of the Benelux Usergroup
 
Posts: 198 | Location: Amsterdam | Registered: August 24, 2011Report This Post
Virtuoso
posted Hide Post
SWES,

You will still have to DECODE the month (unless I'm mistaken).
Once you have done that, IMHO the 2 assignments should be "cheaper" than the use of 2 functions.


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
Virtuoso
posted Hide Post
quote:
TABLE FILE REPORT1 PRINT DATE_FLD1 DATE_FLD2
HEADING
"DATE_FLD1 WHICH IS IN MM/DD/YY"
END

  
DEFINE FUNCTION INFO4PAL (INFO/A12) 
AMON/A3=EDIT(INFO,'$$$999');
MON/A2=DECODE AMON(JAN 01 FEB 02 MAR 03 APR 04 MAY 05 JUN 06 JUL 07 AUG 08 SEP 09 OCT 10 NOV 11 DEC 12);
ADATE/A6MDY=MON | EDIT(INFO,'99') | EDIT(INFO,'$$$$$$$99');
INFO4PAL/MDY=ADATE;
END
DEFINE FILE REPORT1
MYDATE/MDY=INFO4PAL(DATE_FLD1);
END
TABLE FILE REPORT1 PRINT DATE_FLD1 DATE_FLD2 
HEADING 
"DATE_FLD1 WHICH IS IN <MYDATE" 
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
Guru
posted Hide Post
Thank you very much SWES and Danny.
It helped a lot and it worked too Smiler


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
 
Posts: 270 | Registered: October 30, 2014Report 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]Change the date format from DD-MON-YY format to MM/DD/YY format

Copyright © 1996-2020 Information Builders