SAS Institute. The Power to Know

SAS(R) 9.2 Publishing Framework: Developer's Guide

Previous Page | Next Page

Publishing Packages

INSERT_HTML



Inserts HTML files into a package
Syntax
Arguments
Details
Examples
Example 1: Example 1
Example 2: Example 2
Example 3: Example 3
Example 4: Example 4

Syntax

CALL INSERT_HTML(packageId, body, bodyUrl, frame, frameUrl, contents, contentsUrl, page, pageUrl, desc, nameValue, rc<, properties, propValue1, ...propValueN>);

Arguments

packageId

identifies the package.

Type: Numeric
Direction: Input
body

names the HTML body file, using the following syntax:

  • FILEREF: SAS_fileref

  • FILENAME: external_filename

For information about inserting multiple body files, see Details.

Type: Character
Direction: Input
bodyURL

specifies the URL to be used for the body file.

Type: Character
Direction: Input
frame

names the HTML frame file, using the following syntax:

  • FILEREF: SAS_fileref

  • FILENAME: external_filename

Type: Character
Direction: Input
frameURL

specifies the URL to be used for the frame file.

Type: Character
Direction: Input
contents

names the HTML contents file, using the following syntax:

  • FILEREF: SAS_fileref

  • FILENAME: external_filename

Type: Character
Direction: Input
contentsURL

specifies the URL to be used for the contents file.

Type: Character
Direction: Input
page

names the HTML page file, using the following syntax:

  • FILEREF: SAS_fileref

  • FILENAME: external_filename

Type: Character
Direction: Input
pageURL

specifies the URL to be used for the page file.

Type: Character
Direction: Input
desc

describes the inserted HTML package entry.

Type: Character
Direction: Input
nameValue

identifies a list of one or more space-separated name/value pairs, each in the form of name=value. Name/value pairs are site-specific; they are used for the purpose of filtering. See filtering.

Type: Character
Direction: Input
rc

receives a return code.

Type: Numeric
Direction: Output
properties

identifies a comma-separated list of optional property names. Valid property names are as follows:

  • ENCODING

  • COMPANION_FILE

  • COMPANION_MIMETYPE

  • COMPANION_URL

  • GPATH

  • GPATH_URL

  • NESTED_NAME

Type: Character
Direction: Input
propValue1, ...propValueN

specifies one value for each specified property name. The order of the property values must match the order of the property names in the properties parameter. Valid property values are defined as follows:

ENCODING

indicates the character set of the HTML files, such as ISO-8859-1. For details, see Publish and Retrieve Encoding Behavior. The default encoding is assumed from the native session.

COMPANION_FILE

indicates the name of an additional HTML file that is to be added to this set of HTML files. Multiple COMPANION_FILE properties and values can be specified. Name the companion files, using the following syntax:

  • FILEREF: SAS_fileref

  • FILENAME: external_filename

COMPANION_MIMETYPE

indicates the MIME type of the companion file that is to be added to the inserted HTML entry. If specified, then this property must be preceded by the COMPANION_FILE property.

COMPANION_URL

indicates the URL of an HTML file that is to be added to the inserted HTML entry. If specified, then this property must be preceded by the COMPANION_FILE property.

GPATH

indicates the name of a single directory that contains the ODS-generated graphical files for inclusion as companion files to the HTML file set.

Note:   All files in the specified directory are included as companion files.  [cautionend]

GPATH_URL

indicates the URL of the directory that contains the ODS-generated graphical files. An example of a URL might be ~ods-output/images. Alternatively, you can specify "NONE" as the GPATH_URL property value. If the value of "NONE" is specified, then only the filename is used as the URL.

Note:   If GPATH_URL is specified, then you must also specify the GPATH property.  [cautionend]

NESTED_NAME

indicates the name of the nested directory to create for the storage of the set of HTML files. If you do not specify a value for this property, then a name is generated automatically.

Note:   The NESTED_NAME property is valid only when publishing to the WebDAV-compliant server transport.  [cautionend]

Type: Character
Direction: Input

Details

The files that can be inserted include the body, frame, contents, and page files.

When the NEWFILE= option is specified in the ODS HTML statement, ODS might generate multiple body files. When ODS generates multiple body files, it uses a numeric file naming sequence of the general form: bodyfilenameNumber, as in body1.html, body2.html, body3.html. To insert an entire sequence of body files, use the following syntax:

FILENAME: bodyFilename*.extension

When an asterisk is specified in the body parameter, an asterisk should also be specified in the bodyUrl parameter. For further information about ODS, see SAS Language: Reference and SAS Language Reference: Concepts.

Note:   As a best practice, it is suggested that a MIME type be provided for any companion files inserted into the HTML entry. The MIME type is useful for applications that will later consume or display the published package.  [cautionend]


Examples


Example 1

The following example generates ODS files and inserts those files into a package.

Desc='HTML output for payroll processing';
nameValue = '';
filename f '/users/f.html';
filename c '/users/c.html';
filename b '/users/b.html';
filename p '/users/p.html';
ods html frame=f contents=c(url='c.html')
   body=b(url='b.html') page=p(url='p.html');

/* insert SAS statements here to generate ODS output */

ods html close;

CALL INSERT_HTML(packageId, 'fileref:b', "b.html",
   'fileref:f', "f.html", 'fileref:c', "c.html",
      'fileref:p', "p.html", desc, nameValue, rc);


Example 2

The following example replaces the INSERT_HTML CALL routine in the example above with another version of the CALL routine that inserts ODS files by using the ENCODING property. In this case, the ENCODING property specifies the ISO-Latin-1 character set.

Desc='HTML output for payroll processing';
nameValue = '';
CALL INSERT_HTML(packageId, 'fileref:b', "b.html",
   'fileref:f', "f.html", 'fileref:c', "c.html",
      'fileref:p', "p.html", desc, nameValue, rc,
      "encoding", "ISO-8859-1");


Example 3

The following example specifies a character set encoding and adds two HTML files to the original set of inserted files.

Desc='HTML output for payroll processing';
nameValue = '';
properties='encoding, companion_file, companion_file';
encodingV = "ISO-88591-1";
file1 = "filename: report.html";
file2 = "filename: dept.html";
CALL INSERT_HTML(packageId, 'fileref:b', "b.html",
   'fileref:f', "f.html", 'fileref:c', "c.html",
   'fileref:p', "p.html", desc, nameValue, rc,
   properties, encodingV, file1, file2);


Example 4

The following example uses an asterisk (*) to specify that all body files are to be included in the set of inserted HTML files. The naming sequence used is the same as the naming sequence used in ODS. So the files body.html, body1.html, body2.html, and so on (for all files found in this sequence), will be published. For further information about the ODS naming sequence used in conjunction with the NEWLINE= option, see the SAS Language Reference: Concepts.

Desc='HTML output for payroll processing';
nameValue = '';
CALL INSERT_HTML(packageId,
   'filename:/users/jsmith/body*.html', "body*.html",
   'fileref:f', "f.html", 'fileref:c', "c.html",
   'fileref:p', "p.html", desc, nameValue, rc);

Previous Page | Next Page | Top of Page