BookmarkSubscribeRSS Feed
saspert
Pyrite | Level 9

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.

4 REPLIES 4
Reeza
Super User

Have you verified each view individually?

DBailey
Lapis Lazuli | Level 10

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. 

saspert
Pyrite | Level 9

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.

DBailey
Lapis Lazuli | Level 10

correct.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 927 views
  • 1 like
  • 3 in conversation