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;

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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