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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 2 replies
  • 1216 views
  • 1 like
  • 3 in conversation