From: gaya3 on
Hi,

Is there any way to call a AIX shell script from IBM AIX COBOL? Could
someone give me the link to the syntax/examples? Also, Is there a way
to call system commands like "Echo 123" etc. using COBOL.

It would be very helpful for me if syntax/examples are provided.

Thanks!
gaya3
From: Anonymous on
In article <42898ffb-c829-489a-b366-18aec7e0d436(a)1g2000vbm.googlegroups.com>,
gaya3 <gayathri.kalyanasundaram(a)wipro.com> wrote:
>Hi,
>
>Is there any way to call a AIX shell script from IBM AIX COBOL?

This 'smells' like homework/'do my job for me' but I'll follow up,
anyhow.

Please be so kind as to supply a few of the attempts you've made so far to
do this so that your work is not duplicated; after someone has seen the
paths that have failed they might have a good suggestion for one that
might be successful.

DD
From: Richard on
On Dec 16, 1:09 am, gaya3 <gayathri.kalyanasunda...(a)wipro.com> wrote:
> Hi,
>
> Is there any way to call a AIX shell script from IBM AIX COBOL? Could
> someone give me the link to the syntax/examples? Also, Is there a way
> to call system commands like "Echo 123" etc. using COBOL.
>
> It would be very helpful for me if syntax/examples are provided.


It is possible that you could do this via a

CALL "system" USING "sh scriptname" & x"00"

or something similar, but this will depend on the implementation of
the compiler and I am unfamiliar with that one.

From: e p chandler on
On Dec 15, 7:09 am, gaya3 <gayathri.kalyanasunda...(a)wipro.com> wrote:
> Hi,
>
> Is there any way to call a AIX shell script from IBM AIX COBOL? Could
> someone give me the link to the syntax/examples? Also, Is there a way
> to call system commands like "Echo 123" etc. using COBOL.
>
> It would be very helpful for me if syntax/examples are provided.
>
> Thanks!
> gaya3

The first question should not be HOW but WHY? (Unless you are porting
from MicroFocus).

Why go out of process to run a shell script when you more easily could
do whatever you want to do within a shell script first? If needed,
redirect output to a file, then read the file from Cobol.

See http://www-01.ibm.com/software/awdtools/cobol/aix/library/

Read the section of Chapter 26 on calling C/C++ programs. Be prepared
to shoot yourself in the foot .... multiple times.



From: gaya3 on
On Dec 15, 12:29 pm, Richard <rip...(a)Azonic.co.nz> wrote:
> On Dec 16, 1:09 am, gaya3 <gayathri.kalyanasunda...(a)wipro.com> wrote:
>
> > Hi,
>
> > Is there any way to call a AIX shell script from IBM AIX COBOL? Could
> > someone give me the link to the syntax/examples? Also, Is there a way
> > to call system commands like "Echo 123" etc. using COBOL.
>
> > It would be very helpful for me if syntax/examples are provided.
>
> It is possible that you could do this via a
>
>    CALL "system" USING "sh scriptname" & x"00"
>
> or something similar, but this will depend on the implementation of
> the compiler and I am unfamiliar with that one.


Nopes.. This is not any kind of assignment.. I know that we can invoke
system commands using C / C++. When i searched the internet, i could
not find anything similar for COBOL. Ofcourse, there are pages where
COBOL calls C/C++ and C/C++ intern invoke system commands. I dont want
to do that. Let us say, i want to extract the uid using aix ibm cobol
code. How to do this? One more thing, I did search a lot for the
solution and am coming to this forum as the last resort. Also, I tried
using CALL "system" ... The said command is applicable only for MF
cobol and not for IBM AIX cobol. Please correct if wrong and also,
please let me know how to call system commands from cobol code. It
must be possible to call shell scripts from cobol. I just want to know
how it is done!