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    issues with date related functions during migration
Go
New
Search
Notify
Tools
Reply
  
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 ?


Data Migrator 7.7
service manager 6.0, 6.1, 6.5 and 8
 
Posts: 15 | Location: Ottawa, Canada | Registered: June 07, 2013Reply With QuoteReport 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: 1080 | Location: Toronto, Ontario | Registered: May 26, 2004Reply With QuoteReport 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, 2013Reply With QuoteReport 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, 2013Reply With QuoteReport This Post
  Powered by Social Strata  
 

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

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