SW461

Enter City/State/Zip Code/Country

Last Revised: 11/26/13

This program is a T Type external routine that can be used to maintain City, State, Zip Code, and Country fields of an address.  It is similar to SW460, but used when there is a separate COUNTRY field in the record in addition to the STATE field.  Specify SW461 as the T type external program for the field with a base name of CITY in the Data Dictionary.  The State, Zip, and Country fields should be omitted from the view, as SW461 will include this fields automatically.

The fields must have a base field name of CITY, STATE, ZIP, and COUNTRY, with an optional prefix that is the same for each field, i.e., SHIP2CITY, SHIP2STATE, SHIP2ZIP, SHIP2COUNTRY. Any prefix can be used.

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 SW461 will automatically assign the Canadian Province code to the STATE field, and CA to the COUNTRY field.

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

See SW460 when the record includes a STATE field, but not a COUNTRY field.

Also see SW022 for complete address validation and correction.

CALL "SW461", S039$, CM01$, X100$

SW461
Argument In/Out Usage
S039$ In Contains the field information for the CITY.
CM01$ In Record structure that includes fields with a base name of CITY, STATE, ZIP, and COUNTRY with an optional prefix.  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.