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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.