|
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
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
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.