Chapter Contents |
Previous |
Next |
ITEMS |
CMS specifics: | all |
Syntax |
PROC ITEMS NAME=<libref.>member; |
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.
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>; |
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>; |
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>; |
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.