Microsoft KB Archive/40863

ACCEPT FROM COMMAND-LINE Operates Like CALL &quot;_MSCOMMAND&quot;

PSS ID Number: Q40863 Article last modified on 04-20-1993

3.00 3.00a | 3.00 3.00a MS-DOS | OS/2

Summary: The Microsoft COBOL Version 3.0 extension subroutine &quot;_MSCOMMAND&quot; replaces the extension “COMMAND” found in Microsoft COBOL Verions 2.x. The ACCEPT data-item FROM COMMAND-LINE statement also performs the same function. Either method is acceptable, and because the execution speed of both methods is virtually the same, the method of choice is a matter of preference. Below is an example of the ACCEPT FROM COMMAND-LINE method. For more information about the CALL &quot;_MSCOMMAND&quot; form, query the following keywords in this KnowledgeBase: CALL &quot;_MSCOMMAND&quot;

More Information: The command line used to invoke the program is stored in the data item ACCEPTed FROM the COMMAND-LINE. The program name is not included in the command line that is stored. More information can be found in the “Microsoft COBOL Version 3.0 Language Reference Manual” on Pages 3-87 and 3-96. The following are compile and LINK steps: COBOL example.cbl; LINK example; Run EXAMPLE.EXE as follows: EXAMPLE This is a test of command-line The program responds as follows: COMMAND LINE WAS this is the test of command-line The following is EXAMPLE.COB: $SET ANS85 WORKING-STORAGE SECTION. 01 COMM-LINE PIC X(80). PROCEDURE DIVISION. 000-MAIN. ACCEPT COMM-LINE FROM COMMAND-LINE. DISPLAY “COMMAND LINE WAS” COMM-LINE. STOP RUN.

Additional reference words: 3.00 3.00a Copyright Microsoft Corporation 1993.