Chapter Contents

Previous

Next
ITEMS

ITEMS



Builds a SAS itemstore, which is essentially a file system within a file

CMS specifics: all


Syntax
Details
HTC File Format
Alternate Syntax for the DIR= and ITEM= Statements
LIST Statement
Options
IMPORT Statement
Options
EXPORT Statement
Options
MERGE Statement
DELETE Statement
Options
See Also

Syntax

PROC ITEMS NAME=<libref.>member;

NAME
If no libref is specified, the libref is assumed to be WORK. If libref.member is specified, the libref must have been previously allocated. See LIBNAME for details.


Details

An itemstore is a SAS data set that is made up of independently accessible chunks of information. SAS uses itemstores for online help, where the SAS help browser accesses an itemstore in the SASHELP library. You can use the ITEMS procedure to create, modify, and browse your own itemstores, which you can access through the SAS help browser.

The contents of an itemstore are divided into directories, subdirectories, and topics. The directory tree structure emulates that of UNIX System Services, so that a given help topic is identified by a directory path (root_dir/sub_dir/item). This hierarchical structure allows the SAS help browser to supports HTML links between help topics.

The itemstores that SAS uses for HTML help can be written only by users with appropriate privilege. Though SAS Institute discourages rewrites of SAS help items, you can add items to the SAS help itemstores, and you can develop new itemstores of your own for any information that you wish to make available through the SAS help browser. For further information on writing your own HTML help, see Developing User-Defined Help.

To access an itemstore, you must first allocate the library that contains the itemstore, unless the itemstore is a member of the WORK library. After you allocate the library, you issue the PROC ITEMS NAME=fileref statement to access the itemstore in SAS. Once the itemstore is available in SAS, you can use the LIST, IMPORT, EXPORT, MERGE, and DELETE statements to control itemstore contents. SAS applies all of these statements to the itemstore name in the last PROC ITEMS NAME= statement.

For information on the HTML tags that are supported by the SAS help browser, see Developing User-Defined Help .


HTC File Format

An HTC file is a collection of HTML files. HTC files can be imported and exported in HTC file format, where items and directories are separated by lines beginning with five colons:

:::::<filename>.htm

Directories in the HTC file are identified by a line that begins with five colons and ends with a path specification:

:::::<dirname1>/<dirname2>/<filename>.htm

In the previous example, if the HTC file containing this entry were imported, the directory and subdirectory would be created as needed and the file would be placed in the specified subdirectory. Any filename that lacks a path specification will go into the root directory or into the directory specified by the DIR= option, if it is specified.


Alternate Syntax for the DIR= and ITEM= Statements

You can use the forward slash path character (/) to specify a path in the DIR= and ITEM= options (described below) in all of the statements that take those options. For example, the following two statements are equivalent:

LIST DIR='usr' ITEM='mail';
LIST ITEM='usr/mail';

Note that a full path, starting with the directory just beneath the itemstore's root directory (with no initial forward slash) is required for access to anything except items in the root directory or to itemstores consisting of a single item.

Wildcards, using asterisks (*) as in UNIX, are not accepted in itemstore paths. Nor can you specify more than one path (a file concatenation) for each of the following statements.


LIST Statement


Syntax

LIST<options;>

The LIST statement writes a list of item or directory names to the SAS log or to a specified file. Specifying no options writes a list of all items and directories to the SAS log.

Options

DUMP=fileref
specifies the fileref that will receive the listing. If DUMP= is not specified, the output goes to the SAS log.

DIR='dir-name'
specifies an itemstore directory whose item names you wish to list. If you specify the DIR= option alone, you will receive a listing of item names contained in that directory.

ITEM='item-name'
specifies that you wish to list the contents of the named item in the named directory of the itemstore. If you specify an item without specifying a directory, you will receive the contents of the item with the specified name in the root directory of the itemstore.


IMPORT Statement

The IMPORT statement imports a fileref into an itemstore. If the imported fileref contains items or directories that currently exist in the itemstore, the new items or directories overwrite (replace) the existing versions.


Syntax

IMPORT FILEREF=fileref<options>;

Options

DIR='dir-name'
specifies the itemstore directory that will receive the imported fileref. If a directory is not specified, the fileref is imported into the root directory of the itemstore.

ITEM='item-name'
specifies the name of the item that will receive the imported fileref. If an item is not specified, the imported fileref is assumed to be an HTC file.


EXPORT Statement

The EXPORT statement copies an item or itemstore to an external fileref in HTC format. If the fileref exists prior to the EXPORT statement, the new fileref overwrites (replaces) the previous version.


Syntax

EXPORT FILEREF=fileref<options>;

Options

DIR='dir-name'
specifies the itemstore directory that is the source of the export. If you do not specify a directory, the fileref receives the contents of the entire itemstore or the specified item from the root directory of the itemstore.

ITEM='item-name'
specifies an item for export. If you do not specify an item, the fileref receives the entire contents of the specified directory or itemstore, in HTC format.


MERGE Statement

The MERGE statement merges the specified itemstore into the itemstore opened previously with PROC ITEMS.


Syntax

MERGE SOURCE=<libref.>member;

A libref is required in the MERGE statement. If the two itemstores have directories with the same name and path, the contents of the new directory replace the contents of the old directory. If you merge into the root directory, the entire itemstore is replaced. If you merge a new item into a directory, the new item is merged into the old directory. If the old directory contains an item of the same name, the new item replaces the old item.


DELETE Statement

The DELETE statement deletes all or part of the contents in an itemstore.


Syntax

DELETE<options>;

Options

DIR='dir-name'
specifies the directory from which you wish to delete. When DIR= is not specified, either the entire contents of the itemstore are deleted or the specified item is deleted from the itemstore's root directory.

ITEM='item-name'
deletes the specified item from the specified directory in the itemstore, or, if a directory is not specified, from the root directory of the itemstore.


See Also


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.