GsZ4Changed - geostan_1 - 2024.01

GeoStan Geocoding Suite Reference for Windows, Linux, and z/OS

Product type
Software
Portfolio
Locate
Product family
GeoStan Geocoding Suite
Product
GeoStan Geocoding Suite > GeoStan
Version
2024.01
Language
English
Product name
GeoStan
Title
GeoStan Geocoding Suite Reference for Windows, Linux, and z/OS
Copyright
2024
First publish date
1994
Last updated
2024-07-29
Published on
2024-07-29T23:01:18.924000

Determines if the USPS changed a ZIP + 4 address definition since GeoStan last processed the record.

Syntax

GsFunStat GsZ4Changed (GsId gs, pstr pZip, pstr pZip4, pstr pDate);

Arguments

GsIdgs   ID returned by GsInitWithProps() for the current instance of GeoStan. Input.

pstrpZip   First five digits of the 9-digit ZIP Code to test. Input.

pstrpZip4   Last four digits of the 9-digit ZIP Code to test. Input.

pstrpDate   Date of the GeoStan ZIP + 4 information file used to process the record, in the format MMYYYY (for example, 081998). Input.

Return Values

GS_ERROR   Usually occurs when GeoStan could not load the GSL file, because:

n GeoStan could not find the GSL file in the path

n The GSL file was a different release level than the GSD file.

GS_Z4_CHANGE

GS_Z4_NO_CHANGE

Prerequisites

GsInitWithProps()

Notes

For ZIP4Change to work, the GeoStan GSL file must be in a directory listed in the GS_INIT_DATAPATH initialization property of the property list that you pass when calling GsInitWithProps. The Z4Change file, which is generated by the USPS, contains a record for every ZIP + 4 in the country. Each record contains twelve flags that represent the last twelve months, starting with the current release date. Each of these flags has a value of either True or False, indicating if the ZIP + 4 changed for that monthly postal release. The GeoStan GSL file incorporates this information, which GsZ4Changed references.

Z4Change information is valuable to users who process very large address lists frequently. As you process each record, you can call GsZ4Changed and quickly tell if the record needs reprocessing. This information can help you quickly identify only those records that need reprocessing.

Your application must store the date of the GeoStan GSL file used to process a record. GeoStan uses this date as the GsZ4Changed pDate input parameter. This is the same date printed on the GeoStan DVD used for record processing, and is one month later that the release date of the USPS files used on the GeoStan DVD.

Use the following code example if you are unsure of the release date. You should run this code when standardizing a batch of records and store the resulting date string as input to GsZ4Changed in future processing runs.

Example

intsu postalDate;
int month, year;
char z4ChangeDate[7];
/* Get the postal release of the current files. */
GsFileStatus ( gs,"", &postalDate );
month = ((postalDate % 384) / 32) + 1;
year = (postalDate/384) + 1990;
/* Add one month to this date so it matches what is printed on the CD. */
if ( month !=12 )
 {
 ++month;
 }
else
 {
 ++year;month = 1;
 }
/* Print the month and year to the date string in the format MMYYYY. */
sprintf( z4changedate, "%02d%d", month, year );