title Postal code conversion file, STC November 2000 edition subtitle SPSS commands, L Ruus UT/DLS 09/1998, rev. 02/2002 set length=none width=133 file handle in /inpipe='zcat /datalibrary/datalib/cstdli/pccf/pccf_nov01/pccfnat_nov01.txt.Z' /lrecl=183 data list file=in / pstart 1 (a) postcode 1-6 (a) orp 7-8 ofed87 9-11 oea87 12-14 olat 15-23 (a) olong 24-34 (a) osli 35 orp2 36-37 orp3 38-39 ocd 40-41 ocsdcode 42-44 ocsdname 45-101 (a) ocsdtype 102-104 (a) occs 105-107 ocma 108-110 ocmatype 111 (a) opcma 112-114 opcmatyp 115 (a) octname 116-122 (a) oercode 123-124 odpl 125-127 orp4 128-129 ofed96 130-132 orurban 133 orpf 134 opct 135 ocomname 136-165 (a) odmt 166 (a) ohdmt 167 (a) obirth 168-175 (a) oretiryr 176-179 oretirmo 180-181 oretirdy 182-183 * Note: when the 'pstart' code is two digits, the above * data list statement reading in 'pstart' needs to be amended as: * pstart 1-2 (a) * Newfoundland select if (pstart eq 'A') * Nova Scotia * select if (pstart eq 'B') * Prince Edward Island * select if (pstart eq 'C') * New Brunswick * select if (any(pstart,'E0','E1','E2','E3','E4')) * select if (any(pstart,'E5','E6','E7','E8','E9')) * Quebec east * select if (any(pstart,'G0','G1','G2','G3','G4')) * select if (any(pstart,'G5','G6','G7')) * select if (any(pstart,'G8','G9')) * Montreal * select if (any(pstart,'H0','H1')) * select if (any(pstart,'H2','H3')) * select if (any(pstart,'H4','H5')) * select if (any(pstart,'H6','H7')) * select if (any(pstart,'H8','H9')) * Quebec west * select if (any(pstart,'J0','J1')) * select if (any(pstart,'J2','J3')) * select if (any(pstart,'J4','J5')) * select if (any(pstart,'J6','J7')) * select if (any(pstart,'J8','J9')) * Ontario east * select if (any(pstart,'K0','K1','K2','K3','K4')) * select if (any(pstart,'K5','K6','K7','K8','K9')) * Ontario Central * select if (any(pstart,'L0','L1','L2','L3')) * select if (any(pstart,'L4','L5','L6')) * select if (any(pstart,'L7','L8','L9')) * Toronto * select if (any(pstart,'M0','M1')) * select if (any(pstart,'M2','M3')) * select if (any(pstart,'M4','M5')) * select if (any(pstart,'M6','M7')) * select if (any(pstart,'M8','M9')) * Ontario southwest * select if (any(pstart,'N0','N1')) * select if (any(pstart,'N2','N3')) * select if (any(pstart,'N4','N5','N6')) * select if (any(pstart,'N7','N8','N9')) * Ontario north * select if (any(pstart,'P0','P1','P2','P3','P4')) * select if (any(pstart,'P5','P6','P7','P8','P9')) * Manitoba * select if (pstart eq 'R') * Saskatchewan * select if (pstart eq 'S') * Alberta * select if (any(pstart,'T0','T1','T2','T3')) * select if (any(pstart,'T4','T5','T6')) * select if (any(pstart,'T7','T8','T9')) * British Columbia * select if (any(pstart,'V0','V1','V2')) * select if (any(pstart,'V3','V4')) * select if (any(pstart,'V5','V6')) * select if (any(pstart,'V7','V8','V9')) * Northwest Territories, Yukon and Nunavut * select if ((pstart eq 'X') or (pstart eq 'Y')) frequencies variables=orp pstart sort cases by postcode osli (d) aggregate outfile=* / break=postcode / rp=first(orp) / fed87=first(ofed87) / ea87=first(oea87) / lat=first(olat) / long=first(olong) / sli=first(osli) / rp2=first(orp2) / rp3=first(orp3) / cd=first(ocd) / csdcode=first(ocsdcode) / csdname=first(ocsdname) / csdtype=first(ocsdtype) / ccs=first(occs) / cma=first(ocma) / cmatype=first(ocmatype) / pcma=first(opcma) / pcmatype=first(opcmatyp) / ctname=first(octname) / ercode=first(oercode) / dpl=first(odpl) / rp4=first(orp4) / fed96=first(ofed96) / rurban=first(orurban) / rpf=first(orpf) / pct=first(opct) / commname=first(ocomname) / dmt=first(odmt) / hdmt=first(ohdmt) / birth=first(obirth) / retireyr=first(oretiryr) / retiremo=first(oretirmo) / retiredy=first(oretirdy) / count=nu frequencies variables=rp write outfile='nfld.dat' table / postcode to count execute finish