United States ZIP Code (%USZIP) Macro

Applies to ReadyAPI 3.52, last modified on April 18, 2024

The United States ZIP Code macro is used to insert United States ZIP codes into the strings generated by a data source using the Custom String data generator.

The macro is an analog of the United States ZIP Code data generator.

Syntax

The macro has the following syntax:

%USZIP(CodeFormat)

Parameters

CodeFormat

Specifies the format of the ZIP codes that will be generated.

Available values of the parameter:

  • XXXXX – generates five digits ZIP codes.

  • XXXXX-XXXX – generates ZIP+4 codes.

  • All – Default. Generates five digits ZIP and ZIP+4 codes.

The parameter is case-sensitive.

Examples

The following examples demonstrate how to use the United States ZIP Code macro:

  • ZIP Code: %USZIP(All)

    Example: United States ZIP Code macro in Data Generator

    Click the image to enlarge it.

    Generates a string containing a ZIP code in the XXXXX or XXXXX-XXXX format.

  • %USZIP(XXXXX-XXXX)

    Generates ZIP+4 codes.

  • %USZIP(xxxxx) <- Invalid value

    The parameter is case-sensitive, so ReadyAPI will not parse the custom string.

Remarks

For more information on adding macros to custom strings, see About Custom String Generator.

For more information on general rules used for specifying macro parameters, see Custom String Generator Rules.

See Also

United States ZIP Code Generator
Custom String Generator
Macro Reference

Highlight search results