BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mandan414
Fluorite | Level 6

Hello,

 

I have a series of dataset like ab2000c, ab2001c, ab2002c, ........ 

To do some analyses I made a macro variable like this:

 

%macro maxyear;

 %do  i = 2000 %to 2002;

proc freq data = ab&ic

......

 

but the above dataset doesn't work. I don't know how to insert the macro variable in the middle of  the dataset name.   

 

Thank you so much in advance for your help,

 

Mandana  

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

You need a dot after the end of the macro variable name

 

ab&i.c
--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

You need a dot after the end of the macro variable name

 

ab&i.c
--
Paige Miller
Reeza
Super User
Any reason why you can't combine the data sets and work with them together?
mandan414
Fluorite | Level 6
Hi, I cannot combine the dataset because the records are slightly different between the datasets. .

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 2480 views
  • 3 likes
  • 3 in conversation