Operating System - HP-UX
1839067 Members
3069 Online
110135 Solutions
New Discussion

Call 'system' is bringing garbage to the screen.

 
Dee_3
Regular Advisor

Call 'system' is bringing garbage to the screen.

I have a programmer that is executing a system call in COBOL. When the user types ahead, they get garbage on the screen. Here's what she's tried already: In my Cobol program I do a CALL "SYSTEM" USING some-command "N". The problem is during these CALL "SYSTEM" the user is typing ahead and garbage gets on my screen.

I tried changing the Repaint Screen flag at the end to "Y" and it flickered, way too much to be useful.

I am thinking can I put something into the actual Unix command that would redirect the INPUT to a file or something, sort of how we redirect output 1>/dev/null 2>/dev/null.

All the CALL "SYSTEM" commands were redirecting input already with the
>/dev/null
on it, so I put them all back in but one. What we have is the call to system is running a script CALL "SYSTEM" USING WS-CMD where WS-CMD is a script-name. Inside this script is this command
cp /JDIS/PARTS/$1 /JDIS/WEB/docs/parts/$1 >/dev/null 2>/dev/null

We need to use a script because /JDIS/WEB/docs/parts has special permissions (because this is where the browser can look into) so to copy something in there,
the script has to have the same permissions as the /JDIS/WEB/docs directory
to get this to work.

I tried to redirect the
CALL "SYSTEM" using WS-CMD "N"
where WS-CMD is "script-name >/dev/null"
but that didn't work. Then we tried to run it in background like this
CALL "SYSTEM" using WS-CMD "N"
where WS-CMD is "script-name &l"

Then we tried to run it in background by changing the command in the script to
cp /JDIS/PARTS/$1 /JDIS/WEB/docs/parts/$1 & >/dev/null 2>/dev/null

Neither worked.

I did just change the Repaint Option from "N" to "Y" for this one command and now the
flickering is minimal (still there, but not as bad). We'll have to see if we must find a way to fix it further - but it is a step in the right direction.
Any suggestions would be appreciated!
Thanks, Terri Christensen.
3 REPLIES 3
harry d brown jr
Honored Contributor

Re: Call 'system' is bringing garbage to the screen.

Have you tried to set -echo in stty?

live free or die
harry
Live Free or Die
A. Clay Stephenson
Acclaimed Contributor

Re: Call 'system' is bringing garbage to the screen.

Hi Terri:

My cut at this would be to call a small c program to flush the input/output buffers before calling your actual routine. You could even call it after your routine as well.

Compile it like this:

cc -Ae flush.c -o flush

Regards, Clay
If it ain't broke, I can fix that.
Dee_3
Regular Advisor

Re: Call 'system' is bringing garbage to the screen.

Thank you for the suggestions. I forwarded them to the programmer for her use. Thanks again, Terri.