Hello All,
I am currently running a job from a sequencer.The Sequencer has a Start Job Activity and End Loop. I have to run the same job for number of days say 20 or more.
I am currently passing the a parameter in the start loop and the value is in format YYYYMMDD
From -- #BeginDate#
Step--- 1
To----- #EndDate#
Its runs good, but i know this isnt a right approach and this wont solve my problem.I want to pass the date not as numeric but in its original format say YYYY-MM-DD or MM-DD-YYYY.
Please advice,
Thanks,
Start Loop
Moderators: chulett, rschirm, roy
Re: Start Loop
You can't - not if you want the Loop stages to control the iterations. You'd have to roll your own, I would think, if you really want to stick with ISO dates for some reason.thumsup9 wrote:Its runs good, but i know this isnt a right approach and this wont solve my problem.I want to pass the date not as numeric but in its original format say YYYY-MM-DD or MM-DD-YYYY.
There's nothing wrong with your approach per se, and you'll need to stick with 'numeric' dates - the only thing you are missing is converting them to internal format first. If you do that then you can iterate from BeginDate to EndDate with a step of 1, with each step being a day.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Thx Craig and Kumar,
I think i was confused and also confused you,
I have main sequencer job sqDimensionLoad.It has 3 job activities,
loadjob1,loadjob2,sqloadjob3.( All these jobs take #BeginDate# retunred by a routine as input to run each day 10/28 )
sqloadjob3 is a sequencer by itself which has 1 job activity
startloop--loadjob3--endloop.
I want to run sqloadjob3 job for say 2days (10/26,10/27,10/28 back from #BeginDate# ,how do I run this particular job for 3 different days while calling this job from sqDimensionLoad where we are passing #BeginDate#
Please ask me if you need further clarification,
Thanks,
I think i was confused and also confused you,
I have main sequencer job sqDimensionLoad.It has 3 job activities,
loadjob1,loadjob2,sqloadjob3.( All these jobs take #BeginDate# retunred by a routine as input to run each day 10/28 )
sqloadjob3 is a sequencer by itself which has 1 job activity
startloop--loadjob3--endloop.
I want to run sqloadjob3 job for say 2days (10/26,10/27,10/28 back from #BeginDate# ,how do I run this particular job for 3 different days while calling this job from sqDimensionLoad where we are passing #BeginDate#
Please ask me if you need further clarification,
Thanks,
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Create a delimited list of dates in an upstream Routine, and use that as the driver for a List loop. Error handling has been omitted here for clarity.
Code: Select all
FUNCTION ListOfDates(StartDate,EndDate)
intStartDate = Iconv(StartDate, "DYMD")
intEndDate = Iconv(EndDate, "DYMD")
Ans = ""
For intDate = intStartDate To intEndDate
Ans<-1> = intDate
Next IntDate
Convert @FM To "," In Ans
RETURN(Ans)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Ray's got another way having the Loop step through a delimited list of dates. Don't see why the way I outlined wouldn't work as well, the decider would be how you needed to use the parameter, if you had a chance to switch it back to 'external' format within the job or if you needed to use it before there would be any chance to do that - like in SQL.
Probably easiest to take Ray's route as it can use the dates in the format you'd prefer. Then something like this in the Job Activity stage that runs sqloadjob3 to pass in the iteration date from the delimited list:
Probably easiest to take Ray's route as it can use the dates in the format you'd prefer. Then something like this in the Job Activity stage that runs sqloadjob3 to pass in the iteration date from the delimited list:
Code: Select all
Trim(EReplace(YourLoopList.$Counter,@FM,""))
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: