Some of us (like me) will not download attached files, so I can't see your data. Please include the data in your reply as plain text, following these examples and instructions.
Also, please be specific and explain what you want as output, provide an example of the "difference" or "differences" you want to see.
Your code in the attachment shows "date" as character values. So you really need to define what you mean by difference.
If the values are actual SAS date values then you can get all sorts of intervals from different date values. If the values were actual SAS date values then you could use the DIF function to get number of days since the previous record.
Can u help me in finding difference between the dates
I have attached the file
Why do to the trouble to make a photograph of text, store it in a PDF file and then upload the file?
Just copy and past the text into the forum editor. Use the Insert SAS Code icon to get a pop-up window to paste/edit the code so its formatting is retained.
Your example program is not reading in dates. It is instead making a character variable named DATE. To make a numeric variable use the DDMMYY informat. Then attach a format to the numeric variable so it prints in a way that humans will understand. Avoid using DDMMYY or MMDDYY format as either one will confuse half of your audience. Use the DATE format or the YYMMDD format instead and avoid the confusion.
Once you have date values then you can just subtract them to find the difference in days between the two dates.
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 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.