loops in Transformer Stage

两盒软妹~` 提交于 2019-12-11 15:13:25

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!