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.
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. 🙂
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.
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. 🙂
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.