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. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.
Connect to myibi
Read-Only TopicGo
Search
Notify
Admin
New PM!
Platinum Member posted September 28, 2020 04:11 AM
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 , September 30, 2020 11:39 PM WebFOCUS v8.2.06 , Windows
Platinum Member 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: 210 | Location: Sterling Heights, Michigan | Registered: October 19, 2010
IP
Guru 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, 2007
IP
Platinum Member 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
Ignored post by
nox
posted
September 30, 2020 11:39 PM Show Post
Please Wait. Your request is being processed...
Read-Only TopicCopyright © 1996-2020 Information Builders