by ykreddy » Sun Nov 28, 2010 1:23 pm
Thanks for your reply
I am supporting mainframe project having COBOL + DB2 program has the following SQL code
WORKING-STORAGE SECTION.
01 WS-MISC-AND-HOST-VARIABLES.
05 WS-Y PIC X(1) VALUE 'Y'.
05 WS-N PIC X(1) VALUE 'N'.
.
.
.
.
.
.
Procedure division.
EXEC SQL
SELECT
:WS-Y,B.NTWRK_IND,A.GRP_RULE_ID
INTO
:WS-GRP-RULE-IND,:WS-NTWRK-IND,:WS-GRP-RULE-ID
FROM
(SELECT GRP_RULE_ID
FROM Wgd.GRP_RULE
WHERE RULE_ID = :HS-UM-RULE-ID) A,
(SELECT NTWRK_IND, RULE_ID
FROM Wgd.RULE_CNTRCT
WHERE CNTRCT_CD = :WS-WS-CONTRACT-CD
AND STRT_DT = :WS-HS-BNFT-YR-CONTR-EFF-DTE) B
WHERE A.GRP_RULE_ID = B.RULE_ID
UNION ALL
SELECT
:WS-N,B.NTWRK_IND,:WS-BLANK
INTO
:WS-GRP-RULE-IND,:WS-NTWRK-IND,:WS-GRP-RULE-ID
FROM Wgd.RULE_CNTRCT B
WHERE B.RULE_ID = :HS-UM-RULE-ID
AND B.CNTRCT_CD = :WS-WS-CONTRACT-CD
AND B.STRT_DT = :WS-HS-BNFT-YR-CONTR-EFF-DTE
END-EXEC
But I'm not sure how it works
can we use host variables in select statement in cobol+db2 application program
Can you please tell how it possible
Regards,
Ykreddy
Thanks & Regards,
YK Reddy