BookmarkSubscribeRSS Feed
Mohan_Reddy
Obsidian | Level 7

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 : 

11 REPLIES 11
PaigeMiller
Diamond | Level 26

Kindly explain further. What does "get all accounts statements" mean? Please show a small example.

--
Paige Miller
Mohan_Reddy
Obsidian | Level 7

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.

PaigeMiller
Diamond | Level 26

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.

 

 

--
Paige Miller
ghosh
Barite | Level 11

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

 

https://blogs.sas.com/content/sastraining/2015/01/30/sas-authors-tip-getting-the-macro-language-to-p...

Mohan_Reddy
Obsidian | Level 7

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.

PaigeMiller
Diamond | Level 26

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

--
Paige Miller
Mohan_Reddy
Obsidian | Level 7

Soory for post.Before i had not asking properly so that why cause ask properly question right.So kindly help in this code 

Reeza
Super User

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. 

 

Shmuel
Garnet | Level 18

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;  /* period defined by %let or typed here */
quit;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 11 replies
  • 1147 views
  • 1 like
  • 6 in conversation