0
votes

I am getting the below error while trying to remove all the html elements using regex in SAS. Can you please let me know what is the issue ?

Data HTMLData;
filename INDEXIN URL "http://www.google.com/";
input;

textline = _INFILE_;
/*-- Clear out the HTML text --*/
re1 = prxparse("s/<(.|\n)*?>//");
call prxchange(re1, -1, textline);
run; 

ERROR: No DATALINES or INFILE statement. ERROR: The INFILE variable has been referenced, but no DATALINES or INFILE statement was found.

1
That doesn't look like sas-ds2. Why do you include that in the title?Joe
Also - removed regex as the issue at hand is unrelated to regexes.Joe

1 Answers

1
votes

You have a filename, but you need an infile statement instead (or in addition). filename is an open code statement, it's just establishing a link between a name literal and a file path.

filename INDEXIN URL "http://www.google.com/";

Data HTMLData;
  infile indexin;
  input;

  textline = _INFILE_;
  /*-- Clear out the HTML text --*/
  re1 = prxparse("s/<(.|\n)*?>//");
  call prxchange(re1, -1, textline);
run;