BookmarkSubscribeRSS Feed
Abhinash_rout
Calcite | Level 5

Hi 

I have a bank dataset in which i have 3 variables like Account, Month, Status. I need to know which accounts status is remain same as per the previous month.

refer to the following dataset and give a brief explanation about the findings.

capture.png

 

3 REPLIES 3
mkeintz
PROC Star

The only time I have seen the directive "refer to the following dataset and give a brief explanation about the findings" was in a homework assignment.

 

Please tell us what you have tried, and you will no doubt get good advice.  Most respondents here would rather you own the answer than have the answer own you.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
Ksharp
Super User
It would be better to post real data,not a picture. and better some sas code to generate this data .

Here could give you a start:
https://communities.sas.com/t5/SAS-Programming/Help/td-p/886770
ballardw
Super User

Some things that cannot be told from a picture that you may need to explain in considerable detail.

"same as per the previous month" means that we need to be able to tell just what a "previous month" would be. If your values for "month" are character then the "previous" can have a somewhat slippery meaning as 1 ) there is no YEAR present. So if you have JAN and DEC for the same account we cannot tell which is previous to which.

Second if the value of month are character then "previous" as in "before" typically means the value order. But with character values APR comes before JAN and any comparison is going to be nasty as is.

 

SAS has several tools to deal with sequential processing once the data is in sequence but we cannot tell if the first step is going to be coding that involves allowing placing the months in order and see the comment above about YEAR that may be involved with that.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1240 views
  • 1 like
  • 4 in conversation