0
各都市の連結コードリストに文字列変数 "zip"を組み合わせたzipcodes変数を作成する必要があります。ここで私がこれまで持っているものです。SASの圧縮データセットに連結コードリストを作成する
data work.zip (drop=estimated_population zip);
set work.clean;
by state primary_city;
length zipcodes $200;
retain zipcodes;
if first.primary_city then do;
estcitpop=0;
zipcodes= zip;
end;
else
zipcodes=cats(zipcodes, ',', zip);
estcitpop+estimated_population;
if last.primary_city;
run;
これは私が右の結果取得しますが、それを行うには良い方法はありますか?
ジップは文字の値であり、そのように留まる必要があります。たとえば、ヒューストン市の場合、12345、11345、11145、および11115の郵便番号がある場合は、「12345,11345,11145,11115」と読むために郵便番号が必要です。