This is a very stupid question for which i seem to have lost my code and forgotten the rest. if someone can help me great.
To uniquely count rows in a data set with duplicate primary keys e.g. Three rows with data with the same primary key and i want to count them 1,2,3.
DATA step logic (sorted input file) using a BY statement and IF FIRST._varname_ logic to increment a user SAS variable for all non-FIRST conditions and assign a value of 1 for the FIRST condition.
* input to next DATA step is sorted on _primary_key_variables_. ;
IF FIRST._your_last_break_variable_ THEN DUPCOUNT = 0;
IF NOT (FIRST._your_last_break_variable_ AND LAST._your_last_break_variable_) THEN DUPCOUNT + 1;