Hi Folks,
I would like to understand , how can I call html file through STP, I am trying to convert/replicate SAS/IntrNet UI by STP.
There are many HTML files are there, and inside master index.html file, many sub html call is happening.
Please suggest.
You can stream web files using STPs so long as you set the http headers, eg using a macro similar to this one: https://core.sasjs.io/mp__streamfile_8sas.html
In general though it's not a recommended approach. You will have the overhead of a SAS session for every asset (html, css, js files etc) plus the challenge of writing code to deal with situations such as very wide lines of text, binary files (images), different encodings etc.
You would be far better off just using a web server to serve your web content, and calling your SAS services as needed using JS. If you don't have SAS 9 EBI, or SAS Viya, you could try out SASjs Server as an alternative: https://server.sasjs.io
The advantage of following the SASjs Server approach is that (so long as you use the SASjs framework) you will be able to easily migrate to Viya at a later date.
I would look to PROC STREAM.
proc stream outfile = _webout prescol ;BEGIN
/* any HTML like: */
<html><head></head><body>
&streamdelim;
%include "&yourpath.\yourfile.html" ;
;;;;
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.