SAS 9.1.3 Integration Technologies » Developer's Guide


SAS Stored Processes
Software Requirements
Creating Stored Processes
Input Parameters
Result Types
%STPBEGIN and %STPEND
Reserved Macro Variables
Stored Process Server Functions
Sessions
Samples
Debugging
Converting SAS/IntrNet Programs
Using Stored Processes
Building a Web Application
SAS Stored Process Web Application
Configuration
Input
HTTP Headers
Embedding Graphics
Chaining Stored Processes
Using Sessions
Debugging
IOM Direct Interface Stored Processes
SAS Stored Processes

STPSRV_HEADER


The DATA step function used to add or modify a header

Syntax
Arguments
Details
Examples


Syntax

OLD-HEADER = STPSRV_HEADER(Header Name,Header Value);

Note: The APPSRV_HEADER function can be used in place of STPSRV_HEADER. This feature is provided in order to enable you to convert existing SAS/IntrNet programs to stored processes.


Arguments

Header Name
is the name of the header to set or reset.

Header Value
is the new value for the header.

See HTTP Headers for a list of commonly used HTTP headers.


Details

The STPSRV_HEADER function enables automatic header generation. You can add a header to the default list or modify an existing header from the list. When you modify the value of an existing header, the old value becomes the return value of the function.

The automatic HTTP header generation feature recognizes Output Delivery System (ODS) output types and generates appropriate default content-type headers. If no content type is specified with STPSRV_HEADER, ODS is not used and no HTTP header is written to _WEBOUT, and a default Content-type: text/html header is generated.


Examples

SAS Statements Resulting Headers
No calls to stpsrv_header 
Content-type: text/html
/* add expires header */
rc = stpsrv_header('Expires','Thu,
   18 Nov 1999 12:23:34 GMT'); 
Content-type: text/html 
Expires: Thu, 18 Nov 1999 
   12:23:34 GMT 
/* add expires header */
rc = stpsrv_header('Expires','Thu,
   18 Nov 1999 12:23:34 GMT');
/* add pragma header*/
rc = stpsrv_header('Cache-control',
   'no-cache');
Content-type: text/html
Expires: Thu, 18 Nov 1999 
   12:23:34 GMT 
Cache-control: no-cache
/* add expires header */
rc = stpsrv_header('Expires','Thu,
   18 Nov 1999 12:23:34 GMT');
/* add pragma header*/
rc = stpsrv_header('Cache-control',
   'no-cache');
...
/* remove expires header, rc 
   contains old value */
rc = stpsrv_header('Expires','');
Content-type: text/html
Cache-control: no-cache