# DB2 z/OS use of the || characters to concatenate a string.

**URL:** <https://forums.toadworld.com/t/db2-z-os-use-of-the-characters-to-concatenate-a-string/38269>\
**Category:** Toad for IBM DB2\
**Created:** [August 30, 2016, 10:15am UTC](https://forums.toadworld.com/t/db2-z-os-use-of-the-characters-to-concatenate-a-string/38269 "2016-08-30T10:15:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![edward.j.spencer\_656](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@edward.j.spencer\_656](https://forums.toadworld.com/u/edward.j.spencer_656)\
**Post date:** [August 30, 2016, 10:15am UTC](https://forums.toadworld.com/t/db2-z-os-use-of-the-characters-to-concatenate-a-string/38269/1 "2016-08-30T10:15:49Z")

</div>

Has anyone run into this issue. Normally, using || between strings will concatenate them into a single string. However, when using Toad, the Characters do not seem to convert correctly and you get a -418 A STATEMENT STRING TO BE PREPARED CONTAINS AN INVALID USE OF PARAMETER MARKERS.

I know other ways around it, but I should not have to jump through hoops to get existing SQL that works on z/OS to work in Toad.

---

<div class="post-metadata">

**Author:** ![gianfranco.casati](https://avatars.discourse-cdn.com/v4/letter/g/8797f3/32.png) [@gianfranco.casati](https://forums.toadworld.com/u/gianfranco.casati)\
**Post date:** [August 30, 2016, 10:17pm UTC](https://forums.toadworld.com/t/db2-z-os-use-of-the-characters-to-concatenate-a-string/38269/2 "2016-08-30T22:17:03Z")

</div>

Hello,

ok, could be possible that exist a problem in Toad, and patch will be

released.

But, also remember that || is a SQL short cut of SQL statement CONCAT.

My suggest is try using syntax like followings:

SELECT DISTINCT

STRIP(DBNAME) CONCAT ‘.’ CONCAT STRIP(TSNAME)

FROM SYSIBM.SYSTABLES

WHERE NAME = ‘AAAAAA’ OR

NAME = ‘BBBBBB’;

SELECT

DISTINCT CONCAT(CONCAT(CONCAT(CONCAT(CONCAT(CONCAT(CONCAT(

’ SELECT ‘’’,STRIP(NAME)),’’’’),’, '),

STRIP(‘COUNT(\*) FROM’)),’ ‘),STRIP(NAME)),’;’)

FROM SYSIBM.SYSTABLES

WHERE CREATOR=‘my\_creator’ AND TYPE=‘T’;

* * *

Cordiali Saluti, Best Regards, Bonne Réception, Mit Freundlichen Gruessen,

Venlig Hilsen, Saludos, Atenciosamente, Pokà/Met Vriendelijke Groeten

Gianfranco Casati

Certified Senior IBM System Engineer

for: zOS, DB2zOS, TCPIP, CICS, MQ, RACF, TWS, DB2LUW

IT Security is a Smart Investment

* * *

The human mind is our fundamental resource.

John Fitzgerald Kennedy

USA President

Da: “edward.j.spencer\_656”

Per: ,

Data: 30/08/2016 19:18

Oggetto: [Toad for IBM DB2 - Discussion Forum] DB2 z/OS use of the ||

characters to concatenate a string.

DB2 z/OS use of the || characters to concatenate a string.

Thread created by edward.j.spencer\_656

Has anyone run into this issue. Normally, using || between strings will

concatenate them into a single string. However, when using Toad, the

Characters do not seem to convert correctly and you get a -418 A STATEMENT

STRING TO BE PREPARED CONTAINS AN INVALID USE OF PARAMETER MARKERS.

I know other ways around it, but I should not have to jump through hoops to

get existing SQL that works on z/OS to work in Toad.

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or Unsubscribe from Toad for IBM DB2 Forum notifications altogether.

Toad for IBM DB2 - Discussion Forum

Flag this post as spam/abuse.

---

<div class="post-metadata">

**Author:** ![Jeff\_Podlasek](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/jeff_podlasek/32/29_2.png) [@Jeff\_Podlasek](https://forums.toadworld.com/u/Jeff_Podlasek)\
**Post date:** [September 2, 2016, 1:31pm UTC](https://forums.toadworld.com/t/db2-z-os-use-of-the-characters-to-concatenate-a-string/38269/3 "2016-09-02T13:31:42Z")

</div>

This works file for me in Toad.

select name || ‘.’ || creator from sysibm.systables where CREATOR like ‘%POD%’

I would imagine that the error you are getting has to do with your computer’s region and language format and the code page in use in your DB2 subsystem on z/OS.

Just curious - what are those values?
