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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 1147 views
  • 0 likes
  • 2 in conversation