What is wrong with this db2 delete using rexx

Lee Mandel

What is wrong with this db2 delete using rexx
Hello all,

I can not seams to find anything wrong with this delete statement, yet I
get -104
I am using rexx.

>>> "EXECSQL DELETE FROM ABC.ABCDEFGROUP WHERE DB2ID = 'DB9G', AND
GGROUP = 'GROUP1'"
+++ RC(-1) +++

323 *-* /**/
324 *-* /**/
325 *-* /**/
326 *-* ADDRESS TSO

327 *-* SAY 'SQLCODE = 'SQLCODE
>>> "SQLCODE = -104"
SQLCODE = -104


Lee


_____________________________________________________________________

* IDUG North America * Tampa, Florida, * May 10-14 2010 * http://IDUG.ORG/NA *
_____________________________________________________________________

http://www.IDUG.org membership is now free.
Do you have people in your office who are not an IDUG member?
Show them how to access the information and help train the next generation of DB2 Users!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's DB2-L

Binyamin Dissen

Re: What is wrong with this db2 delete using rexx
(in response to Lee Mandel)
On Fri, 29 Jan 2010 00:44:09 EST [login to unmask email] wrote:

:> I can not seams to find anything wrong with this delete statement, yet I
:>get -104
:>I am using rexx.

:>>>> "EXECSQL DELETE FROM ABC.ABCDEFGROUP WHERE DB2ID = 'DB9G', AND
:>GGROUP = 'GROUP1'"
:>+++ RC(-1) +++

:>323 *-* /**/
:>324 *-* /**/
:>325 *-* /**/
:>326 *-* ADDRESS TSO

:>327 *-* SAY 'SQLCODE = 'SQLCODE
:>>>> "SQLCODE = -104"
:>SQLCODE = -104

Is the comma supposed to be there?

--
Binyamin Dissen <[login to unmask email]>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel


Should you use the mailblocks package and expect a response from me,
you should preauthorize the dissensoftware.com domain.

I very rarely bother responding to challenge/response systems,
especially those from irresponsible companies.

_____________________________________________________________________

* IDUG North America * Tampa, Florida, * May 10-14 2010 * http://IDUG.ORG/NA *
_____________________________________________________________________

http://www.IDUG.org membership is now free.
Do you have people in your office who are not an IDUG member?
Show them how to access the information and help train the next generation of DB2 Users!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's DB2-L

Antonis Galaios

Re: What is wrong with this db2 delete using rexx
(in response to Binyamin Dissen)
I see a coma before AND. If that's written in your Rexx that's the error




________________________________

From: IDUG DB2-L [mailto:[login to unmask email] On Behalf Of
[login to unmask email]
Sent: Friday, January 29, 2010 7:44 AM
To: [login to unmask email]
Subject: [DB2-L] What is wrong with this db2 delete using rexx



Hello all,



I can not seams to find anything wrong with this delete statement, yet
I get -104

I am using rexx.



>>> "EXECSQL DELETE FROM ABC.ABCDEFGROUP WHERE DB2ID = 'DB9G', AND
GGROUP = 'GROUP1'"
+++ RC(-1) +++

323 *-* /**/
324 *-* /**/
325 *-* /**/
326 *-* ADDRESS TSO

327 *-* SAY 'SQLCODE = 'SQLCODE
>>> "SQLCODE = -104"
SQLCODE = -104





Lee




________________________________

IDUG - The Worldwide DB2 User Community!
< http://www.idug.org/db2-north-america-conference/index.html >

The IDUG DB2-L Listserv is only part of your membership in IDUG. If you
are not already an IDUG member, please register here.
< http://www.idug.org/register >


P Think before you print.

Disclaimer:
This e-mail is confidential. If you are not the intended recipient, you should not copy it, re-transmit it, use it or disclose its contents, but should return it to the sender immediately and delete the copy from your system.
EFG Eurobank Ergasias S.A. is not responsible for, nor endorses, any opinion, recommendation, conclusion, solicitation, offer or agreement or any information contained in this communication.
EFG Eurobank Ergasias S.A. cannot accept any responsibility for the accuracy or completeness of this message as it has been transmitted over a public network. If you suspect that the message may have been intercepted or amended, please call the sender.


_____________________________________________________________________

* IDUG North America * Tampa, Florida, * May 10-14 2010 * http://IDUG.ORG/NA *
_____________________________________________________________________

http://www.IDUG.org membership is now free.
Do you have people in your office who are not an IDUG member?
Show them how to access the information and help train the next generation of DB2 Users!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's DB2-L

Mick P Graley

Re: What is wrong with this db2 delete using rexx
(in response to Antonis Galaios)
I'm guessing the comma before AND is for REXX continuation onto a new line
as this statement doesn't fit into 72 columns.
I would add a double quote (") before the comma and another one before the
AND on the next line.
This is the correct way to continue a string in REXX.

Cheers,

Mick.





From: [login to unmask email]

To: [login to unmask email]

Date: 29/01/2010 05:47

Subject: [DB2-L] What is wrong with this db2 delete using rexx






Hello all,

I can not seams to find anything wrong with this delete statement, yet I
get -104
I am using rexx.

>>> "EXECSQL DELETE FROM ABC.ABCDEFGROUP WHERE DB2ID = 'DB9G', AND
GGROUP = 'GROUP1'"
+++ RC(-1) +++

323 *-* /**/
324 *-* /**/
325 *-* /**/
326 *-* ADDRESS TSO

327 *-* SAY 'SQLCODE = 'SQLCODE
>>> "SQLCODE = -104"
SQLCODE = -104


Lee





(Embedded image moved to file: pic01782.jpg)IDUG - The Worldwide DB2 User
Community!


The IDUG DB2-L Listserv is only part of your membership in IDUG. If you are
not already an IDUG member, please register here.





_____________________________________________________________________

* IDUG North America * Tampa, Florida, * May 10-14 2010 * http://IDUG.ORG/NA *
_____________________________________________________________________

http://www.IDUG.org membership is now free.
Do you have people in your office who are not an IDUG member?
Show them how to access the information and help train the next generation of DB2 Users!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's DB2-L

Roy Boxwell

Re: What is wrong with this db2 delete using rexx
(in response to Mick P Graley)
Continue your REXX like this

Command ===>
000176 aa = Left(dsname,Length(dsname)-4) ;
000177 dsmtst = aa!!".G%" ;
000178 ADDRESS EXECSQL "DECLARE C1 CURSOR FOR ",
000179 "SELECT DBNAME, TSNAME, DSNAME ",
000180 "FROM SYSIBM.SYSCOPY ",
000181 "WHERE DSNAME LIKE '"dsmtst"'",
000182 "ORDER BY DSNAME" ;
000183
000184 sql_RC = Check_sqlcode("DECLARE CURSOR") ;






Roy Boxwell
SOFTWARE ENGINEERING GMBH
-Product Development-
Robert-Stolz-Straße 5
40470 Düsseldorf/Germany
Tel. +49 (0)211 96149-675
Fax +49 (0)211 96149-32
Email: [login to unmask email]
http://www.seg.de

Software Engineering GmbH
Amtsgericht Düsseldorf, HRB 37894
Geschäftsführung: Siegfried Fürst, Gerhard Schubert

_____________________________________________________________________

* IDUG North America * Tampa, Florida, * May 10-14 2010 * http://IDUG.ORG/NA *
_____________________________________________________________________

http://www.IDUG.org membership is now free.
Do you have people in your office who are not an IDUG member?
Show them how to access the information and help train the next generation of DB2 Users!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's DB2-L

Lizette Koehler

Re: What is wrong with this db2 delete using rexx
(in response to Roy Boxwell)
When continuing lines in REXX you need to have all of the statement within
the double quotes followed by a comma and

the next line needs to start with double quotes, the remainder of the REXX
line ending in double quotes



For your line



"EXECSQL DELETE FROM ABC.ABCDEFGROUP WHERE DB2ID = 'DB9G', AND
GGROUP = 'GROUP1' "



It should be





"EXECSQL DELETE FROM ABC.ABCDEFGROUP WHERE DB2ID = 'DB9G', AND " ,
" GGROUP = 'GROUP1' "



REXX can go for the length of the line in your LRECL. It is a no-number
dataset. I personally keep my REXX code within 72 cols just for
convenience.



HTH



Lizette




_____________________________________________________________________

* IDUG North America * Tampa, Florida, * May 10-14 2010 * http://IDUG.ORG/NA *
_____________________________________________________________________

http://www.IDUG.org membership is now free.
Do you have people in your office who are not an IDUG member?
Show them how to access the information and help train the next generation of DB2 Users!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's DB2-L

Don Leahy

Re: What is wrong with this db2 delete using rexx
(in response to Lizette Koehler)
If you are using the ISPF Editor, the HILITE REXX command can be a big
help.

The comma, when used for continuation, should show up green. If if is
white, then Rexx is interpreting it as part of your quoted literal.

I use this all the time to help me keep my quotes and apostrophes in order.


< http://www.idug.org/register >

_____________________________________________________________________

* IDUG North America * Tampa, Florida, * May 10-14 2010 * http://IDUG.ORG/NA *
_____________________________________________________________________

http://www.IDUG.org membership is now free.
Do you have people in your office who are not an IDUG member?
Show them how to access the information and help train the next generation of DB2 Users!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's DB2-L