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.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 1 reply
  • 302 views
  • 0 likes
  • 2 in conversation