DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
Author Message
nandika.kodituwakku



Group memberships:
Premium Members

Joined: 13 Sep 2016
Posts: 5
Location: Australia
Points: 55

Post Posted: Thu Sep 21, 2017 6:25 pm Reply with quote    Back to top    

DataStage® Release: 11x
Job Type: Parallel
OS: Unix
Hi All,

I want to validate Longitude and Latitude and was tired with below , but seems like it didn't work properly

IF Trim(NullToEmpty(DSLink108.LONGITUDE)) >= -180.00000000 OR Trim(NullToEmpty(DSLink108.LONGITUDE)) <= +180.00000000 THEN 0
ELSE 1

IF Trim(NullToEmpty(DSLink108.LATITUDE)) >= 90.00000000 OR Trim(NullToEmpty(DSLink108.LATITUDE)) <= +90.00000000 THEN 0
ELSE 1

Please let me know if you have much better idea to validate the same.

much appreciated

_________________
npk
chulett

Premium Poster


since January 2006

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

Joined: 12 Nov 2002
Posts: 42221
Location: Denver, CO
Points: 216780

Post Posted: Thu Sep 21, 2017 8:13 pm Reply with quote    Back to top    

That's a pretty basic "validation", it would typically include validation of both values together. However... 0 is false and that 1 (actually any non-zero value) is true but is not necessarily intuiti ...

_________________
-craig

Watch out where the huskies go and don't you eat that yellow snow
Rate this response:  
Not yet rated
qt_ky



Group memberships:
Premium Members

Joined: 03 Aug 2011
Posts: 2654
Location: USA
Points: 19691

Post Posted: Fri Sep 22, 2017 5:28 am Reply with quote    Back to top    

Change each OR to AND.

_________________
Choose a job you love, and you will never have to work a day in your life. - Confucius
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: 42221
Location: Denver, CO
Points: 216780

Post Posted: Fri Sep 22, 2017 6:55 am Reply with quote    Back to top    

There's a small echo in here, it would seem. Wink

_________________
-craig

Watch out where the huskies go and don't you eat that yellow snow
Rate this response:  
Not yet rated
qt_ky



Group memberships:
Premium Members

Joined: 03 Aug 2011
Posts: 2654
Location: USA
Points: 19691

Post Posted: Fri Sep 22, 2017 8:55 am Reply with quote    Back to top    

Ah, yes. I see it now, hidden amongst other ramblings! Laughing

_________________
Choose a job you love, and you will never have to work a day in your life. - Confucius
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: 42221
Location: Denver, CO
Points: 216780

Post Posted: Fri Sep 22, 2017 9:16 am Reply with quote    Back to top    

Yes, that's me... the rambler. Very Happy

_________________
-craig

Watch out where the huskies go and don't you eat that yellow snow
Rate this response:  
Not yet rated
UCDI



Group memberships:
Premium Members

Joined: 21 Mar 2016
Posts: 267

Points: 2686

Post Posted: Fri Sep 22, 2017 1:30 pm Reply with quote    Back to top    

its your data, but be sure the entry is not valid if you cap it back to the desired range. That is, 250 degrees is a valid location on the earth, and you can convert it to a negative degree value to get it in the 'normal' gps range. Occasionally one runs into a device or code that gives the right answer in math terms but incorrect in gps formatting, is what I mean. Just a thought.
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