Hi,
I’m trying to set up an output check that counts how many Excel files it has outputted at that particular time. The filename will always have DPSCAIS append, DPSCAIS_interactive, and DPSCAIS_summary. The only differences are the dates and the name at the start. My question is there a way to count how many of these files are outputted in that folder with the file name mentioned? It should always be three files outputted, if it doesn’t have that file name then flag as fail in the output file check.
say the the folder is “ukfh\file\data\outbox”
Thank you
If these are being produced by a SAS program, I would just check that it ran successfully and then assume that the Excel files were correctly produced. I've usually found that this is a sufficient check.
Even better, schedule this program as a batch job and get it to email you if there is an error of any type, including not producing Excel files. No need to look any further if there is no email. You can assume everything is OK.
There are plenty of discussions here in the SAS Communities which provide instructions on how to read the names of files in a folder. Do a search for this. Use the code provided, then count how many of those files names end with .xlsx (or whatever other filetype you want).
Thank you. I managed to get the file to read in. Is there a way to do a loop to check the correct files because the output name will always be different and not dps_bcs ft. The code will not work, but I was thinking something along those line.
If these are being produced by a SAS program, I would just check that it ran successfully and then assume that the Excel files were correctly produced. I've usually found that this is a sufficient check.
Even better, schedule this program as a batch job and get it to email you if there is an error of any type, including not producing Excel files. No need to look any further if there is no email. You can assume everything is OK.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.