COMMAND-LINE-LINKAGE

Enables you to call a program and pass the command line to the main program as a parameter to be accessed via the Linkage Section.

Syntax:

>>-.---.--.----.-COMMAND-LINE-LINKAGE-----------><
   +-/-+  +-NO-+

Parameters:

None.

Properties:

Default: NOCOMMAND-LINE-LINKAGE
Phase: Syntax check
$SET: Initial
IDE equivalent None

Example:

When using this directive, the command line will be passed to the main program using the following parameter structure:

Linkage section. 
01 CommandLinePass. 
   03 CommandLineLen pic 9(4)comp. 
   03 CommandLine pic x(256).

CommandLineLen contains the length of the parameters being passed and CommandLine contains the actual arguments being passed. The following is a simple example of it in use:

...
Procedure Division Using CommandLinePass.
Display "Command Line = " CommandLine(1:CommandLineLen).
... 

Comments:

This directive can only be used on the top-level program in a COBOL run-unit; it will have no effect in cases where it is not specified in the top-level program.