Excellent Idea from @Reeza. My solution is the same: Use SQL to create the Cartesian product, but the State table can be fairly easily created from SAShelp.GCstate. GCstate includes territories like GU, PR, VI, etc. and Washington DC ("DC"), but you can screen out the ones you don't want fairly easily.
Code changed as follows:
data Degrees;
drop _:;
DO _I = 1 TO 47;
Degree_name = CATS('Degree', put(_i, 2.));
OUTPUT;
END;
run;
/*DATA States;*/
/* drop _:;*/
/* DO _I = 1 TO 50;*/
/* State_Code = CATS('State', put(_i, 2.));*/
/* OUTPUT;*/
/* END;*/
/*run;*/
PROC SQL;
CREATE TABLE States as
SELECT DISTINCT MapIDNameAbrv as State_Code
FROM SAShelp.GCSTATE
WHERE ISOalpha3 = 'USA';
QUIT;
PROC SQL;
CREATE TABLE Degrees_With_States AS
SELECT Degree_Name
,State_Code
from degrees, states;
QUIT;
Jim
... View more