× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 3/9/11 8:00 AM, Robert Rogerson wrote:
<<SNIP>>

For another example, say I create a table as a work file in QTEMP.
When the job runs in batch in runs fine. But if I want to debug the
program interactively and I run it a second time (without first
dropping the table) it will fail when trying to create the table
which already exists.

As a script, not a program, the interactive job can mimic the batch job by signoff\signon [to avoid having to do the cleanup nor already coded in another script]. As a program, check the SQLCODE or SQLSTATE and react.

I'm aware there are many ways around this, I'm really just wondering
how others get around the situation where an IF EXISTS would fit
perfectly. In CL we could CrtPf or CrtDupObj with a MonMsg after to
trap the situation where the file already exists.

MONMSG in a CLP or CLLE, but not in a CL script; i.e. like the SQL script processor, the CL script processor is effectively limited to the error-level beyond which messages will no longer be ignored. So... Use a programming language instead of the limited scripting environment that supports only the SQL statements and no supporting coded logic. REXX is often a good choice, and it could even be used as a generic single-statement processor [very much better than can the RUNSQLSTM with its line limitations] which sends an escape message [even SQLCODE as SQL#### message] or sets a testable condition\code, to\for the invoker which could be a program or a script.

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.