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. 🙂

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