01-17-2016 05:19 AM
Is it possible to fill in the missing values with the previous value, using SAS EG without editing the code manually?
Thanks in advance!
01-18-2016 02:39 AM
This is beyond the scope of the wizards in EG.
data want; set have; retain oldb; if b = . then b = oldb; oldb = b; drop oldb; run;
(asssuming that b is a numeric variable)
01-19-2016 04:46 AM
The missing value for a string is the empty string, most often represented as '' or "" (single or double quotes with nothing or just blanks in between).
The code transforms the existing data set "have" into the new dataset "want", which is the typical generic nomenklatura for datasets in examples here.
01-19-2016 04:57 AM
And, as further advice: if you want to continue working with SAS, basic skills in data step and procedure coding are indispensable. Probably the best starting point is here:
01-19-2016 05:02 AM
Thank you very much, Kurt!
I will definitely follow your advice to learn more about data step and procedure coding
For now, can you help with the question where I should add the 'data-want' code?
01-19-2016 06:01 AM
As far as I can infer from the postings up to now, you somehow get a SAS dataset with missng values, which you want to have corrected.
Let's assume this dataset is found in your SAS environment as XXXX.YYYY (XXXX being a library, and YYYY being the dataset name).
You need to find the spot in your existing code (nothing in SAS is done without SAS code), and then you can add my code snippet. If you replace "have" and "want" with XXXX.YYYY, you get a step that rewrites the dataset "in place" with the corrected values.