How can I create a counter in a select statement for a unique ID?
Use a data step, not SQL
@yaakov555 wrote:
How can I create a counter in a select statement for a unique ID?
By using normal SAS code.
data want;
id+1;
set have;
run;
monotonic() but depends on the query exactly.
What would your counter be counting?
1,2,3,4,5
@yaakov555 wrote:
1,2,3,4,5
Those are the numbers that the counter produces. It does not explain what is being counted.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.