I have a dataset with time, bid ask
For example
Time Bid Ask
1/1/2013 2 1
1/2/2013 . 2
1/3/2013 3 4
1/4/2013 . 3
1/5/2013 . 2
1/6/2012 4 1
I want to fill in the mssing values (.) with the last observation
For example at 1/5/2013 under bid it must say 3. Tried to use LOFC and Retain..
But doesent work:/
any one have i code i can use 😃
thx in advance
data have; input Time :mmddyy10. Bid Ask; format time mmddyy10.; cards; 1/1/2013 2 1 1/2/2013 . 2 1/3/2013 3 4 1/4/2013 . 3 1/5/2013 . 2 1/6/2012 4 1 ; run; data want; set have; retain _bid; if not missing(bid) then _bid=bid; drop bid; run;
Ksharp
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.