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

Hi ,

 

I have a text file which i need to read. However, i do not know the complete name of the file. 

 

For Example: 

The file name for today would be "hello_file_20190415_bc_10.txt" and file name for tomorrow would be "hello_file_20190416_bc_11.txt". 

 

Is it possible to find the name of today's file knowing that partial string "hello_file_20190415_bc_" is a defininte pattern. The problem here is the number 10 and 11 at the end of file name is not know to us and we need to read this file everyday. 

 

please help me how i can approach and solve this. 

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
andreas_lds
Jade | Level 19

If only one file in the folder matches the patter "hello_file_20190415_bc_*.txt", you can use the wildcard in the infile-statement.

View solution in original post

1 REPLY 1
andreas_lds
Jade | Level 19

If only one file in the folder matches the patter "hello_file_20190415_bc_*.txt", you can use the wildcard in the infile-statement.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 792 views
  • 0 likes
  • 2 in conversation