I have tried using as suggested by you using LIBNAME XLSX and dataset. Here, is the code:
Code:
filename | error_msg |
test1.dat6 | No records |
But, want the following output:
filename | error_msg |
test1.dat2 | No records |
test1.dat4 | No records |
test1.dat6 | No records |
@Moksha wrote:
Just now, realized that the code I have mentioned is creating an excel file if doesn't exist already. Now, the problem is that I don't know what is happening and why I am getting error (shown in the screenshot) while opening the excel file after running the macro. Can you please help me how to write to the excel file successfully?
The f-functions like fopen() or fwrite() are for interaction with simple text files. Your code does not create an Excel file but a Text file with name Missing_records_in_source.xlsx
Only because you give this file a suffix of xlsx doesn't make it an Excel Workbook.
Thank you very much for providing insights on fopen() and fwrite(). I was thinking that it is creating excel file.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.