I am trying to partition a input table and only want to go through the input table only once and based on the partition key to output to the table.
I wonder if it is possible to output obs to a dynamic dataset name.
what I plan to do is to sort the input dataset by the partition key variable, then output to a new dataset when a new partitionkey is detected. however, I could not find a way to specify a output dataset name dynamically.
I would say this can't be done with one pass through the data as the output data sets are defined during compilation time but you only know how many and which names of data sets you need during execution time.
A possible approach would be to add a data _null_ step creating the SAS syntax you need, write this syntax to a temporay file and then %include this file after the data _null_ step to get it executed.