A data set that contains ZIP code information is supplied by SAS. It is located in the Sashelp library, and the fully qualified name is Sashelp.Zipcode.
See Usage Note 19861: "How to replace the Sashelp.Zipcode data set", for additional information about how to update this file.
If you choose to use another file containing ZIP codes, you will have to make some changes to the normal method for using the functions and procedures related to using that data.
NOTE: SAS will not provide support when using a ZIP code file that was not supplied by SAS.
If you are using a Windows or UNIX operating environment, follow the instructions below to include an additional directory for SAS to search in order to use the non SAS ZIP code file.
-insert sashelp /usr/zipcode/dir
The directory path /usr/zipcode/dir is an example of where you could store the new file. You should replace this with the actual location that you choose, and follow the operating system guidelines for the path reference.
proc options option=sashelp; run;
The code above returned the results below. Again, you will see your library location in place of the path in the example.
SASHELP=('/usr/zipcode/dir' '!SASROOT/nls/en/sascfg' '! SASROOT/sashelp')
Contact your company's IT staff or system administrator if you have problems performing these steps.
If you are using an MVS operating environment, click the Full Code tab to see the JCL and job stream that is required to use the file.
Product Family | Product | System | SAS Release | |
Reported | Fixed* | |||
SAS System | N/A | z/OS | ||
Z64 | ||||
OpenVMS VAX | ||||
Macintosh | ||||
Macintosh on x64 | ||||
Microsoft Windows 2000 Professional | ||||
Microsoft® Windows® for 64-Bit Itanium-based Systems | ||||
Microsoft Windows Server 2003 Datacenter 64-bit Edition | ||||
Microsoft Windows Server 2003 Enterprise 64-bit Edition | ||||
Microsoft Windows XP 64-bit Edition | ||||
Microsoft® Windows® for x64 | ||||
OS/2 | ||||
Microsoft Windows 95/98 | ||||
Microsoft Windows 2000 Advanced Server | ||||
Microsoft Windows 2000 Datacenter Server | ||||
Microsoft Windows 2000 Server | ||||
Microsoft Windows NT Workstation | ||||
Microsoft Windows Server 2003 Datacenter Edition | ||||
Microsoft Windows Server 2003 Enterprise Edition | ||||
Microsoft Windows Server 2003 Standard Edition | ||||
Microsoft Windows Server 2003 for x64 | ||||
Microsoft Windows Server 2008 | ||||
Microsoft Windows Server 2008 for x64 | ||||
Microsoft Windows XP Professional | ||||
Windows 7 Enterprise 32 bit | ||||
Windows 7 Enterprise x64 | ||||
Windows 7 Home Premium 32 bit | ||||
Windows 7 Home Premium x64 | ||||
Windows 7 Professional 32 bit | ||||
Windows 7 Professional x64 | ||||
Windows 7 Ultimate 32 bit | ||||
Windows 7 Ultimate x64 | ||||
Windows Millennium Edition (Me) | ||||
Windows Vista | ||||
Windows Vista for x64 | ||||
64-bit Enabled AIX | ||||
64-bit Enabled HP-UX | ||||
64-bit Enabled Solaris | ||||
ABI+ for Intel Architecture | ||||
AIX | ||||
HP-UX | ||||
HP-UX IPF | ||||
IRIX | ||||
Linux | ||||
Linux for x64 | ||||
Linux on Itanium | ||||
OpenVMS Alpha | ||||
OpenVMS on HP Integrity | ||||
Solaris | ||||
Solaris for x64 | ||||
Tru64 UNIX |
The following job stream demonstrates how the same capability is available using
MVS by providing a config option:
//ZIPCITYX JOB ,JONES
/*JOBPARM FETCH
// EXEC SAS92P
//*MYZIPS DD DSN=&&MYZIPS,DISP=(NEW,PASS),UNIT=SYSDA,
//* SPACE=(CYL,(50,10))
//MYZIPS DD DSN=SASXXX.MYTEST.SASHELP,DISP=OLD
//MYCONFIG DD DSN=&&MYCONFIG,DISP=(NEW,PASS),UNIT=SYSDA,
// SPACE=(TRK,10)
//SYSIN DD *
proc contents data=sashelp.zipcode; run;
data temp; zip=96799; city='Pago Pago'; state=60; run;
data myzips.zipcode(index=(zip)); merge sashelp.zipcode temp;
by zip;
run;
data myzips.tryit; x=1; run;
proc contents data=myzips.zipcode; run;
data _null_; file myconfig;
put 'SASHELP=(';
PUT ' ''MVS:SASXXX.MYTEST.SASHELP''';
put ' ''MVS:SDC.SAS9CURR.ENW0.SASHELP''';
put ' )';
run;
// EXEC SAS92P,CONFIG='&&MYCONFIG'
//SYSIN DD *
proc options option=sashelp; run;
data _null_; set sashelp.tryit; put _all_; run;
data _null_; x=zipcity('96799'); put x=; run;
// EXEC SAS92P
//SYSIN DD *
proc options option=sashelp; run;
data _null_; x=zipcity('96799'); put x=; run;
In this example, an observation for 96799 is added, which is not currently in
SASHELP.ZIPCODE, but is a legitimate zip code for Pago Pago, American Samoa.
Type: | Usage Note |
Priority: | |
Topic: | SAS Reference ==> Functions ==> State and ZIP Code ==> FIPNAME SAS Reference ==> Functions ==> State and ZIP Code ==> FIPNAMEL SAS Reference ==> Functions ==> State and ZIP Code ==> FIPSTATE SAS Reference ==> Functions ==> State and ZIP Code ==> STFIPS SAS Reference ==> Functions ==> State and ZIP Code ==> STNAME SAS Reference ==> Functions ==> State and ZIP Code ==> STNAMEL SAS Reference ==> Functions ==> State and ZIP Code ==> ZIPCITY SAS Reference ==> Functions ==> State and ZIP Code ==> ZIPFIPS SAS Reference ==> Functions ==> State and ZIP Code ==> ZIPNAME SAS Reference ==> Functions ==> State and ZIP Code ==> ZIPNAMEL SAS Reference ==> Functions ==> State and ZIP Code ==> ZIPSTATE |
Date Modified: | 2011-03-17 09:42:58 |
Date Created: | 2011-02-11 10:10:10 |