Because the filenames fall into a regular pattern, you could use SAS macro processing to read the files. At the end of a macro program to read 1 file, you could either capture the count of rows into a data set or create one big file by appending a single log to a dataset of all logs (but that seems overkill if what you want is just a count of rows).
You need to investigate SAS macro processing. There have been a lot of previous forum postings on how to read all the files in a directory, how to write a macro program to loop through all the files in a directory and many, many postings on macro processing in general.
In addition, there are many user group papers, beginner, intermediate and advanced level on the use of SAS macros with many good examples. Searching through the forum and using Google to search for user group papers should get you pointed in the right direction.
examples of reading multiple files in a data step can be found in the "SAS on-line help and Documentation" probably as examples for the filename and infile statements.
Your platform will probably support an infile statement with ? or * in the place where you would put a physical file name like
infile 'whatever path/*.log' eov= eov filename= filename ;
which you will find by testing or from documentation, creates a stream of all lines of all .log files from that path with information in variables :"filename" indicating from which file the current line has been read; and "eov" which indicates you have passed an end-of -file condition for one of the log files.
On the server that hosts this forum, in its "knowledge Base" can be found the very related article "Sample 24710: Read all the log files in a specified subdirectory and create a data set with their error messages".
For whom do we add value by posting more examples here?
I can "feel good" by posting an alternative to that offered by "data _null_;" which would be very little different - but my example is probably already in the archives of this Forum. (and so available for your research)
So I recommend, you jerry898969, should extend your learning of the languages of SAS, by reading these references and studying hard, through these archives and the KnowledgeBase. I think you'll find far more answers than we could provide.