In that I need to keep a condition like if the amount is max for a record then I need the overall rows where the sas_date should be older date.
I'm not understanding this. Please explain in more detail and walk us through an example step by step.
@Pandu2 wrote:
Hi, thanks for responding.
Could you please look at the example which I added
As far as I can see, you have not explained anything (which I specifically asked for), nor have you walked us through the example step-by-step (which I specifically asked for). So I still don't understand.
Please review your code so that the step works without ERRORs or WARNINGs, then re-post it by copy/pasting the code into a code box opened with the "little running man" icon.
If you have trouble writing a simple data step, we should tackle this first before you dig deeper into SAS coding, so don't hesitate to ask how to write the step so that it works.
If you think you can fix your data step code yourself, do it. Right now I have no idea how your dates are stored.
Finding minimum values is done with the MIN Function in a data step, or the MIN Summary Function in SQL.
Do you have a numeric variable with a DATE9 format attached, or a character variable that contains the string as posted?
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.