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

You can create and allocate your own itemstores for other purposes, such as providing supplemental help or developing HTML information for the SAS HTML viewer for the CMS environment. Once you allocate an itemstore with PROC ITEMS NAME=fileref, you can use the LIST, IMPORT, EXPORT, MERGE, and DELETE statements to control itemstore contents. SAS applies all of these statements to the itemstore named in the last PROC ITEMS NAME= statement.

For further information on setting up and using SAS help and the HTML viewer, 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.