We help IT Professionals succeed at work.

Clear QSH message screen.

Theo Kouwenhoven
on
Medium Priority
30 Views
Last Modified: 2019-11-28
Hi Experts,

I created a command (and CLLE program), that run a QShell command.
The return is an error (as expected) + "Press ENTER to end terminal session."
That's great because I need that :-)

Now I run the same command a second time, and the screen is shown again, with a new message, but also the old message.
I like to get of the first message (and all messages before)
How can I do that?

The QShell programcommand that is executed is: createWebServicesServer.sh

BTW It's not the QSH screen I assume, beause, when I run QSH, the screen is blank.

Thanks
Comment
Watch Question

Gary PattersonVP Technology / Senior Consultant
CERTIFIED EXPERT

Commented:
I am not sure what you are asking.  QSH error handling from Cl can be complicated.

My recommendation is to write qsh scripts, and do your error handling there, then control the response to the calling CL program by setting an exit code, and, optionally, setting an environment variable that can be read in the calling program.

Here are some is a good resource and sample code for QSH / CL error handling:

http://www.code400.com/forum/forum/iseries-programming-languages/rpg-rpgle/7142-qsh-error-trapping

You may also want to look at Scott Klement's "unixcmd" tool - it provides based mechanism for handling errors:

http://www.scottklement.com/unixcmd/
Theo KouwenhovenApplication Consultant
CERTIFIED EXPERT

Author

Commented:
Hi Gary,

At the end of the execution of a script it shows the output (result), that is great because I need that,
but on the same screen are the results of all scripts executed earlier on this session.
I don't like to see them!!!
See example, in this case I only like to see:
IWS00102I - Command completed successfully.  
Press ENTER to end terminal session.          

Screenshot.png