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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.