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

Hi,

 

I have a table (Accounts) for example:

Account_Number    Name       Birthdate

01                          Mark         January 23, 1988

02                          Ely            March 15, 1956

03                          Omar        June 16, 1987

 

The table is dynamically changing from the source data; thus, I need to put them as a macro variable in a loop. 

Now, I need to add them on a csv file. I'm trying to use PUT function with a macrovariable in a loop (for example: PUT &Name.i) where is starts from 1 in a loop. How can I print them (or PUT function) on a csv file depending on the row number in a loop? Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Rian0126
Obsidian | Level 7

Hi @andreas_lds , it's OK now. I found a solution by using another table as reference. I was just thinking of using macro-variables to fetch data when needed and put it on a csv file for report. Somewhat like a header for a repeated data (same person) with further details (different further details like bank transaction for several times). Thanks anyway. 🙂

View solution in original post

2 REPLIES 2
andreas_lds
Jade | Level 19

I don't see any reason to hold data in macro-variables. Please explain what you expect as result using the data you have shown.

Rian0126
Obsidian | Level 7

Hi @andreas_lds , it's OK now. I found a solution by using another table as reference. I was just thinking of using macro-variables to fetch data when needed and put it on a csv file for report. Somewhat like a header for a repeated data (same person) with further details (different further details like bank transaction for several times). Thanks anyway. 🙂

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 2 replies
  • 1068 views
  • 0 likes
  • 2 in conversation