01-24-2018 11:48 AM
I have a data file that looks like this:
There are many cases where a value for the column "ActualRead" will not exist, and therefore it will be an estimated read that shows up in the "EstimatedReads" column. My question is how do I combine these two columns so that I have a single column that contains the actual reads, and replaces the missing actual reads with the estimated reads in the other column?
P.s. I am a SaS novice. I can handle some programming, but would prefer a solution in EG. Thanks.
01-24-2018 11:53 AM
The coalesce function will do what you want. e.g.:
data want; set have; actualreads=coalesce(actualreads,estimatedreads); run;
Art, CEO, AnalystFinder.com
01-24-2018 12:23 PM - edited 01-24-2018 12:29 PM
Since you call yourself a novice, I thought you might want the simplest version:
if ActualReads=. then ActualReads=EstimatedReads;
Dropping EstimatedReads might not be a great idea, but I wasn't sure if that was part of the question or not.