@sasnew_484 wrote:
Rules? Such as within a an Id (seems likely)? If so, what if the value is missing for the first record of an Id? The previous would be from a different ID. >> if the value is missing or the rate1 is zero for the first record of an ID, then it would have the initial amount instead. However, if the record is not the first and the rate1 =0, then the computed value in this case Diff_C and Diff_D will have its previous value. Sorry, I am super new to Sas, I usually work using Tsql and Python. I am not aware of few things. The dates in the actual data are represent as 'ddmmyyyy' format. The sample data when I used on excel it came out as dd-Mon-yy.
When you use Proc Contents or other tools to examine the properties of the SAS variable does it have a FORMAT such as ddmmyy assigned? In SAS FORMAT has a very specific meaning as the way a value is displayed. The same value of a variable can be displayed using a different SAS format at different times. So "looks like" is not a Format.
You can run this code and look at the log for some example of displaying the same numeric value using different Formats.
data _null_;
x=1;
put "X with date9 format " x= date9.;
put "X with Z8.1 format " x= z8.1 ;
put "X with datetime18. format " x= datetime18.;
put "X with time8. format " x= time8.;
run;
Dates, time and datetime values are numeric with certain ranges. The Format is so the value makes sense to humans. If your variable is not numeric then it is not a date value.
... View more