Custom Routine
Moderators: chulett, rschirm, roy
Custom Routine
Hi
Can anyone help me write a custom routine?
I have a workdate & from the workdate I should get a date 30 days ago.
Thanks !
Can anyone help me write a custom routine?
I have a workdate & from the workdate I should get a date 30 days ago.
Thanks !
Cutom Routine
Thanks for ur reply.Yes,If I do that in transformer stage,I can do that way.But i ahve to use this concept in Routine Activity Sequence & use it no where in the project except in Sequence.HOw to do in the sequence?chulett wrote:You don't need a routine for that - simply use IConv to convert to internal format, subtract 30 and then OConv back to whatever external format you'd like. ...
Cutom Routine
Thanks for ur reply.Yes,If I do that in transformer stage,I can do that way.But I have to use this concept in Routine Activity Sequence & use it no where in the project except in Sequence.HOw to do in the sequence?chulett wrote:You don't need a routine for that - simply use IConv to convert to internal format, subtract 30 and then OConv back to whatever external format you'd like. ...
Re: Cutom Routine
No matter where you do the computation, the basic logic remains the same. Assuming your date is of the form 'YYYY-MM-DD', then as Craig pointed out, you can use -
Code: Select all
Oconv(Iconv(YourDate,"D-YMD[4,2,2]") - 30, "D-YMD[4,2,2])
gateleys
Re: Cutom Routine
I have the date format as 23012008[DDMMYYYY] . My code wasgateleys wrote:No matter where you do the computation, the basic logic remains the same. Assuming your date is of the form 'YYYY-MM-DD', then as Craig pointed out, you can use -Code: Select all
Oconv(Iconv(YourDate,"D-YMD[4,2,2]") - 30, "D-YMD[4,2,2])
iDate=ICONV(Arg1,"DE")-Arg2
dateDiff=iDate-Arg2
Ans=Oconv(iDate,"DE")
Arg1 -WorkDate[23012008]
Arg2-30
When I run this code,I am getting the correct output
Re: Cutom Routine
I hope you understand the overhead of calling your function for every row!!
Why don't you just use the single line transformation? What's wrong with that?
Why don't you just use the single line transformation? What's wrong with that?
gateleys
Re: Cutom Routine
Sorry for my last reply.The code is not working.I can use your code but the concerns are about the Format.As I have the format as DDMMYYYY which is not supported by Iconv or Oconv.Can you pls help me?gateleys wrote:I hope you understand the overhead of calling your function for every row!!
Why don't you just use the single line transformation? What's wrong with that?
Re: Cutom Routine
All you had to do was take away the 'dash' in the format and rearrange the YMD to DMY-
Code: Select all
Oconv(Iconv(YourDate,"DDMY[2,2,4]") - 30, "DDMY[2,2,4])
gateleys
Re: Cutom Routine
Thank you so much.It works fine.gateleys wrote:All you had to do was take away the 'dash' in the format and rearrange the YMD to DMY-
Code: Select all
Oconv(Iconv(YourDate,"DDMY[2,2,4]") - 30, "DDMY[2,2,4])