Hi Community,
I have some records in the output from the following logic that have 'date' in the raw data however appearing in the output as period (.).
What would cause such and can you help me please?
Below is my logic
Data bal_startdate (rename=(Date=StartDate) drop=Offset_Bal);
set Daily;
by AccNo;
if first.AccNo;
run;
Proc Sql;
Create table Day5_bal as
select a.*,
b.offset_Bal,
b.date as Day5,
case
when b.date is missing then 'N' else 'Y' end as Day5_Flag
From bal_startdate a
left join Daily b on a.AccNo=b.AccNo and b.date=a.StartDate+5;
quit;
Kind regards,
Thanks VDD.
Could you please provide an example on using anydtdte informat in proc sql or data step?
Thanks kindly.
There will note be a variable named DATE in either of the datasets your code is creating.
What variable are you saying has a missing value?
Can you show example data for that ends up with missing value?
Are you sure your "date" variable has integer values? Since you are using exact equality perhaps some of the values are slightly different and just appear the be same when the format is applied?
Hi Tom,
Below is an example with the missing date.
Date | Account | OpenDate | Amount | OffSetBal | Day5 | Day5_Flag |
24-Sep-18 | 12345601 | 24-Sep-18 | 5700 | 0 | 29-Sep-18 | Y |
24-Sep-18 | 12345602 | 24-Sep-18 | 8000 | . | 29-Sep-18 | Y |
24-Sep-18 | 12345603 | 24-Sep-18 | 4200 | . | 29-Sep-18 | Y |
24-Sep-18 | 12345604 | 24-Sep-18 | 20000 | . | 29-Sep-18 | Y |
24-Sep-18 | 12345605 | 24-Sep-18 | 6000 | . | . | N |
Kind regards
anydtdte informat may help.
Thanks VDD.
Could you please provide an example on using anydtdte informat in proc sql or data step?
Thanks kindly.
I do not understand what that posted table is trying to represent.
It does not look like what your program is expecting as input data.
Your original program is expecting a data set named BAL_STARTDATE with multiple dates per value of ACCNO.
Your example data has only one record per ACCNO.
It does not look like what your program appears to be creating as output. That dataset should have a variable named STARTDATE.
Take the macro from my second footnote and use it to create a data step with datalines from your dataset "daily". Just a sufficient numer of observations to illustrate your issue. This will take care of any ambiguities, as we can then run your code in exactly the same environment that you ran it.
Posting output listings or copies of the tableview are NOT, I repeat NOT, helpful, as we can only see formatted values, and not the raw values underneath it.
The macro will preserve all values and attributes as they are, which is essential for detecting problems.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.