Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PC COBOL to Command Line

Status
Not open for further replies.

CliveC

Programmer
Nov 21, 2001
1,222
0
0
US
Using the command line opens up lots of possiblities
(thread209-1051561). It might be useful to make a faq of how different compilers pass commands to the command line.

I would be glad to compile the list if people with different compilers would post their methods.



Clive
 
Clive,

You get the information directly from the RM/COBOL User's Guide, which you may download here. See CALL "SYSTEM" at the end of Appendix F.

Tom Morrison
 
Hi Clive,

my Compiler is ACUCOBOL. The command for the command-line is

call "c$system" using parameter

The parameter is a field in the working-storage.

Example for start the internet-explorer:

Working-Storage-Section.
01 system-command-line.
03 my-browser pic x(45) value
"c:\programme\Internet Explorer\iexplore.exe"
03 filler pic x value spaces.
03 my-html-file pic x(40).

Procedure-Division.
call "c$system" using system-command-line

Regards

Helmut
 
In MF-Cobol:
CALL "SYSTEM" USING Null-Terminated-Command-Line

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Not the same environment, but with AS400 COBOL and ILE-COBOL you can just call almost any program directly.

For the situations where you can't, then the creation of a CL program is the easy solution.
Alternatively one can call "qcmdexc" with is the equivalent of the call "system" or call "c$system" from other PC compilers.
Very easy and you can get parameters passed back if needed.




Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Clive,

With Fujitsu Cobol version 6 (& 7 ??);

SPECIAL-NAMES
ARGUMENT-NUMBER IS mnemonic-name-1
ARGUMENT-VALUE IS mnemonic-name-2.

PROCEDURE-DIVISION.
ACCEPT identifier-1 FROM mnemonic-name-1

returns the total count of command line arguments,

ACCEPT identifier-2 FROM mnemonic-name-2

returns the first command line argument, the next "accept .. from mnemonic-name-2" returns the next command
line argument in sequence, ect.ect.


Steve
 
FYI -
The Accept/Display Argument-Value/Number

method is supported by *ALL* X/Open conforming compilers.

(Certainly Micro Focus supports it - but I would suspect that RM and AcuCOBOL also have this as an *option*).

Bill Klein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top