/* imread.sas */ options linesize = 132 nocenter; /*******************************************************/ title 'Read 1981 district neighbor matrix'; /*******************************************************/ /* two alternate locations of input data: */ filename ndata pipe 'gunzip -c /export/software/cwmills2/districts/data/neigh/d012812.data.gz' lrecl=416; filename ndata '/var/spool/ftp/pub/india/neigh81.dat' lrecl=416 ; data temp ; infile ndata; length name $ 24; length d1-d376 4; input (STATEID DIST VARID YEAR VERSION NAME ORDER NNEIGH D1-D376) ($2. $2. $3. $2. $1. $24. 4. 2. 376*1.) ; /* DROP assam1-assam10; */ /* IF (STATEID eq '04') then delete ; */ length DISTID $ 4; DISTID = STATEID || DIST; drop DIST; proc contents; proc print; var DISTID VARID YEAR VERSION NAME NNEIGH; proc means n sum mean min max; proc freq; tables VARID YEAR VERSION NNEIGH; run;