BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
JLin2021
Fluorite | Level 6

Hi All,

 

I need to check whether an input file exists first; and if it exists then I can import into SAS.

But every time the name of input file will change, e.g. testing_01.xlsx, testing_02.xlsx ..., so I can only use wildcard for the filename.

But then fileexist function does not work for wildcard, so I can't use it to test existence.

Is there anyway to do it? Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

Look at the the very first locked topic. at the top of the page of the programming community.

You'll see how to list files in a directory.

 

View solution in original post

3 REPLIES 3
ballardw
Super User

Details.

Are there other XLSX files in the folder? If so, how will you know which one to use?

ChrisNZ
Tourmaline | Level 20

Look at the the very first locked topic. at the top of the page of the programming community.

You'll see how to list files in a directory.

 

JLin2021
Fluorite | Level 6
Thanks for your idea! I have now imported the the files into dataset

SAS Innovate 2025: Call for Content

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!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1307 views
  • 1 like
  • 3 in conversation