In reply to Leonid Batkhan.

Thanks, I've since been able to find a way of converting between the two!

I can't seem to get it to work properly. The structure of my input SAS data set is

country polygon path lat long
england 1 1 XXX YYYY
england 1 2 XXX YYYY
...
england 2 1 XXX YYYY
england 2 2 XXX YYYY
...
scotland 1 1 XXX YYYY
scotland 2 1 XXX YYYY
...
and so on. I'm not sure which variable(s) to put in the first. and last. section of the code and anything i do put in it moans that the by variables are not properly sorted. Do you have any advice?

Thanks again for your help!