Hello All!
I'm new to SAS and am encountering the following error
52 proc sql;
53 SELECT cd.*
54 FROM HCI_sql.DM_Claim_Diagnosis cd
55 INNER JOIN HCI_sql.DM_Claim c
56 ON cd.strClaim = c.strClaim
57 AND c.datAdmit BETWEEN '20051101' AND '20061231'
58 ORDER BY cd.strClaim, cd.strSource, cd.strFormType ASC;
ERROR: Expression using IN has components that are of different data types.
NOTE: The IN referred to may have been transformed from an OR to an IN at some point during
PROC SQL where clause optimization.
59 quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
when running this code:
proc sql;
SELECT cd.*
FROM HCI_sql.DM_Claim_Diagnosis cd
INNER JOIN HCI_sql.DM_Claim c
ON cd.strClaim = c.strClaim
AND c.datAdmit BETWEEN '20051101' AND '20061231'
ORDER BY cd.strClaim, cd.strSource, cd.strFormType ASC;
quit;
In our SQL Server datawarehouse the code run fine as such:
SELECT cd.*
FROM DM_Claim_Diagnosis cd
INNER JOIN DM_Claim c
ON cd.strClaim = c.strClaim
AND c.datAdmit BETWEEN '20051101' AND '20061231'
ORDER BY cd.strClaim, cd.strSource, cd.strFormType ASC;
Any ideas on my syntax problem in SAS.
I suspect it's my usage of aliases not conforming to Proc SQL.
Thanks!
Nick
I'm new to SAS and am encountering the following error
52 proc sql;
53 SELECT cd.*
54 FROM HCI_sql.DM_Claim_Diagnosis cd
55 INNER JOIN HCI_sql.DM_Claim c
56 ON cd.strClaim = c.strClaim
57 AND c.datAdmit BETWEEN '20051101' AND '20061231'
58 ORDER BY cd.strClaim, cd.strSource, cd.strFormType ASC;
ERROR: Expression using IN has components that are of different data types.
NOTE: The IN referred to may have been transformed from an OR to an IN at some point during
PROC SQL where clause optimization.
59 quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
when running this code:
proc sql;
SELECT cd.*
FROM HCI_sql.DM_Claim_Diagnosis cd
INNER JOIN HCI_sql.DM_Claim c
ON cd.strClaim = c.strClaim
AND c.datAdmit BETWEEN '20051101' AND '20061231'
ORDER BY cd.strClaim, cd.strSource, cd.strFormType ASC;
quit;
In our SQL Server datawarehouse the code run fine as such:
SELECT cd.*
FROM DM_Claim_Diagnosis cd
INNER JOIN DM_Claim c
ON cd.strClaim = c.strClaim
AND c.datAdmit BETWEEN '20051101' AND '20061231'
ORDER BY cd.strClaim, cd.strSource, cd.strFormType ASC;
Any ideas on my syntax problem in SAS.
I suspect it's my usage of aliases not conforming to Proc SQL.
Thanks!
Nick