12-01-2014 09:40 AM
I am stuck in a problem with a WHERE CLAUSE while testing the first part of the query which is available in attached file i.e. "Complete Code" and that first par is available in "Code". I Checked step by step each part of the query which is available is "Code" and did not find any error but still getting error for WHERE clause. If I remove the WHERE clause, the code available in "Code" file, Its runs with no error.
So Can anybody help me to resolve the error.
Code- 1st part of the main code
Complete Code- Complete code for proc step
Log- Log for 1st part of the main code
I also attached an sql query with the result that got from query in additional files i.e. SQL Code fr validation.txt and Result.txt
12-02-2014 04:27 AM
Sorry, I am not going to read through all that code. I will suggest however that you break your code down. For instance, copy the first section out into a separate proc sql block. (i.e. select up to union). Does that part work, if so do the next part. Do this for every block in the program. Once you have identified which block is giving the problem, then look at the input dataset to that part, does it have the variables, what does the log say, is there a typo. I would also suggest breaking the code down a bit anyways, its difficult to debug a step of that size.
It may also help to know that after the first occurrence of V_Sas_EmpMst_BFI.EmpName
There is a number 36 which is not valid.
12-03-2014 05:38 AM
And what happens (log report) if you just have the first part of the where:
WHERE (vwInvoiceData_BFI.Iddepotcode = 'B000')
Does the above work, then do the same with the next part of the where clause. Repeat until you find the problem statement. I would imagine if it works without the where then in the where you have a variable which is not present in the given dataset, or has a different type.