I have an input table that includes a variable called "insured_sk". It contains a few duplicate values. How do I use a Extract transformation to ensure that only distinct insured_sk values are extracted? I figure there should be an expression I can use.
I realize that this is the kind of question that I'll be hitting myself in the head about once i hear the answer, as it's probably very, very simple.
Thanks for your attention.
Here's a punch:
there is a Distinct option in the extract transform.
Since this is SQL, it will keep distinct records, not distinct columns, so be sure to drop any columns that will prevent you from having distinct values.
Here's a punch:
there is a Distinct option in the extract transform.
Since this is SQL, it will keep distinct records, not distinct columns, so be sure to drop any columns that will prevent you from having distinct values.
I am trying to do the same thing. The answer provided does not really address the issue. I want ALL the columns in a row; but wish to purely do a distinct(col1). Of course you could do a join on the table containing only the distinct column with the original table but even then you would get multiple rows with multiple records from this table. It is weird that an option does not exist to select a column(s) for the distinct keyword other than writing code.
Again, this due to the limitations of SQL.
Sounds like you want to do a NODUPKEY. For that, use the Sort transformation.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Lock in the best rate now before the price increases on April 1.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.