BookmarkSubscribeRSS Feed
_LB
Fluorite | Level 6 _LB
Fluorite | Level 6
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
3 REPLIES 3
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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
_LB
Fluorite | Level 6 _LB
Fluorite | Level 6
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
_LB
Fluorite | Level 6 _LB
Fluorite | Level 6
scratch this problem...I figured it out...

SAS Innovate 2025: Call for Content

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 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1347 views
  • 0 likes
  • 2 in conversation