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  iWay Software Product Forum on Focal Point    [SOLVED] issues with date related functions during migration

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] issues with date related functions during migration
 Login/Join
 
Member
posted
we are in a migration phase from ISM 6.1 to ISM 8.

one of our integration reads a file which has the following data


SOME-NMAE
-10
1


then we have a series of nested IFL functions that constructs a date out of the and based on passed values. 1 stands for today and -10 is go 10 days back from today to find some information.

_if(_isnumber(_qval(_xpath(//Download/FromDate))),_fmtDate('yyyy/MM/dd',_iadd(_iadd(_now(U),_dateof('dd',_qval(_xpath(//Download/FromDate)))),_dateof('dd',1))), _qval(_xpath(//Download/FromDate)))

1. i have updated the _now to _timer as recommended.
2. after this i get the following error



XML parsing error : XD[FAIL] cause: 0 subcause: 2 message: Parse failure: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
'-10'



any help on this ?

This message has been edited. Last edited by: FP Mod Chuck,


Data Migrator 7.7
service manager 6.0, 6.1, 6.5 and 8
 
Posts: 15 | Location: Ottawa, Canada | Registered: June 07, 2013Report This Post
Virtuoso
posted Hide Post
Those date functions do not work with negative values.

If you want to subtract from today, then try:
 _fmtdate('yyyy/MM/dd',_imul(_iadd(_timer('seconds'),_imul(86400,-10)),1000)) 
where the -10 is your value. It can be positive or negative in this case.

You will have to condition the use of 1 as a one in the above will get you tomorrow. So for today, this will work:
 _fmtdate('yyyy/MM/dd',_timer('milliseconds'))  


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Member
posted Hide Post
thanks for the reply Darryl, however what i am trying to do is a bit different.

the pflow reads a file which has the following info
   <Download>
        <Name>SOME-NAME</Name>        
        <FromDate>-10</FromDate>
        <ToDate>1</ToDate>
</Download> 


it takes the fromDate and toDate based on the numeric values passed and constructs a date using these. A negative value represents past date so here toDate will be today's date and -10 will be 10 days before.

in ISM 6.1.2 it is working fine (see the extract of log file)

setSREG(pre) name=FromDate/thread was='null' val=_if(_isnumber(_xpath(//Download/FromDate)),_fmtDate('yyyy/MM/dd',_iadd(_iadd(_now(U),_dateof('dd',_xpath(//Download/FromDate))),_dateof('dd',1))), _xpath(//Download/FromDate)) :=2019/01/29



but when i migrated this pflow to ISM 8.0.1 it is not working anymore. (see log below)

Exception in execute of _fmtdate('yyyy', _dateof('yyyy/MM/dd',_sreg('Fdate'))): XD[FAIL] cause: 0 subcause: 0 message: Unable to process function expression for function: dateof, parameter: 2; Value ''-10'' is not a valid date per the format in parm 1


i want to understand what i should modify so that it will work properly and constructs the dates.

from the release notes i only understood that instead of _now we need to use _timer which i tried and that didnt worked.


Data Migrator 7.7
service manager 6.0, 6.1, 6.5 and 8
 
Posts: 15 | Location: Ottawa, Canada | Registered: June 07, 2013Report This Post
Member
posted Hide Post
aha Darryl i understood now as to what you meant.

thanks it worked for me.


Data Migrator 7.7
service manager 6.0, 6.1, 6.5 and 8
 
Posts: 15 | Location: Ottawa, Canada | Registered: June 07, 2013Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [SOLVED] issues with date related functions during migration

Copyright © 1996-2020 Information Builders