Quick HTML Guide for SAS Programmers
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.]
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.
- 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.
- You can just do a search and replace to change the YourServer:PortNumber text with your server path own. [Download a copy of the sas_bi_web_clients.html file as a ZIP file.]
If you have two or more servers – just update the next section with the needed server address. It’s easy – you are already on your way to being an HTML powerhouse!
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
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 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.
The Quick Ref web page uses some other tags – heading, un-orderlist, and anchor tags. These are called out in the following example. The most difficult one to grasp at first is the anchor or hyperlink tag.
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. If you wanted a link to this blog, which is http://www.bi-notes.com – this is how you would code it. The web address is inside the anchor tags marked with the HREF attribute and the text is enclosed by the anchor tags.
Using HTML in Stored Processes
You can use HTML code in a SAS stored process to chain stored processes together or create a form to 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 CreateSpace (an Amazon company) page.
Tags: Coding Tips