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
Opal | Level 21

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
Opal | Level 21

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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

From SAS Users blog
Want more? Visit our blog for more articles like these.
5 Steps to Your First Analytics Project Using SAS

For SAS newbies, this video is a great way to get started. James Harroun walks through the process using SAS Studio for SAS OnDemand for Academics, but the same steps apply to any analytics project.

Find more tutorials on the SAS Users YouTube channel.

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