SW460

Enter City/State/Zip Code

Last Revised: 06/05/07

This program is a T Type external routine that can be used to enter a US Zip Code and assign and display the City and State fields based on the information from the Dynamo Zip Code database.  It can also be used to enter a Canadian Postal Code, City, and State/Country Code.  SW460 should be assigned to the CITY field in the Data Dictionary.  The State/Country and Zip fields should be omitted from the View, as SW460 will include those fields below the city field.

This program will prompt the user for the Zip/Postal code first.

If a 5 digit or 10 digit US Zip code is entered, then the zip code will be checked against the Dynamo Zip Code database file DYSW01.  If only one record exists in the Zip Code database, then the CITY and STATE fields will be assigned and displayed.  If multiple records exist, the user will be presented a list of the cities that include this zip code, and can select the desired city from the list.  If no matching records exist for the zip code entered, then the operator will be informed that the zip code is not valid.  The Zip Code database file is included in the Dynamo ZIP package.  Use the V menu option to see the date of this package.  The package is distributed quarterly to all systems that participate in the Excellware Priority Support Plan.

If a Canadian postal code is entered, in the format ANA NAN, then the operator can enter a city name, and should enter C1 as the state/country code.  The province name can be included in the Address Line if desired.

If no zip/postal code is entered, then the operator may enter a city and state code.

SW460 should be used when the STATE code is used for US state codes as well as a code for foreign countries.  Data File DISM00 contains the list of State and Country Codes and Names.

See SW461 when the record structure includes a COUNTRY code field in addition to the STATE code.

Also see SW022 for complete address validation and correction.

CALL "SW460", S039$, CM01$, X100$

SW460
Argument In/Out Usage
S039$ In Contains the field information for the CITY.
CM01$ In Record structure that includes fields named CITY, STATE, and ZIP.  A field named FOREIGN is optional, and if present will be set to an "F" for addresses that do not contain a valid US zip code.
X100$ In/Out The standard T type external routine control variable.  Refer to the documentation and example program CDX100 for additional details.

The following screen shot shows where you link the SW460 routine to a CITY field in the Data Dictionary.  Refer to Data Dictionary Maintenance (FMS) for additional information.

The following screen shot shows the list of cities for a US Zip code.