Quick HTML Guide for SAS Programmers

This post was kindly contributed by Business Intelligence Notes for SAS® BI Users - go there to comment and to read the full post.

The SAS BI web clients each have their own link (or URL).  When working across many customer sites or even just using my own demo sites –  there can be a lot of links to track (BI Dashboard, Portal, WRS, etc). Certainly I can add bookmarks to my browser –  but when moving to different systems I found it’s easier to just have a little .HTML file that I can edit as needed.

Set Your BI Toolset Quick Ref Bookmark

If you are not sure what I’m trying to describe –  the following page shows an example. It’s really just a simple web page that has the links to the SAS BI Web Clients listed.  In this example –  the customer had two different servers –   Development and Production. Using this quick reference, I can edit the HTML file to match the system I’m using, open the page in the browser, click on the link and it starts the client I want.

To make this web page easier to access – I set it as a default so it appears when I start Internet Explorer.  You can set your default home page in the Tools > Internet Options window.  [Other browsers have similar settings – just check the Help file.]

0622 HTMLForSASProgrammers01 Quick HTML Guide for SAS Programmers

Make Your Quick Reference Web Page

There are many ways to create an HTML file – but to keep this lesson at its most simple and accessible – I’m using Windows Notepad.  In the following figure you can see the HTML code that I used to create the above web page.  The file name is sas_bi_web_clients.html.  On most systems, the HTML extension will cause the file to open in the default browser.

Here’s an example of how to update the file for your site.

  1. The web link I follow to access Web Report Studio is http://DemoServerDev:8080/SASWebReportStudio. However, I only need to replace the “YourServer:PortNumber” with my own –  which is DemoServerDev:8080.  
    Hint: The yellow highlight is the code that you need to replace with your server information.
     
  2. You can just do a search and replace to change the YourServer:PortNumber text with your server path own. [Download the sas_bi_web_clients.html file.]

    If you have two or more servers – just update the next section with the needed code. 

 0622 HTMLForSASProgrammers02 Quick HTML Guide for SAS Programmers

HTML 101 for SAS Programmers

If you want to learn more about this HTML file –  let’s go through a quick demo. [For a complete HTML tutorial –  try the W3Schools site.]  HTML code creates web pages. HTML is not a programming language –  it’s a markup language composed of tags, which describe the web page.  Most HTML tags come in pairs –  for instance the and tags.  The HTML tags indicate that a web page is beginning. 

In the figure below you can see a very simple web page with the HTML tags.  Notice all the tags have an opening tag and a matching closing tag.  The HTML and BODY tags are required to have a webpage. The Title tag is optional –  it controls what appears as the tab title.  A paragraph tag <P> encloses the text.

Save the file with the “.HTML” extension.  You can drag the file on to the browser or use the File > Open menu item to locate and then open the file.  You can also change the text within the tags to whatever you want it to say.

0622 HTMLForSASProgrammers03 Quick HTML Guide for SAS Programmers

The Quick Ref web page uses some other tags –  heading  (< h2>, <h 3>) unordered list (<u l>), and anchor (< a >) tags.  These are called out in the following example.  The most difficult one to grasp at first is the anchor or hyperlink tag.  

0622 HTMLForSASProgrammers04 Quick HTML Guide for SAS Programmers

Using an Anchor (Hyperlink) Tag

A hyperlink or anchor tag can go to another web page, open a link to an email, or even allow a user to download a file.  [Learn more at the W3Schools –  HTML Links page.] The main attribute used is HREF, which lists the URL or web address of where you want to send the user when the link is clicked.

Here’s the basic code.  The blue text is the URL and the green text is what you want the user to see.

        <a href=”put the link here”> put text here </a>

If you wanted a link to this blog, which is http://www.bi-notes.com –  this is how you would code it:

     <a href=”http://www.bi-notes.com”> Go to the BI Notes for SAS Users Blog! </a>

Here’s  how the code would look in the first example from above.     

0622 HTMLForSASProgrammers05 Quick HTML Guide for SAS Programmers

 

Using HTML in Stored Processes

You can use HTML code in a SAS stored process to chain stored processes together or create form output.  In The 50 Keys to Learning SAS Stored Processes, you will find many example of how to use HTML and detailed explanations of the code.   Receive a 20% discount when you use the FFZPHEHM code at the CreaeSpace (an Amazon company) page.

 

This post was kindly contributed by Business Intelligence Notes for SAS® BI Users - go there to comment and to read the full post.