Topic
  • No replies
SystemAdmin
SystemAdmin
260 Posts

Pinned topic Embedded SQL Select Statement with LIKE parameter in CICS cobol program

‏2007-09-27T12:09:18Z |
Hi we are trying to do a multi line fetch from a DB2 table using Like parameter. The customer id is a host variable and it gets values passed from the screens thru commarea. The data comes in 'C%%%' where customer id is length of 4 varchar. When we execute it in cobol with display statements it works fine with host variable. But the same program when it gets invoked from a CICS it is giving us sql code error 100(record not found).
EXEC SQL
DECLARE CUR1 CURSOR FOR
SELECT CUSTOMERID,COMPANYNAME,INDUSTRY,EMAIL,PHONE,FAX, REGISTEREDDATE,ADDRESS1,ADDRESS2,CITY,STATE,PINCODE,
STATUS FROM LAP_CUSTOMER
WHERE CUSTOMERID LIKE :CUSTOMERID
END-EXEC.

We would like to know how we can do a search in cics cobol.
thanks!