Dear All,
I want to check the below condition...
Like the value
$0 to $100000 output 01
$10001 to $20000 output 02
$20001 to $30000 output 03
$30001 to $4000 output 04 etc....
So i need the equalient dataStage function for oracle ceil
Thanks in advance for your help..
Regards
Raj
Equalient DataStage function for oracle ceil
Moderators: chulett, rschirm, roy
Equalient DataStage function for oracle ceil
Last edited by raj158347 on Wed Jan 02, 2008 4:34 am, edited 1 time in total.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
thanks for your kind reply..Sorry actualy i need if the value like belowray.wurlod wrote:How would you do that with ceil ?!!
Try...Code: Select all
Mod(InLink.TheColumn,10000) - 1
$0 to 100000 output 01
$100001 to 200000 output 02
$20001 to 300000 output 03 so if i use ceil function i can get the nearest greatest for the value like ceil (100001/10000) output will be 2 as you know.Excatly i want to do the same.
Thanks & Regards
Raj
-
- Participant
- Posts: 20
- Joined: Mon Dec 11, 2006 10:57 am
- Location: Pune
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You changed your specification. My solution changes only by losing its "- 1". You can use the Fmt() function to enforce leading zero.
I remain curious to learn how you would generate these values using ceil without any other arithmetic (since you did not mention any).
Switch stage is not available in server jobs and, in any case, would not generate the value that the OP seeks.
I remain curious to learn how you would generate these values using ceil without any other arithmetic (since you did not mention any).
Switch stage is not available in server jobs and, in any case, would not generate the value that the OP seeks.
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.
Dear All ..
Thanks for your kind reply...
By using the following code + FMT function it is solved
IF WKLIABUSD = 0 THEN
DIV = 0
QUAS = 1
END
ELSE
DIV = DIV(WKLIABUSD,WKDIVI)
QUAS = WKLIABUSD/WKDIVI
END
IF QUAS > DIV THEN
Ans = DIV+1
END
ELSE
Ans = DIV
END
WKLIABUSD is the value
WKDIVI is divser value
Eg :
WKLIABUSD 98000001
WKDIVI 1000000
Ans is 99
Regards
Raj
Thanks for your kind reply...
By using the following code + FMT function it is solved
IF WKLIABUSD = 0 THEN
DIV = 0
QUAS = 1
END
ELSE
DIV = DIV(WKLIABUSD,WKDIVI)
QUAS = WKLIABUSD/WKDIVI
END
IF QUAS > DIV THEN
Ans = DIV+1
END
ELSE
Ans = DIV
END
WKLIABUSD is the value
WKDIVI is divser value
Eg :
WKLIABUSD 98000001
WKDIVI 1000000
Ans is 99
Regards
Raj
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: