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!

CAN A CALL BE CLEARED? 1

Status
Not open for further replies.

krickb

Programmer
Nov 19, 2003
11
US
My appologies for repeating myself..I am reposting this with a better subject line.

I am having a problem with a cobol program issuing commands to Unix.

Here are the commands in the cobol program:

CALL "SYSTEM" USING 'cp /mydir/MYFILE1 MYFILE2'
CALL "SYSTEM" USING 'lp -d myprinter_2 /mydir/FILE.TXT'

The cobol program then returns this error:


lp: can't access file "/mydir/FILE.TXTydir/MYFILE2'"


This indicates to me that the first CALL to "SYSTEM"
is being concatentated with the second CALL to "SYSTEM'.
Is there a way to clear the first CALL after it has been performed?
Thanks for any suggestions.
KRICKB
 
I've seen this myself. I found a workaround -- not sure its been several years but--

Try this (DO NOT REPLACE THE STRING WITH A MOVE)

01 WS-SYSTEM-COMMAND PIC X(256) VALUE SPACES

MOVE SPACES TO WS-SYSTEM-COMMAND.
STRING "command text" INTO WS-SYSTEM-COMMAND.
CALL "SYSTEM" USING WS-SYSTEM-COMMAND.

MOVE SPACES TO WS-SYSTEM-COMMAND.
STRING "second command text" INTO WS-SYSTEM-COMMAND.
CALL "SYSTEM" USING WS-SYSTEM-COMMAND.

Again not sure on this one, all my cobol stuff is archived to 9-TRACK. If this dont work email me at jplubell3619@hotmail.com. I wrote a file manegment app in ACUCOBOL back in the late 90's that used extensive system call like the ones your working on and it to was in UNIX
 
Sorry;

The compiler was Acucobol 2.1 running on SCO (Not sure
on revision)

I noticed this same problem in DOS using the same
version of the compiler. I know that the code look redundent -- but it works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top