DATA Step, Macro, Functions and more

infile statement & HTML code...

Reply
Regular Contributor
Regular Contributor
Posts: 170

infile statement & HTML code...

Hello all;
Does anyone know off-hand how to make an infile statement read and render HTML code properly. This will be then used later for a procto statement.

I have designated the LRECL statement to read the whole line and I have set the length of the single variable to the same, but it still cuts off after a certain number of characters...

Thank you.

Lawrence
Super Contributor
Super Contributor
Posts: 3,174

Re: infile statement & HTML code...

Specifying the LRECL= parameter should address input data line truncation condition, although you must consider the input data record content itself.

Share what code you have for your DATA step to parse the HTML.

As far as generating HTML, you can use a SAS DATA _NULL_ step to generate the HTML tags, or consider how you might use ODS HTML possibly, depending on your requirements. I have pasted a link to one of many technical papers found on the SAS support website http://support.sas.com/ found using a search on related keywords with your post.

Scott Barry
SBBWorks, Inc.


http://www2.sas.com/proceedings/sugi27/p061-27.pdf
Regular Contributor
Regular Contributor
Posts: 170

Re: infile statement & HTML code...

Scott;

Version one:
PROC IMPORT OUT= WORK.Html
DATAFILE= "\\webmcb07\heic\production\Templates\maintemplate
.htm"
DBMS=DLM REPLACE;
*DELIMITER='20'x;
GETNAMES=NO;
DATAROW=1;
RUN;
This seems to work better than the infile statement. It creates 6 variables that I have to combine later. However, it still truncates the last var to 3 characters of which I cannot seem to control and so cuts off part of the output...

The next alternative:
DATA WORK.Html;
length code $ 273;
infile '\\webmcb07\heic\production\Templates\maintemplate
.htm' lrecl=273;
input code $;
RUN;


Does not work as well as it seems to cut off after it encounters a space;
Any help would be grateful.

Lawrence
Regular Contributor
Regular Contributor
Posts: 170

Re: infile statement & HTML code...

scratch this problem...I figured it out...
Ask a Question
Discussion stats
  • 3 replies
  • 165 views
  • 0 likes
  • 2 in conversation