DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
This topic has been marked "Resolved."
Author Message
nitingupta
Participant



Joined: 26 Jul 2013
Posts: 22
Location: PUNE
Points: 181

Post Posted: Sat Sep 22, 2018 5:33 am Reply with quote    Back to top    

DataStage® Release: 11x
Job Type: Server
OS: Windows
Hi All,
I need to validate a given string in DS server jobs. Check If the given string is decimal or not.For Parallel jobs i can use IsValid(Decimal[m,n],MyString) function in transformer stage, however in Server jobs i am not able to find anything similar to perform that. Can someone help me on that.

for e.g. Column1 - decimal[5,2]
Values to reject - 123.444, 1234.567
Values to pass - 123.45, -123.45

Thanks,
Nitin Gupta

_________________
NITIN GUPTA
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 43036
Location: Denver, CO
Points: 222146

Post Posted: Sat Sep 22, 2018 7:42 am Reply with quote    Back to top    

You would have to roll your own, typically in a custom BASIC routine. Been a while but thinking perhaps ICONV with an MD conversion code then check the status of the result? That or just wait for Ray to wander by and chime in. Wink

_________________
-craig

I've all my wisdom teeth, Two up top, two beneath
And yet I'll recognize my mouth says things that aren't so wise
Rate this response:  
Not yet rated
nitingupta
Participant



Joined: 26 Jul 2013
Posts: 22
Location: PUNE
Points: 181

Post Posted: Sat Sep 22, 2018 12:00 pm Reply with quote    Back to top    

Thanks craig, I am trying with ICONV and MD conversion but not yet getting desired results. Meanwhile i will keep digging in it. If any other suggestions there please let me know.

_________________
NITIN GUPTA
Rate this response:  
Not yet rated
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 43036
Location: Denver, CO
Points: 222146

Post Posted: Sun Sep 23, 2018 5:55 am Reply with quote    Back to top    

Whatever you do, don't "test" this using a job but rather the build-in testing capability of the routine editor. Keep it simple so you can rapidly throw many different input strings into it then pass out the status of the conversion as the "answer". And in case you've not used it before, you would use the STATUS function to check the success of the conversion.

_________________
-craig

I've all my wisdom teeth, Two up top, two beneath
And yet I'll recognize my mouth says things that aren't so wise
Rate this response:  
Not yet rated
ray.wurlod

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 23 Oct 2002
Posts: 54541
Location: Sydney, Australia
Points: 295742

Post Posted: Mon Sep 24, 2018 12:20 am Reply with quote    Back to top    

Num() function will report whether the value is numeric. That may suffice for your subject requirement. It even handles scientific notation, such as 6.023E23. It seems, however, that you are in ...

_________________
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Rate this response:  
Not yet rated
nitingupta
Participant



Joined: 26 Jul 2013
Posts: 22
Location: PUNE
Points: 181

Post Posted: Mon Sep 24, 2018 6:17 am Reply with quote    Back to top    

Thanks Ray and Craig for your valuable inputs. I have implemented the logic by creating routine using NUM() and Iconv with MD and its working as expected. Smile

_________________
NITIN GUPTA
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours