Hi all,
i have a list of data which is look like that -> 07:30 ,12:30,09:30
what i have to do is i have to extract the data from 07:30 -> 07 , 12:30 ->
12, 09:30 ->09
I used the Oconv(data field name , "G:1") then i can get the 07,12,09
But i dunno how to make it from 07 -> 7 ,12 ->12 , 09 ->9
is there anyway to disappear the zero infront when the data have a zero infront?
please help
thank you
Disappeared the zero infront
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Performing any arithmetic operation in a DataStage BASIC expression, such as adding zero to the number, will strip non-significant leading and trailing zeroes.
You might also investigate the Field() function, which is slightly more efficient that the group conversion you have chosen to do.
You might also investigate the Field() function, which is slightly more efficient that the group conversion you have chosen to do.
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.
-
- Participant
- Posts: 32
- Joined: Wed Dec 28, 2005 9:02 pm
Hi,ray.wurlod wrote:
Performing any arithmetic operation in a DataStage BASIC expression, such as adding zero to the number, will strip non-significant l ...
Eventhough i cant see half of ur explaination....i forgot the trim function.
I'm now using the trim(xxx,0,'L') but still thinking of the field data which is 0:00 -> i have to maintain the 0 to them if the data is 0:00......
anyway thank a lot!
-
- Participant
- Posts: 32
- Joined: Wed Dec 28, 2005 9:02 pm
chowmunyee wrote:Hi,ray.wurlod wrote:
Performing any arithmetic operation in a DataStage BASIC expression, such as adding zero to the number, will strip non-significant l ...
Eventhough i cant see half of ur explaination....i forgot the trim function.
I'm now using the trim(xxx,0,'L') but still thinking of the field data which is 0:00 -> i have to maintain the 0 to them if the data is 0:00......
anyway thank a lot!
I have think of the idea to solve is using if else statement. I'm not sure this is the best or worst but at least i can able to achieved the expected result. Please share with me if you have the better solution than mine one...
I'm using
if trim(oconv(xxx, G:1),0,'L')=\\
Then '0'
Else trim(oconv(xxx, G:1),0,'L')
Thank you
As Ray has already stated, just add a 0 to the number in a derivation and your leading zeroes will be stripped out.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: