Published on :
Data Manipulation CREATION_INTERNE

Using the ZIPCITY function

This code is also available in: Deutsch Español Français
Awaiting validation
This script creates a temporary SAS© table named ZIP_DET. It inserts a postal code (60607) via a DATALINES statement and uses the native ZIPCITY function to derive the corresponding city name. The result is then displayed in the output report.
Data Analysis

Type : CREATION_INTERNE


The data (postal code) is directly integrated into the source code via the DATALINES statement.

1 Code Block
DATA STEP Data
Explanation :
DATA step creating the ZIP_DET table. It reads the postal code as input and calculates the 'zip_city' variable using the ZIPCITY function.
Copied!
1DATA ZIP_DET;
2 INPUT zipcode;
3 zip_city=zipcity(zipcode);
4 DATALINES;
560607
6;
2 Code Block
PROC PRINT
Explanation :
PRINT procedure used to display the 'zip_city' variable resulting from the transformation.
Copied!
1PROC PRINT;
2 title "Output of ZIPCITY function usage in SAS";
3 var zip_city;
4 
5RUN;
6QUIT;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.