@Stalk wrote:
Thank you.
DIF function works, but is there any similar function to DIF to use in Proc SQL?
ERROR: The DIF function is not supported in PROC SQL, it is only valid within the DATA step.
I have all my filters in SQL. Just for handling DIF function I have to recreate the whole dataset and order it again.
SQL by its very nature knows nothing about the ORDER of observations so it is a terrible choice to do something like this.
Your second statement makes no sense at all. How are going to create a new VARIABLE without creating a new dataset, whether you use SQL query or a data step?
Note that you can create views using either PROC SQL code or data step code you want to avoid making multiple physical copies of the data.
... View more