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);
Create table Day5_bal as
b.date as Day5,
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;
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?
Below is an example with the missing date.
anydtdte informat may help.
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.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.