UNIX commad in COBOL


 
Thread Tools Search this Thread
Top Forums Programming UNIX commad in COBOL
# 1  
Old 02-13-2013
UNIX commad in COBOL

Hi guys,

i used the call "sytem" using ... in a cobol program.

At the moment i stoped at an empasse, how cam I retrive the execution's result of unix command?

Explenation, I made an 'pwd' command, and I must to have the directory inside the program.

How can have this result?
# 2  
Old 02-13-2013
Redirect the output of the command to some file and then read the file:
Code:
01 WA-COMMAND PIC X(100)
     VALUE "command > /path/to/some_file 2>&1".
....
....
CALL "SYSTEM" USING WA-COMMAND.
....
....
<CODE TO READ THE FILE>
....
....

# 3  
Old 02-13-2013
I just used this method.

My problem now is to have the result of the pwd command (directory name) in the program, because I have to use this value in the program for make other consideratione.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Ms COBOL 2.2 for SCO UNIX

HI ALL, I'm searching Ms Cobol 2.2 for Sco Unix if anyone has it please kind enough to support me... Thanks in advance Rukshan:) (2 Replies)
Discussion started by: rukshan4u2c
2 Replies

2. Programming

UNIX system call in COBOL

Hi, The UNIX system call inside the COBOL program is doing the specified command correctly. MOVE W080-UNZIP-FILE-COMMAND TO W080-OUTPUT-COMMAND CALL "SYSTEM" USING W080-OUTPUT-COMMAND RETURNING W080-SYS-CALL-STATUS BUT The problem is, the following keeps on showing on the log file... (2 Replies)
Discussion started by: joyAV
2 Replies

3. Programming

Acceessing DB2 UDB in AIX COBOL on unix

Hi , We are migrating our database from DB2 z/os to DB2 UDB on UNIX. and cobol on mainframes to AIX cobol on UNIX. We have some cobol Db2 programs that are accessing different Databases how do we code such type of programs in AIX cobol. Do we need to Establish connection for accessing... (0 Replies)
Discussion started by: nal.satish
0 Replies

4. Shell Programming and Scripting

Calling script from RM cobol and returning value to cobol

Is there a way you can return a value from a script that is called from a rm cobol program... 01 WS-COMD-LINE-PGM X(39) value sh ./getUserId.sh 12345" 01 WS-RETURN-SYS-CODE PIC 9(8). CALL "SYSTEM" USING WS-COMD-LINE-PGM GIVING WS-RETURN-SYS-CODE. ... (1 Reply)
Discussion started by: pavanmp
1 Replies

5. Programming

cobol crn programme run on express cobol as .gnt

can i run .crn programme in express cobol which support to .gnt programme .... Plz tell me solution (2 Replies)
Discussion started by: bibi
2 Replies

6. UNIX for Dummies Questions & Answers

help with ls commad

hi I want to display the latest file in script. say for example file.txt1 file.txt2 file.txt3(latest) in the script var1=`ls -ltr file.txt* | tail-1` echo $var1 This is what i am using. But this says that file.txt*: No such file or directory To the same script if I pass... (5 Replies)
Discussion started by: ammu
5 Replies

7. Shell Programming and Scripting

how to call to unix through cobol

hi everyone i want to run a script in unix through cobol program does anyone know how shell i do this ? please please help me here thanks (8 Replies)
Discussion started by: naamas03
8 Replies

8. UNIX for Dummies Questions & Answers

Newbie's question about COBOL Installation in Unix

I wanna to install a COBOL on the AIX unix server. Would u like to tell me the disk usage of COBOL installation? Thanks in advance. (2 Replies)
Discussion started by: GCTEII
2 Replies

9. UNIX for Dummies Questions & Answers

Cobol On Unix

Hi , Could anyone please tell me about the whole procedure for compiling, linking the cobol program on unix platform. As i am mainframe guy and very new to unix, any help will be very appriciated, Regards, -Vinit (2 Replies)
Discussion started by: vinit_cyberguy
2 Replies

10. Solaris

Cobol linking in Unix

I'm trying to call a C mod from COBOL but I'm currently having difficulty linking my COBOL program with a C module that I've just developed. I've tried using cbllink -v -l -k -BSF CMPCACVN.cbl test.lib but I've got an error that states cbllink: not found. I've also tried using buildclient -C -w -o... (0 Replies)
Discussion started by: soulfactory2002
0 Replies
Login or Register to Ask a Question