BookmarkSubscribeRSS Feed
dipand
Quartz | Level 8
Hello to all,
I need to convert latitude and longitude expressed in degrees into UTM zone.
I use the code used in this form:

data have;

id=1; lat=45.5; long=73.5;

run;

proc gproject latlon degrees westlong

project=proj4 to="EPSG:32618"  /* WGS 84 / UTM zone 18N */

data=have out=want;

id id;

run;

 

proc print data=want noobs; run;


but if I have some latitude and longitudes that do not fall as indicated in the instruction:
project=proj4 to="EPSG:32618" 
how can i do to convert correctly? there's a way? Thank you all


 

1 REPLY 1
HB
Barite | Level 11 HB
Barite | Level 11

Not sure what you are asking- could you explain more?

Are you asking about how to screen your data before you run gproject on it?

 

data have;
   input id lat long;
datalines;
1 45.5 73.5
2 55.5 63.5
3 65.5 53.5
4 75.5 43.5
5 85.5 33.5
;
run;

proc gproject latlon degrees westlong
	project=proj4 to="EPSG:32618"
	data=have out=want;
	id id;
run;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 378 views
  • 0 likes
  • 2 in conversation