BookmarkSubscribeRSS Feed
kumarsandip975
Quartz | Level 8

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.

2 REPLIES 2
AllanBowe
Barite | Level 11

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.

 

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs
FrankPoppe
Quartz | Level 8

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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1709 views
  • 1 like
  • 3 in conversation