Contents SAS/IntrNet 9.1: SAS Design-Time Controls Previous Next

Scheduled Publishing

The dynamic publishing features of the SAS Design-Time Controls enable you to run dynamic pages (ASPs and JSPs) periodically and store the generated HTML as static pages on your Web server. This function is useful if you have data that changes on a known basis and you want to refresh the HTML pages that contain the time-sensitive content.

The following example shows you how to use SAS to perform scheduled publishing. In addition to SAS, you also need to have scheduling software that is capable of running a program at a specified time. Examples include cron on UNIX systems and Control-M on IBM mainframe systems. You can also use the SAS/Warehouse Administrator to schedule your job.

Example

You have data that is updated at 6:00 a.m. each day, and you want to generate reports that reflect the updated data and then store them on your Web server.

  1. Use the SAS Design-Time Controls to generate either ASPs or JSPs that represent your report and store them on your Web server.

  2. Modify the SAS program below and schedule it to run sometime after 6:00 a.m (for example, 6:10 a.m.). The sample code uses the SAS URL access method to retrieve the dynamic page and then stores it on a Web server using the SAS FTP access method.

       *;
       *  Provide the path to the dynamic DTC page
       *  using the SAS URL access method.;
       *;
    
       filename dtcpage url "http://myserver/path-to-dynamic-dtc-page";
    
       *;
       *  Provide the name of the static HTML page to be created,
       *  the domain of the Web server machine where the static page
       *  is to be stored, the user name and password to be used
       *  to log into the Web server machine, and any other host
       *  commands using the SAS URL access method.
       *;
    
       filename static ftp "path-to-static-page"
          host="myserver"
          user="userid"
          pass="password"
          rcmd="ascii"
          rcmd="site umask 002";
             
       *;
       *  Run the dynamic DTC page by accessing it via the SAS URL
       *  access method. Then publish the resulting HTML to the
       *  Web server using the SAS FTP access method.
       *;
    
       data _null_;
          infile dtcpage;
          file static;
          input;
          put _infile_;
       run;
    

    Note: If the SAS log contains either of the following error messages

      ERROR: Service httpd not found.
      ERROR: Service ftp not found

    refer to the SAS notes on support.sas.com for more information.


Contents SAS/IntrNet 9.1: SAS Design-Time Controls Previous Next