问题
I want the output of dates from particular range in a specific format
date1: 2019-06-18
date2: 2019-06-22
Output will be:
2019-06-19|2019-06-19,2019-06-20|2019-06-20,2019-06-21|2019-06-21
I want to do this via Datastage Component only, no unix, no perl script.
回答1:
From one input record you can generate multiple rows witha transformer loop. Date1 is frim the inout and date2 could be built with currentdate() in the transformer. In the loop @IERATION is the the loop counter so you could use DateOffsetByDays with your input date and @ITERATION as second parameter. Run the loop while it is <= currentDate()
In a second transformer you could then concat whatever date format you need - ot could be helpful to add a artificial numer to all rows produced from one input row.
来源:https://stackoverflow.com/questions/56700713/loops-in-transformer-stage