Hello!
How can i define dynamic html file using filename statement? It's supposed to be that file.html will be always with different name. Also there will be only the one html file in a folder every time.
Here is the code:
filename dir 'path/file.html'; /*currently it's a constant*/
data _null_;
infile dir recfm = n irecl = 32767;
input col1 $32767.;
file "~/file.text";
put col1 $32767.;
run;
How would the programmer know what the different file name is each time?
Adding ... it looks like you are reading an html file, and writing the unchanged text in the html file out to a .txt file.
Why don't you just rename the file from .html to .txt ?
@Cynthia_sas thank you for detailed answer.
Do you want the dynamic name in FILE.HTML (in which case you've got to show the code that creates FILE.HTML) - there's no code that creates file.html. I get this html files from my colleagues who makes html coding and this html up for email template.
The task is parse some data from this html's files and store it in some ref table. Therefore i wrote code that automatically process it but i faced with the only problem that i mentioned on my initial message that will be different names of html files in same folder. At the moment it means i have to change the name of html file in the filename statement manually every time.
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 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: