RETRIEVE_HTML

Retrieves an HTML entry from a package

Syntax

CALL RETRIEVE_HTML(entryId, path, body, bodyUrl, frame, frameUrl, contents,
contentsUrl, pages, pagesUrl, rc<, properties, propValue1, ...propValueN> );

Required Arguments

entryId
identifies the HTML entry.
Type:Numeric, Input
path
specifies the full designation of the location that will receive the retrieved files.
Type:Character, Input
body
returns the name of the HTML body file.
Type:Character, Output
bodyUrl
returns the URL of the HTML body file.
Type:Character, Output
frame
returns the name of the HTML frame file.
Type:Character, Output
frameUrl
returns the URL of the HTML frame file.
Type:Character, Output
contents
returns the name of the HTML contents file.
Type:Character, Output
contentsUrl
returns the URL of the HTML contents file.
Type:Character, Output
pages
returns the name of the HTML page file.
Type:Character, Output
pagesUrl
returns the URL of the HTML page file.
Type:Character, Output
rc
receives a return code.
Type:Numeric, Output

Optional Arguments

properties
identifies a comma-separated list of optional property names. Valid property names are as follows:
  • ENCODING
  • BODY_TOTAL
  • FILE_TOTAL
  • COMPANION_TOTAL
Type:Character, 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 input character string that indicates the target encoding for the retrieved HTML file. An example of a target encoding value is ISO-8859-1.
BODY_TOTAL numeric output parameter that returns the total number of HTML body files published as part of this set.
FILE_TOTAL numeric output parameter that returns the total number of all HTML files published as part of this set. This includes all body, page, contents, frame, and additional HTML files and companion files.
COMPANION_TOTAL numeric output parameter that returns the total number of extraneous HTML files that were published as part of this set.
Type:Character or Numeric, Input or Output

Details

The ODS entry can contain any combination of the following: ODS HTML file, contents file, pages file, or frame file.
The publisher can choose to publish any combination of the HTML files. To indicate those files that were not published as part of this set, the output parameter that contains the created filename will be updated to "". For example, if only the body was published, then the page, contents, and frame parameters will be returned as "".
The pages, pagesUrl, body, bodyUrl, frame, frameUrl, contents, and contentsUrl parameters are character variables that are updated by the CALL routine. Because they are updated, they must be initialized with a length large enough to contain the name of the returned filename or URL. If the length of the character variable is less than the length of the returned filename or URL, the filename or URL will be truncated and a warning will be issued. When calling the RETRIEVE_HTML CALL routine from within the DATA step, use the LENGTH statement to define the length of the character variable. When calling RETRIEVE_HTML from within a macro, initialize the variable to some value so that it will have an appropriate length, as shown in the second example below.
For information on how HTML files are published and how the optional encoding property can be used to provide encoding information to package recipients, see Publish and Retrieve Encoding Behavior.

Examples

Example 1: Using RETRIEVE_HTML

The following example retrieves HTML entry information from the package.
data _null_;
length contents $64 frame $64 pages $64 body $64
   contentsUrl $256 frameUrl $256
      PagesUrl $256 bodyUrl $256;

   path ='/maintenance/schedule/doc';
CALL RETRIEVE_HTML(entryId, path, body,
   bodyUrl, frame, frameUrl, contents,
   contentsUrl, pages, pagesUrl, rc);

Example 2: Using RETRIEVE_HTML with Macro Variables

The following example uses a macro to initialize a variable to a specific length and then retrieves HTML information from the package.
%macro initLen(variable, len);
   %let &variable=.;
   %do i=2 %to &len
      %let &variable=&&&variable
   %end;
%mend;

%initLen(contents, 64);
%initLen(contentsUrl, 256);
%initLen(pages, 64);
%initLen(pagesUrl, 256);
%initLen(body, 64);
%initLen(bodyUrl, 256);
%initLen(frame, 64);
%initLen(frameUrl, 256);
%let path =/users/maintenance/doc;
%let rc=0;
%syscall RETRIEVE_HTML(entryId, path, body,
   bodyUrl, frame, frameUrl, contents, contentsUrl,
   pages, pagesUrl, rc);