Had help with parts of this recently but can't get to the end result.
I have a Routine which reads a list, passes the list to a parameter in string format, and a Job which trys to use this parameter in a WHERE clause in a DB2 SQL Query. Here are the specifics:
The Routine is as follows:
Code: Select all
Ans = ""
OpenSeq FoundationPoliciesFile to fFoundationFile
Then
Loop
While ReadSeq Line from fFoundationFile
Ans<-1> = Line;
Repeat
Convert @FM To ',' In Ans
CloseSeq fFoundationFile
End
Else
Call DSLogWarn("Unable to open file.", "FoundationPoliciesFile")
End
RETURN(Ans)
Code: Select all
db2testing..JobControl (@Routine_Activity_12): Routine DSU.srCPCFoundationPolicies did not finish OK, return code = ''0136530000','0322430008','0414643009','0532516008''
The SQL code ran in the DB2 stage is as follows:
Code: Select all
SELECT CTR_POL_NUM, CTR_RSA_TOT_PREM
FROM DMIDBO.CTR_TRANSACTION
WHERE
CTR_POL_NUM IN ( #FNDPolicyList# ) and
CTR_SOURCE_SYSTEM IN ( 'HC' , 'HF' )
GROUP BY CTR_POL_NUM
WITH UR;
Code: Select all
APT_CombinedOperatorController,0: Fatal Error: Fatal: [IBM][CLI Driver][DB2] SQL0199N The use of the reserved word "IN" following "" is not valid. Expected tokens may include: "FOR WITH FETCH ORDER UNION EXCEPT QUERYNO OPTIMIZE ". SQLSTATE=42601
SQLExecDirect: Error executing statement 'SELECT CTR_POL_NUM, CTR_RSA_TOT_PREM
FROM
WHERE CTR_POL_NUM IN (CTR_SOURCE_SYSTEM IN ('HC' , 'HF')
GROUP BY CTR_POL_NUM
WITH UR
'. See following DB2 message for details.
The parameter is a String and must contain the single quotations for the SQL WHERE clause.
Anyone have any suggestions on how to proceed/workaround? This is my last bottleneck of a project im working... any help would be greatly appreciated.
Thanks,
Adam Love