Chapter Contents

Previous

Next
Run-Time Argument Processing

Types of Run-Time Arguments

When you run a C program under CMS or the UNIX System Services (USS) shell, data are passed to the C program and the library as the part of the command line that follows the command name; the command name is used as the program name and is passed in argv[0] . This is also true in TSO if you use the optional support for invoking a C program from the DDname CPLIB. (See Executing C Programs.) If you use the TSO CALL command or OS/390 batch JCL to invoke a C program, the PARM string corresponds to the command line. The command line normally consists of a number of tokens separated by space such as blanks, tabs, and so on. The tokens fall into these five classes:

Tokens of the various types can be intermixed in the command line.

Arguments containing blanks can be passed to the program by enclosing the argument in quotation marks, as in the following example:

"abc "

The normal C escape sequences such as \0 and \n can be used within quoted tokens. (Octal or hexadecimal escape sequences cannot be used.) On terminals without a backslash character (\), the cents sign (¢) can be substituted for the backslash.

Run-time library options and redirections can also be defined in the program source code. Subsequent sections provide details on how to do this.


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.