BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Coding4you
Obsidian | Level 7

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”

 

1EF5A09A-C676-410F-823C-33E8C59920EC.jpeg

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

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.

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

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

--
Paige Miller
Coding4you
Obsidian | Level 7

B2CAF120-7E70-443A-BE24-303919F63505.jpegThank 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.

SASKiwi
PROC Star

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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 3 replies
  • 965 views
  • 2 likes
  • 3 in conversation