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 calling the following program from the command line, you can supply a parameter after the program name, which will be passed to the main program using the Linkage section.

       $set COMMAND-LINE-LINKAGE	      
	       Linkage section. 
		      01 CommandLinePass. 
   			    03 CommandLineLen pic 9(4) comp. 
   			    03 CommandLine pic x(256).

        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.