Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [SOLVED]why 'function' return '*' as my result?
Go
New
Search
Notify
Tools
Reply
  
[SOLVED]why 'function' return '*' as my result?
 Login/Join
 
Platinum Member
posted
Hi,

I have define a Function in Iway Datamigrator as following:

 
DEFINE FUNCTION FUN1(PARAM1/HYYMDS XDEFAULT '1900/01/01 00:00:00') 
 FUN1/A32V=CONCAT( TO_CHAR( (HPART( PARAM1, 'YEAR', 'I4' ) - 1911) ), SUBSTRING( DT_FORMAT( PARAM1, 'HYYMDS' ), 5, 27 ) ); 
END 

 


and I define a column named "New_Date" with:
 
DF.functions/chinese_year.FUN1(HUM_DATE)
 


and my HUM_DATE(HYYMDS) contain:
 

2013/06/20 11:10:47.443
2013/06/20 11:10:55.160
2013/06/20 11:25:40.563
2013/06/20 11:27:05.030
2013/07/23 16:56:08.407
 


but I end up with:
  

*******/06/20 11:10:47
*******/06/20 11:10:55
*******/06/20 11:25:40
*******/06/20 11:27:05
*******/07/23 16:56:08



any idea why?

Note: When I try FUN1 by input parameter manual and I get : 102/06/20 11:10:47.443
as expected.

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


WebFOCUS v8.2.06 , Windows
 
Posts: 132 | Registered: August 29, 2019Reply With QuoteReport This Post
Platinum Member
posted Hide Post
This is an odd bug. Using the TO_CHAR function with I4 data in a DEFINE FUNCTION causes the asterisks.
Fix it by changing the I4 to an I5.
 DEFINE FUNCTION FUN1(PARAM1/HYYMDS XDEFAULT '1900/01/01 00:00:00') 
 FUN1/A32V=CONCAT( TO_CHAR( (HPART( PARAM1, 'YEAR', 'I5' ) - 1911) ), SUBSTRING( DT_FORMAT( PARAM1, 'HYYMDS' ), 5, 27 ) ); 
 END 

 TABLE FILE car
 PRINT COUNTRY
 COMPUTE HDATE/HYYMDS = '2013/06/20 11:10:47.443';
 COMPUTE DEFUNC/A32V  = FUN1(HDATE);
 COMPUTE NOFUNC/A32   = CONCAT( TO_CHAR( (HPART( HDATE, 'YEAR', 'I4' ) - 1911) ), SUBSTRING( DT_FORMAT( HDATE, 'HYYMDS' ), 5, 27 ) ); 
 END


WebFOCUS 8.2.06
 
Posts: 204 | Location: Sterling Heights, Michigan | Registered: October 19, 2010Reply With QuoteReport This Post
Guru
posted Hide Post
It works for me in the current 8207.17 release. Please confirm the synonym describes the input field correctly. Other than that, sorry no idea.



N/A
 
Posts: 397 | Location: New York City | Registered: May 03, 2007Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Hi dbeagan,

Thanks, Solved the problem. I think it is a bug... why 'I5' work while 'I4' is not working in Function? It's weird.

Hi Clif,

the version I test was on 8.206.773 version...latest for 8.206 for now.


WebFOCUS v8.2.06 , Windows
 
Posts: 132 | Registered: August 29, 2019Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [SOLVED]why 'function' return '*' as my result?

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.