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     [CLOSED] Conversion From Date to Alpha.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Conversion From Date to Alpha.
 Login/Join
 
Guru
posted
Hi All,
I am receiving a Date value from some external (maintain proc) in fex file. Value is received in &1 variable as 31122012. I am trying to convert it in alpha value 'dd-mon-yyyy'. e.g, for 31122012 will be '31-Dec-2012'. I am trying below code:

 
-SET &ECHO = ON;
-SET &ECHO = ALL;

TYPE &1;

--SET &EEF_DT = DATETRAN(&1.EVAL, '(DMYY)', '(-t)', 'EN', 11, 'A11');
-TYPE &EEF_DT;


But the above code is returning '-TYPE 05-Mar- ;'. I don’t understand this behaviour of webfocus. Is there something I am doing wrong? How can I handle this scenario to convert dates in Alpha value as mentined above. Please advice.

Thanks in Advance.

This message has been edited. Last edited by: <Kathryn Henning>,


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
Guru
posted Hide Post
Hi,
I got it working like below:

 
-SET EFF_DT1 = EDIT('&1.EVAL','99$$$$$$');
-SET EFF_DT2 = EDIT('&1.EVAL','$$99$$$$');
-SET EFF_DTM = IF '&EFF_DT2.EVAL' EQ '12' THEN 'Dec' ELSE IF '&EFF_DT2.EVAL' EQ '11' THEN 'Nov'  ELSE IF '&EFF_DT2.EVAL' EQ '10' THEN 'Oct'  ELSE IF '&EFF_DT2.EVAL' EQ '09' THEN 'Sep'  ELSE IF '&EFF_DT2.EVAL' EQ '08' THEN 'Aug'  ELSE IF '&EFF_DT2.EVAL' EQ '07' THEN 'Jul'  ELSE IF '&EFF_DT2.EVAL' EQ '06' THEN 'Jun'  ELSE IF '&EFF_DT2.EVAL' EQ '05' THEN 'May'  ELSE IF '&EFF_DT2.EVAL' EQ '04' THEN 'Apr'  ELSE IF '&EFF_DT2.EVAL' EQ '03' THEN 'Mar'  ELSE IF '&EFF_DT2.EVAL' EQ '02' THEN 'Feb'  ELSE IF '&EFF_DT2.EVAL' EQ '01' THEN 'Jan'; 
-SET EFF_DT3 = EDIT('&1.EVAL','$$$$9999');
-SET EFF_DT = '&EFF_DT1.EVAL' | '-' | '&EFF_DTM.EVAL' | '-' |'&EFF_DT3.EVAL';
 


Thanks.


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
Virtuoso
posted Hide Post
First a few general remarks:
  • you don't need to .EVAL variable substitutions and
  • you don't need to quote them within blocks of Dialog Manager code either.
  • For &ECHO, ALL overrides ON, so specifying both doesn't gain you anything.


For the "date", your problem is that you don't have a date value, but an integer value. Before you can apply DATETRAN to your value, you need to convert it to a date first:
-SET &1 = 31122012;

-TYPE &1;

-SET &EEF_DT = DATETRAN(DATECVT(&1, 'I8DMYY', 'DMYY'), '(DMYY)', '(-t)', 'EN', 11, 'A11');
-TYPE &EEF_DT;


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Virtuoso
posted Hide Post
DATETRAN requires an internal date format. You can use:
-SET &indate2 = DATETRAN(DATECVT(&1,'I8DMYY','DMYY'),'(DMYY)','(-t)','EN',11,'A11');
-TYPE &indate2


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report 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     [CLOSED] Conversion From Date to Alpha.

Copyright © 1996-2020 Information Builders