Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


Using command-line arguments

You can pass arguments to a main program on the command line. The operating system calls main programs with a string that contains the arguments.

How the arguments are treated depends on whether you use the -host option of the cob2 command.

If you do not specify the -host option, command-line arguments are passed in native data format.

If you specify the -host option, Windows calls all main programs with an EBCDIC string that contains the command-line arguments. The length of the string is in big-endian format.

Example: command-line arguments

related tasks
Manipulating null-terminated strings
Handling null-terminated strings

related references
cob2 options


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)