SERVICE | NOSERVICE

Category

Error checking and debugging

Pragma equivalent

#pragma options(service) (C only), #pragma options(noservice) (C only)

Purpose

Places a string in the object module, which is displayed in the traceback if the application fails abnormally.

Syntax

Read syntax diagramSkip visual syntax diagramNOSERVSERV(string)

Defaults

NOSERVICE

Parameters

string
User-specified string of characters.

Usage

When the SERVICE compiler option is in effect, the string in the object module is loaded into memory when the program is executing. If the application fails abnormally, the string is displayed in the traceback.

For z/OS® XL C, if the SERVICE option is specified both on a #pragma options directive and on the command line, the option that is specified on the command line will be used.

You must enclose your string within opening and closing parentheses. You do not need to include the string in quotation marks.

The following restrictions apply to the string specified:
  • The string cannot exceed 64 characters in length. If it does, excess characters are removed, and the string is truncated to 64 characters. Leading and trailing blanks are also truncated.
    Note: Leading and trailing spaces are removed first and then the excess characters are truncated.
  • All quotation marks that are specified in the string are removed.
  • All characters, including DBCS characters, are valid as part of the string provided they are within the opening and closing parentheses.
  • Parentheses that are specified as part of the string must be balanced. That is, for each opening parentheses, there must be a closing one. The parentheses must match after truncation.
  • When using the #pragma options directive (C only), the text is converted according to the locale in effect.
  • Only characters which belong to the invariant character set should be used, to ensure that the signature within the object module remains readable across locales.

The usage status of this option is inserted in the object file to aid you in diagnosing a problem with your program.

IPA effects

If you specify the SERVICE option on the IPA compile step, or specify #pragma options(service) in your code, it has no effect on the IPA link step. Only the SERVICE option you specify on the IPA link step affects the generation of the service string for that step.

Predefined macros

None.