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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to start a UNIX shell script from a COBOL program?

Status
Not open for further replies.

gurthang

Programmer
May 28, 2002
2
DE
Hi,
I need to to call a UNIX Shell Script from a COBOL program.
Does anyone here know whether it is possible and how I have to do it?

If that isn´t possible, is there a possibility to start a SQL Script from COBOL in SQL*Plus?

Thanks for your help.
 
Hi,
01 wcommand pic x(80).

move "/pathtoscript/scriptname" to wcommand.
call "system" using wcommand.
 
Micro Focus Server Express allows you to use normal files. E.g:
Code:
select dinges assign to &quot;< ls -1  /tmp | wc -l&quot; 
              organisation line sequential
...
open input dinges
read dinges-rec
close dinges

In the record defined in the FD of &quot;dinges&quot; you'll get the number of files in /tmp.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top