I want to read a series of coordinate into SAS dataset. There are three variables: AREA, X and Y. AREA is a character variable.
When there is only one value of AREA and coresponding (X,Y) coordinates, I can use the program:
data grid;
retain area;
if _n_=1 then input area :$1. @;
input x y @@;
datalines;
E 0 150 35 155 50 550
;
The result what I want:
AREA X Y
The 1st Row: E 0 150
The 2nd Row: E 35 155
The 3rd Row: E 50 550
But I cann't handle condition with multiple level of AREA:
data grid;
retain area;
if _n_=1 then input area :$1. @;
input x y @@;
datalines;
E 0 150 35 155 50 550
D 0 100 25 100 50 125 80 215 125 550
C 0 60 30 60 50 80 70 110 260 550
;
This program failed.
Another difficulty is there maybe 3, 4 or 5 coordinates for each level of AREA.
Please help, Rearrange datalines is allowed but I don't want it occupy too much row, because I am putting it into presentation.
... View more