DATA Step, Macro, Functions and more

Format issues with Proc Sql

Reply
Super Contributor
Posts: 275

Format issues with Proc Sql

Hi,

I am not able to troubleshoot the errors with the proc sql. I have attached the log with the error in the text file since I am not able to copy paste the code here. The question is - there is no comparison operator (eq/gt/ge) being used in this proc sql but the error says the data types being compared are different.

Here in the code the proc sql dataset _7_casecntofacct sources from qm0casecountofaccount1 (a sas proc sql view ) which in turn uses another proc sql sas view qmbcaseuseacctbycycle which has the comparison operators (=).

The log does not give any errors but only says -

Note: sql view xxx has been defined.

So only when the proc sql create table is executed, does the error with the different data types show up? I hope I am making sense.

Thanks,

saspert.

Attachment
Super User
Posts: 19,805

Re: Format issues with Proc Sql

Have you verified each view individually?

Super Contributor
Posts: 578

Re: Format issues with Proc Sql

SAS Views are not evaluated other than for syntax at create time.  I would suspect that if you just performed a select * from the view, you would get the same error. 

Super Contributor
Posts: 275

Re: Format issues with Proc Sql

Thanks Reeza and DBailey for the suggestions. I was able to troubleshoot. I guess sas views are compiled at run time. They are executed only when a sas dataset (or in other words a materialized view) using those views is being created. Is that correct understanding?

The error was in a join between two different datasets using the same field but different format.

Super Contributor
Posts: 578

Re: Format issues with Proc Sql

correct.

Ask a Question
Discussion stats
  • 4 replies
  • 263 views
  • 1 like
  • 3 in conversation