DB2 SQL: How to check Host-variables (1 of 2)

I have got an interesting topic on DB SQL WHERE clause. The below way of SQL improves DB2 performance. The below query tells how to use ARRAY of variables in ‘IN’ list.

Ex:  

WHERE  ABS_TD  IN (:WS-LIST)

Let’s assume WS-LIST has (A,B,C,D), then cursor will fetch all matching results into result table. The fetch executes one by one row.

Here, we need to make sure, the data type of subordinate item (WS-LIST), should be DCLGEN data type.

Ex: 

05 WS-LIST Redefined WS-LIST-INP1

                 10 LIST-ONE  PIC  s9(4) COMP.

Related Posts

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.

Comments are closed.