Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

(Argument '2' invalid error) when using POSSTR function - OS390 DB2 V7

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,
I am getting this message(Argument '2' invalid) and not able to solve it. I am
using OS/390 DB2 V7. The function does not allow me to specify a column name for the second argument. But DB2 V7 manual clearly states that A column name is supported for either or both arguments. Following is my test SQL
SELECT *
FROM CABCDEF.MYTABLE
WHERE POSSTR('RRCITIBANKRR',CO_NAME) <> 0
Thanks for your help.
 
My site have had confirmation in March from IBM that there is a bug in both the LOCATE function and the POSSTR function. You cannot use 2 column names(despite what the documentation says), 1 must be a literal string. Unless of course they have now released a fix.

We found it in UDB v7.2 on an AIX box
 
I think if you swap you POSSTR for LOCATE you will accomplish what you are after. Please see below for an example of something I have used in the past. Effectively with LOCATE and POSSTR as they currently stand you have only 1 column name and its position differs depending which function you use.

select r5n1.ins_ref_no, r5tt.let_id
from r5220_link r5n1, r5215_lett r5t5, r5200_lett r5tt
where (r5t5.fk_rl_s5c_rf_nmbr = r5n1.ins_ref_no) and
(r5tt.let_id = r5t5.fk_rl_s515_lttr_d) and
(r5n1.ins_ref_no = 8300) and (not 0 =
(select locate('C016', r5tt.let_id)
from sysibm.sysdummy1))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top