Firstly thanks for all answers. iam a new student of sas programming.and want to ask a problem. I have a dataset named as 'tables' and contents 4 rows:
Tables
-----------
Orion
Clinics
Datas
Other
;
I want to do a loop. Firstly read dataset name "orion" then go to work.orion dataset and calculate something...etc. Then go to second dataset "clinics" and again calculate sth. And goes on like this. i couldnt do that. If dataset names used to be like table1 table2 table3 i can do it with macros, %do i=1 %to n.... But i couldnt succeeded with it different dataset names.thanks again
Since you would know how to do this if the data sets were named differently, here's a link that might help:
The solution for this would look like:
1. Make a macro, as you've indicated that takes a single parameter - dataset name.
2. Use call execute to call macro for each dataset.
It it sounds like you're having issues with step 1?
Since you would know how to do this if the data sets were named differently, here's a link that might help:
No, I don't have any secrets above and beyond what was in that paper.
You had indicated that you knew how accomplish this task if the data set names were table1, table2, table3, etc. This paper just shows you have to do the same thing if the table names don't have a pattern to them. Are you stuck on how to get a list of the data set names?
@Yavuz wrote:
Can you send me a code which is runned.
No. You haven't specified what you need to get working at all.
Here's a basic tutorial on Macro's but does a good job of going through what you likely need.
http://www.ats.ucla.edu/stat/sas/seminars/sas_macros_introduction/
If you're looking for more resources I highly suggest searching lexjansen.com
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.