I have 10 Bank accounts Numbers.Now i want accounts statements from June 29 to Aug 1.But i want a code automatically like when i run that code it will looping and get all accounts statements .So kindly suggest a best code for me.
Bank Accounts Numbers :
Kindly explain further. What does "get all accounts statements" mean? Please show a small example.
For example i have bank account numbers like this : 9022145682
9025478991
9120456897
9789456125 etc 10 Accounts.
Now i want all this 10 accounts transactions statements from june 29 to aug 1 through single code only..Like Looping .So kindly help in this code . once code will run we need to get all 10 accounts transaction statements outputs at same time.
I'm afraid these incredibly brief descriptions have not led me to understand what you want or how we can help you. You have not explained what it means when you want all accounts transactions statements, or where these statements are, or how a SAS program can access them.
Also, any SAS program is "single code", so any SAS program would meet that need.
Mohan
This is a very common question and there are may threads here on this topic. However, since your question is so vague I will point to a solution that will enable you to write your own code
Please supply source data in usable form (in a data step with datalines, do not skip this!), and what you expect to get out of it.
For example i have bank account numbers like this : 9022145682
9025478991
9120456897
9789456125 etc 10 Accounts.
Now i want all this 10 accounts transactions statements from june 29 to aug 1 through single code only..Like Looping .So kindly help in this code . once code will run we need to get all 10 accounts transaction statements outputs at same time.
Please don't post the same question twice. You have already asked this question in your other thread at https://communities.sas.com/t5/SAS-Programming/How-to-Looping-All-Accounts-at-same-time/td-p/674950
Soory for post.Before i had not asking properly so that why cause ask properly question right.So kindly help in this code
1. Make sure you have a working program that works for one account
2. Follow the instructions here to generalize it for many accounts https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md
FYI - vague questions get vague answers and your question is incredibly broad. It could require something like above or could be as simple as changing an = to a IN but unless you show an example of what you're trying to do we have no idea of how to answer your question.
I merged this back to the original question. Please provide example data and expected output; read my previous post.
If I understand you correctly then you can subset your data using a code like:
%let acnts = 1111 22222 3333 ....; /* accounts list */
%let period = BETWEEN <from_date> AND <last_date>;
/* enter dates literal in a format: '06AUG2020'd */
data want;
set have(where=(account in (&acnts) and date &period));
run;
if you have a long list of accounts then better use next skeleton code:
data _acnts;
input account;
cards;
11111
22222
33333
.....
; run;
proc sql;
create table want as
select * from have
where account in (select account from _acnts) and
date . /* period defined by %let or typed here */
quit;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.