![]() |
||||||||||||
Go ![]() | New ![]() | Search ![]() | Notify ![]() | Tools ![]() | Reply ![]() | ![]() |
Member |
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 then we have a series of nested IFL functions that constructs a date out of the _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 '-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 | ||
|
Virtuoso |
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 | |||
|
Member |
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 | |||
|
Member |
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 | |||
|
Powered by Social Strata |
![]() | Please Wait. Your request is being processed... |
|