Syntax: DOCUMENT Procedure


  • PROC DOCUMENT < options >;

    • COPY path <, path-2, ...path-n > TO path < / option(s) >;

    • DELETE path < , path-2, ...path-n >;

    • DIR < path >;

    • DOC < options >;

    • DOC CLOSE ;

    • HIDE path < , path-2, ...path-n >;

    • IMPORT DATA= data-set- name

    • GRSEG= grseg TO path < / options >;

    • LINK path TO path < / options >;

    • LIST < path-1, path-2, ...path-n >< / option(s) >;

    • MAKE path < , path-2, ...path-n >< / options >;

    • MOVE path <, path-2, ...path-n > TO path < / option(s) >;

    • NOTE path < 'text' >< / option(s) >;

    • OBANOTE < n > output-object < 'text' >< / option >;

    • OBBNOTE < n > output-object < 'text' >< / option >;

    • OBFOOTN < n > output-object < 'text' >;

    • OBPAGE output-object < / option(s) >;

    • OBSTITLE < n > output-object < 'text' >< / options >;

    • OBTITLE < n > output-object < 'text' >;

    • RENAME path-1 TO path-2 ;

    • REPLAY < path < , path-2, ...path-n >> < / options >;

    • SETLABEL path 'label' ;

    • UNHIDE path < , path-2, ...path-n >;

  • QUIT ;

Task

Statement

Insert a copy of an entry into a specified path

COPY

Delete entries from a specified path or paths

DELETE

Set or display the current directory

DIR

Open a document and its contents to browse or edit

DOC

Close the current document

DOC CLOSE

Prevent output from being displayed when the document is replayed

HIDE

Import a data set or graph segment into the current directory

IMPORT

Create a symbolic link from one output object to another output object

LINK

List the content of one or more entries

LIST

Create one or more new directories

MAKE

Move entries from one directory to another directory

MOVE

Create text strings in the current directory

NOTE

Create or modify lines of text after the specified output object

OBANOTE

Create or modify lines of text before the specified output object

OBBNOTE

Create or modify lines of text at the bottom of the page in which the output object is displayed

OBFOOTN

Create or delete a page break for an output object

OBPAGE

Create or modify subtitles

OBSTITLE

Create or modify lines of text at the top of the page where the output object is displayed

OBTITLE

Assign a different name to a directoryor output object

RENAME

Replay one or more entries to the specified open ODS destination(s)

REPLAY

Assign a label to the current entry

SETLABEL

Enable the output of a hidden entry to be displayed when it is replayed

UNHIDE

PROC DOCUMENT Statement

Creates or opens a document to modify

Default: Documents are opened in the UPDATE access mode.

Caution: If you do not explicitly close the DOCUMENT destination with an ODS DOCUMENT CLOSE statement, then ODS continues to append files to your document.

PROC DOCUMENT < options < access-options >>;

Without Options

If no options are specified, then the PROC DOCUMENT statement opens the last document that was created in the current SAS session.

Options

NAME= <<libref.>memname <access-options>

  • specifies the name that you assign to a new or existing document and its access mode.

  • < libref .> memname

    • identifies a new or existing ODS document.

    • Default: If no library is specified, then the WORK library is used.

    • Restriction: The ODS document must be a valid SAS library member.

  • access-options

    • specifies the access mode for the ODS document.

    • Default: UPDATE

    • READ

      • opens a document and provides read-only access.

      • Requirement: To open a document in the READ access mode, the document must already exist.

      • Interaction: If a label has been specified with the LABEL= option, then the label is ignored.

    • WRITE

      • opens a document and provides write access as well as read access.

      • Caution: If the ODS document already exists, then it will be overwritten.

      • Interaction: If a label has been specified with the LABEL= option, then it will override any existing label assigned to the document.

      • Tip: If the ODS document does not exist, then it will be created.

    • UPDATE

      • opens an ODS document and appends new content to the document. UPDATE provides update access as well as read access.

      • Caution: If the document already exists, then its contents will not be changed.

      • Interaction: If a label has been specified with the LABEL= option, then it will be assigned to the document.

      • Tip: If the ODS document does not exist, then the document will be created.

LABEL=' label '

  • assigns a label to your document.

  • Restriction: You can assign a label to your document only if you have write access permissions.

  • Requirement: The label that you assign to your document must be enclosed in quotation marks.

COPY Statement

Copies an entry into the specified path

Default: If you do not specify a location where to insert an entry into a path, then the entry is inserted at the end of the path.

COPY path <, path-2, ...path-n > TO path < / < LEVELS= value ALL >< FIRST LAST BEFORE= path AFTER= path >>;

Required Arguments

path

  • is the location where a link, output object, or file is copied .

  • Requirement: When you specify more than one path, you must separate the paths with a comma.

Options
  • AFTER= path

    • inserts a copy of an entry after the specified path.

  • BEFORE= path

    • inserts a copy of an entry before the specified path.

  • FIRST

    • inserts a copy of an entry at the beginning of the specified path.

  • LAST

    • inserts a copy of an entry at the end of the specified path.

  • LEVELS= ALL value

    • specifies the depth of the file location.

    • Restriction: The LEVELS= option is a valid option only when you specify a file location.

  • ALL

    • specifies all levels of the file location.

  • value

    • specifies the numeric value of the file location level.

DELETE Statement

Deletes entries from the current file location

Restriction: You cannot delete or move the root file location.

Caution: The DELETE statement affects all levels of a file location below the specified path.

DELETE path < , path-2, ...path-n >;

Required Arguments

path

  • specifies the location of one or more links, output objects, or file locations.

  • Requirement: When you specify more than one path, you must separate the paths with a comma.

DIR Statement

Sets or displays the current file location

Featured In: Example 1 on page 244, Example 2 on page 248, and Example 3 on page 253

DIR < path >;

Without Options

If no options are specified, then the DIR statement displays the current path.

Options

path

  • sets the current file location.

DOC Statement

Opens a document and its contents to browse or edit

Default: Documents are opened in the UPDATE access mode.

Featured In: Example 1 on page 244 and Example 2 on page 248

DOC < options < access-options >>;

Without Options

If no options are specified, then the DOC statement lists the ODS documents that exist in all SAS libraries.

Options

LABEL= ' label '

  • assigns a label to your document.

  • Restriction: You can assign a label to your document only if you have write access permission.

  • Requirement: To use the LABEL= option, you must specify the NAME= option on the DOC statement.

  • Requirement: The label that you assign to your document must be enclosed in quotation marks.

LIBRARY= library-name

  • specifies that only the documents in the specified library-name are listed.

  • Alias: LIB=

  • Interaction: You cannot specify the LIBRARY= option with the NAME= or LABEL= options.

NAME= libref.memname <access-options>

  • specifies the name that you assign to a document and its access mode.

  • < libref .> memname

    • identifies a document.

    • Default: If no library is specified, then the WORK library is used.

    • Restriction: The document must be a valid SAS library member.

access-options

  • specifies the access mode for the document.

  • READ

    • opens a document and provides read-only access.

    • Interaction: If a label has been specified with the LABEL= option, then the label is ignored.

  • WRITE

    • opens a document and provides write access, but only if you have write permission.

    • Caution: If the document already exists, then it will be overwritten. If the document does not exist, then it will be created.

    • Interaction: If a label has been specified with the LABEL= option, then it will override any existing label assigned to the document.

  • UPDATE

    • opens a document and provides update access, but only if you have update permission.

    • Interaction: If a label has been specified with the LABEL= option, then it will be assigned to the document.

    • Tip: If the document already exists, then its contents will not be changed and the new contents will be appended to the document. If the document does not exist, then it will be created.

DOC CLOSE Statement

Closes the current document

DOC CLOSE ;

HIDE Statement

Prevents output from being displayed when the document is replayed

Tip: To see entries that might be hidden in the current document, use the LIST statement.

HIDE path < , path-2, ...path-n >;

Required Arguments

path

  • specifies the location of the file or files that you want to hide.

  • Requirement: When you specify more than one path, separate the paths with a comma.

IMPORT Statement

Imports the specified SAS data set or graph segment to the current file location

IMPORT DATA= data-set-name < data-set-options > GRSEG= grseg TO path < / < FIRST LAST BEFORE= path AFTER= path >>;

Required Arguments

DATA= data-set-name

  • specifies an existing SAS data set that you want to import.

GRSEG= grseg

  • stores a reference to a graph segment.

    grseg

    • specifies the 3-level catalog path name. For example, GRSEG=SASUSER.grseg.mygraph.

    • See: GRSEG= option in the SAS/GRAPH Reference, Volumes 1 and 2 .

  • path

    • specifies the location where you want to import the data set or graph segment.

Options

AFTER= path

  • imports the data set or graph segment into the file location after the specified path.

BEFORE= path

  • imports the data set or graph segment into the file location before the specified path.

data-set-options

FIRST

  • imports the data set or graph segment at the beginning of the file location.

LAST

  • imports the data set or graph segment at the end the file location.

LINK Statement

Creates a symbolic link from one specified output object to another in the current file location

LINK path TO path < / < HARD >< LABEL >< FIRST LAST BEFORE= path AFTER= path >>;

Required Arguments

path

  • specifies the locations of the output objects that you want to link to one another.

Options

AFTER= path

  • links to the entry that is after the specified path in the current file location.

BEFORE= path

  • links to the entry that is before the specified path in the current file location.

FIRST

  • links to the first entry in the current file location.

HARD

  • specifies a type of link that refers to a copy of an output object within the ODS document. All data is shared between the link and the target, except names and labels.

  • Restriction: A hard link can only reference an output object, and the source and target paths must be in the same ODS document. The target must exist when you create the hard link.

  • Interaction: A hard link and its target exist independently. If you delete a hard link, you do not effect the target. Similarly, if you delete a target, you do not affect the link.

LABEL

  • copies the source label to the link.

  • Default: The source label is not copied unless you use the LABEL option.

LAST

  • links to the last entry in the current file location.

LIST Statement

Lists the contents of one or more entries

Default: If you omit the DETAILS option, then only summary information is displayed.

Default: If you omit the ORDER= option, then the contents of the specified entries are listed in INSERT order (the order in which you arranged the entries.)

Tip: To see any entries that might be hidden in the current file location, use the LIST statement.

Featured In: Example 1 on page 244, Example 2 on page 248, and Example 3 on page 253

LIST < path-1, path-2, ...path-n ></< DETAILS >< FOLLOW >< LEVELS= value ALL >< ORDER= ALPHA DATE INSERT >>;

Required Arguments

path

  • specifies the location of an entry. An entry can be one or more file locations, links, or output objects.

  • Requirement: When you specify more than one path, separate the paths with a comma.

Options

DETAILS

  • specifies the properties of the entries.

FOLLOW

  • resolves all links and lists the contents of the entries.

LEVELS= value ALL

  • specifies the depth of the file locations that you want to list.

  • Default : If you omit the LEVELS= option, then the default value of the level is 1.

  • Restriction : The LEVELS= option is a valid option only when you specify a file location.

  • value

    • specifies the numeric value of the file location level.

  • ALL

    • specifies all levels of the file location.

ORDER= ALPHA DATE INSERT

  • specifies the order in which the entries are listed.

  • ALPHA

    • lists the entries in alphabetical order.

  • DATE

    • lists the file locations in order of ascending date/time stamp when the entries were created.

  • INSERT

    • lists the file locations in the order in which you arranged the entries.

MAKE Statement

Creates one or more new file locations

Default: If no location is specified, the newly created file location is appended to the end of the current file location.

MAKE path < , path-2, ...path-n >< / < FIRST LAST BEFORE= path AFTER= path >>;

Required Arguments

path

  • specifies the newly created file location.

  • Requirement: When you specify more than one path, separate the paths with a comma.

Options

AFTER= path

  • adds the newly created file location after the specified path in the current file location.

BEFORE= path

  • adds the newly created file location before the specified path in the current file location.

FIRST

  • adds the newly created file location to the beginning of the current file location.

LAST

  • adds the newly created file location to the end of the current file location.

MOVE Statement

Moves entries from the specified location to another location

Restriction: You can not move or delete the root file location.

Requirement: When you specify more than one path, separate the paths with a comma.

Caution: The MOVE statement effects all levels of a file location below the specified starting level.

MOVE path <, path-2, ...path-n > TO path < / < LEVELS= value ALL >< FIRST LAST BEFORE= path AFTER= path >>;

Required Arguments

path

  • specifies the location of links, output objects, or files that you want to move.

Options

AFTER= path

  • moves the entry after the specified entry in the path.

BEFORE= path

  • moves the entry before the specified entry in the path.

FIRST

  • moves the entry to the beginning of the specified file location.

LAST

  • moves the entry to the end of the specified file location.

LEVELS= value ALL

  • specifies the level in the file hierarchy.

  • value

    • specifies the numeric value of the file location level. For example, '3' indicates the third level in the hierarchy.

  • ALL

    • specifies all levels of the file location.

NOTE Statement

Creates text strings in the current file location

Default: If you omit the JUST= option, then the note is centered between the left and right margins.

Default: If no location is specified, then the note is added to the end of the current location.

Featured In: Example 3 on page 253

NOTE path < 'text' >< / < JUST= LEFT CENTER RIGHT >< FIRST LAST BEFORE= path AFTER= path >>;

Without Options

If no text is specified, then the NOTE statement creates a blank note.

Required Arguments

path

  • specifies the location where the note is stored.

Options

AFTER= path

  • inserts the text string after the specified path.

BEFORE= path

  • inserts the text string before the specified path.

FIRST

  • inserts the text string at the beginning of the path.

JUST= LEFT CENTER RIGHT

  • specifies the alignment of the text string.

  • LEFT

    • aligns the text string with the left margin.

  • CENTER

    • aligns the text string in the center between the left and right margins.

  • RIGHT

    • aligns the text string with the right margin.

LAST

  • inserts the text string at the end of the path.

text

  • specifies the text string.

  • Requirement: All text strings must be enclosed in quotation marks.

OBANOTE Statement

Creates or modifies an object footer (lines of text) after the specified output object

Featured In: Example 3 on page 253

OBANOTE < n > output-object < 'object-footer-text' >< /JUST= LEFT CENTER RIGHT >;

Required Arguments

output-object

  • specifies the name of the ODS output object.

Options

JUST= LEFT CENTER RIGHT

  • specifies the alignment of the object-footer.

  • LEFT

    • aligns the object-footer-text with the left margin.

  • CENTER

    • aligns the object-footer-text in the center between the left and right margins.

  • RIGHT

    • aligns the object-footer-text with the right margin.

n

  • specifies the relative line that contains the note.

  • Default: If you omit n , SAS assumes a value of 1. Therefore, you can specify OBANOTE or OBANOTE1 for the first text line.

  • Range: 1-10

  • Tip: The OBANOTE line with the highest number appears on the bottom line.

  • Tip: You can create notes that contain blank lines between them. For example, if you specify text with an OBANOTE1 statement that is followed by an OBANOTE3 statement, then a blank line separates the two lines of text.

object-footer-text

  • specifies the text string.

    You can customize object footers by inserting BY variable values (#BYVALn), BY variable names (#BYVARn), or BY lines (#BYLINE) into object footers that are specified in PROC DOCUMENT steps. After you specify the object footer text, you can embed the items at the position where you want them to appear. For more information, see 'The DOCUMENT PROCEDURE and BY-Groups' on page 233.

  • Requirement: All object-footer-text must be enclosed in quotation marks.

  • Caution: If no object-footer-text is specified, then the OBANOTE statement deletes all existing footer notes for the specified output object only.

OBBNOTE Statement

Creates or modifies an object header (lines of text) before the output object

Featured In: Example 3 on page 253

OBBNOTE < n > output-object < object-header-text >< /JUST= LEFT CENTER RIGHT >;

Required Arguments

output-object

  • specifies the name of the ODS output object.

Options

JUST= LEFT CENTER RIGHT

  • specifies the alignment of the object-header-text.

  • LEFT

    • aligns the object-header-text with the left margin.

  • CENTER

    • aligns the object-header-text in the center between the left and right margins.

  • RIGHT

    • aligns the object-header-text with the right margin.

n

  • specifies the relative line that contains the note.

  • Default: If you omit n , SAS assumes a value of 1. Therefore, you can specify OBBNOTE or OBBNOTE1 for the first text line.

  • Range: 1- 10

  • Tip: The OBBNOTE line with the highest number appears on the bottom line.

  • Tip: You can create notes that contain blank lines between them. For example, if you specify text with an OBBNOTE statement that is followed by an OBBNOTE3 statement, then a blank line separates the two lines of text.

object-header-text

  • specifies the text string.

    You can customize object headers by inserting BY variable values (#BYVALn), BY variable names (#BYVARn), or BY lines (#BYLINE) into object headers that are specified in PROC DOCUMENT steps. After you specify the object header text, you can embed the items at the position where you want them to appear. For more information, see 'The DOCUMENT PROCEDURE and BY-Groups' on page 233.

  • Requirement: All object-header-text must be enclosed in quotation marks.

  • Caution: If no object-header-text is specified, then the OBBNOTE statement deletes all existing header notes for the specified output object only.

OBFOOTN Statement

Creates or modifies lines of text at the bottom of the page on which the output object is displayed

Restriction: You can print up to ten lines of text.

Tip: The OBFOOTN statement is similar to the global FOOTNOTE statement.

Featured In: Example 3 on page 253

OBFOOTN < n > output-object < 'text' >;

Required Arguments

output-object

  • specifies the ODS output object.

Options

n

  • specifies the relative line that contains the footnote.

  • Range: 1-10

  • Tip: The OBFOOTN line with the highest number appears on the bottom line. If you omit n , SAS assumes a value of 1. Therefore, you can specify OBFOOTN or OBFOOTN1 for the first text line.

  • Tip: You can create footnotes that contain blank lines between them. For example, if you specify text with an OBFOOTN statement that is followed by an OBFOOTN3 statement, then a blank line separates the two lines of text.

text

  • specifies the text string.

    You can customize footnotes by inserting BY variable values (#BYVALn), BY variable names (#BYVARn), or BY lines (#BYLINE) into footnotes that are specified in PROC DOCUMENT steps. After you specify the text, you can embed the items at the position where you want them to appear. For more information, see 'The DOCUMENT PROCEDURE and BY-Groups' on page 233.

  • Requirement: All text strings must be enclosed by quotation marks.

  • Caution: If you use the OBFOOTN statement without a text string, then all existing footnotes for the specified output object are deleted.

OBPAGE Statement

Creates or deletes a page break for an output object

Featured In: Example 3 on page 253

OBPAGE output-object < /DELETE AFTER >;

Required Arguments

output-object

  • specifies the name of the output object.

Without Options

If no options are specified, then the OBPAGE statement inserts a page break before an output object.

Options

AFTER

  • inserts a page break after an output object.

  • Tip: To delete a page break after an output object, you must use the AFTER option as well as the DELETE option.

DELETE

  • removes the page break for an output object.

OBSTITLE Statement

Creates or modifies subtitles

Featured In: Example 3 on page 253

OBSTITLE < n > output-object < 'text' >< /JUST= LEFT CENTER RIGHT >;

Required Arguments

output-object

  • specifies the ODS output object.

Options

JUST= LEFT CENTER RIGHT

  • specifies the alignment of the text string.

  • LEFT

    • aligns the text string with the left margin.

  • CENTER

    • aligns the text string in the center between the left and right margins.

  • RIGHT

    • aligns the text string with the right margin.

n

  • specifies the relative line that contains the subtitle .

  • Range: 1-10

  • Tip: The OBSTITLE line with the highest number appears on the bottom line. If you omit n , SAS assumes a value of 1. Therefore, you can specify OBSTITLE or OBSTITLE1 for the first text line.

  • Tip: You can create subtitles that contain blank lines between them. For example, if you specify text with an OBSTITLE statement that is followed by an OBSTITLE3 statement, then a blank line separates the two lines of text.

text

  • specifies the text string.

    You can customize subtitles by inserting BY variable values (#BYVALn), BY variable names (#BYVARn), or BY lines (#BYLINE) into subtitles that are specified in PROC DOCUMENT steps. After you specify text, you can embed the items at the position where you want them to appear. For more information, see 'The DOCUMENT PROCEDURE and BY-Groups' on page 233.

  • Requirement: All text strings must be enclosed in quotation marks.

  • Caution: If no arguments are specified, then the OBSTITLE statement deletes all existing subtitles for the specified output object only.

OBTITLE Statement

Creates or modifies title lines for the output

Tip: The OBTITLE is similar to the global TITLE statement.

Featured In: Example 3 on page 253

OBTITLE < n > output-object < 'text' >;

Required Arguments

output-object

  • specifies the name of the output object.

Options

n

  • specifies the relative line that contains the title.

  • Range: 1-10

  • Tip: The OBTITLE line with the highest number appears on the bottom line. If you omit n , SAS assumes a value of 1. Therefore, you can specify OBTITLE or OBTITLE1 for the first text line.

  • Tip: You can create titles that contain blank lines between them. For example, if you specify text with an OBTITLE statement that is followed by an OBTITLE3 statement, then a blank line separates the two lines of text.

text

  • specifies the text string.

    You can customize titles by inserting BY variable values (#BYVALn), BY variable names (#BYVARn), or BY lines (#BYLINE) into output titles that are specified in PROC DOCUMENT steps. After you specify the text, you can embed the items at the position where you want them to appear. For more information, see 'The DOCUMENT PROCEDURE and BY-Groups' on page 233.

  • Requirement: All text strings must be enclosed in quotation marks.

  • Caution: If no text is specified, then the OBTITLE statement deletes all existing titles for the specified output object only.

RENAME Statement

Assigns a different name to a file location or output object

RENAME path-1 TO path-2 ;

Required Arguments

path-1

  • specifies the current file location or output object.

path-2

  • specifies the new name of the file location or output object.

REPLAY Statement

Displays one or more entries to the specified open ODS destination(s)

Default: If you omit the LEVELS= option, then all levels of the file are displayed to all open destinations.

Featured In: Example 2 on page 248 and Example 3 on page 253

REPLAY < path < , path-2, ...path-n >> </< LEVELS= value ALL >< DEST= ( ODS-destination(s) ) >>;

Options

ACTIVEFOOTN

  • specifies that footnotes that are active in a SAS session will override the footnotes that are stored in an ODS document.

  • Alias: ACFOOTN

ACTIVETITLE

  • specifies that titles that are active in a SAS session will override the titles that are stored in an ODS document.

  • Alias: ACTITLE

DEST= ( ODS-destination(s) )

  • specifies one or more ODS destinations where you want your output objects to be displayed.

  • Requirement: When you specify the DEST= option, you must surround the ODS destinations with parentheses and separate each destination with a blank space. For example, DEST=(HTML RTF LISTING)

  • Tip: When you specify only one destination, you do not need to use parentheses. For example, DEST=HTML

  • See Also: For information about ODS destinations, see SAS Output Delivery System: User's Guide .

LEVELS= ALL value

  • specifies the depth of the path.

  • ALL

    • specifies that all levels of the path are displayed to all open destinations.

  • value

    • specifies the numeric value of the level.

path

  • specifies the location of an entry. An entry can be one or more file locations, links, or output objects.

  • Requirement: When you specify more than one path, separate the paths with a comma.

SETLABEL Statement

Assigns a label to the specified path

SETLABEL path 'label' ;

Required Arguments

label

  • specifies the text of the label. You can customize labels by inserting BY variable values (#BYVAL), BY variable names (#BYVAR), or BY lines (#BYLINE) into labels that are specified in PROC DOCUMENT steps. For more information, see 'The DOCUMENT PROCEDURE and BY-Groups' on page 233.

  • Requirement: The label must be enclosed in quotation marks.

path

  • specifies the location of a link, output object, or file location.

UNHIDE Statement

Enables the output of a hidden entry to be displayed when it is replayed

UNHIDE path < , path-2, ...path-n >;

Required Arguments

path

  • specifies the location of a link, output object, or file.

  • Requirement: When you specify more than one path, separate the paths with a comma.

The DOCUMENT PROCEDURE and BY-Groups

You can customize labels, titles, and footnotes with the following statements by inserting BY variable values (#BYVAL), BY variable names (#BYVAR), or BY lines (#BYLINE) in labels that are specified in PROC DOCUMENT steps:

  • OBANOTE statement

  • OBBNOTE statement

  • OBFOOTN statement

  • OBSTITLE statement

  • OBTITLE statement

  • SETLABEL statement

Note: The #BYVAL, #BYVAR, and #BYLINE substitutions will only show up for replayed output objects that belong to a BY group. Examples of output objects that do not belong to a BY group are:

  • data sets that are imported into a document with IMPORT statement

  • notes created with the NOTES statement

To create these substitutions, embed the items in the specified object text string at the position where you want the substitution text to appear. The #BYVAL, #BYVAR, and #BYLINE substitutions have the following form:

#BYVAL n #BYVAL( variable-name )

  • substitutes the current value of the specified BY variable for #BYVAL in the text string and displays the value in the label.

    Follow these rules when you use #BYVAL in a valid statement of a PROC DOCUMENT step:

    • Specify the variable that is used by #BYVAL in the BY statement.

    • Insert #BYVAL in the specified text string at the position where you want the substitution text to appear.

    • Follow #BYVAL with a delimiting character, either a space or other nonalphanumeric character (for example, a quotation mark) that ends the text string.

    • If you want the #BYVAL substitution to be followed immediately by other text, with no delimiter , use a trailing dot (as with macro variables ).

    • Specify the variable with one of the following:

  • n

    • specifies which variable in the BY statement that #BYVAL should use. The value of n indicates the position of the variable in the BY statement.

    • Example: #BYVAL2 specifies the second variable in the BY statement.

  • variable-name

    • names the BY variable.

    • Example: #BYVAL(YEAR) specifies the BY variable, YEAR.

    • Tip: Variable-name is not case sensitive.

    • Requirement: You must enclose variable-name in parentheses.

#BYVAR n #BYVAR( variable-name )

  • substitutes the name of the BY variable or label that is associated with the variable (whatever the BY line would normally display) for #BYVAR in the text string and displays the name or label.

    Follow these rules when you use #BYVAR in a valid statement of a PROC DOCUMENT step:

    • Specify the variable that is used by #BYVAR in the BY statement.

    • Insert #BYVAR in the specified text string at the position where you want the substitution text to appear.

    • Follow #BYVAR with a delimiting character, either a space or other nonalphanumeric character (for example, a quotation mark) that ends the text string.

    • If you want the #BYVAR substitution to be followed immediately by other text, with no delimiter, use a trailing dot (as with macro variables).

    • Specify the variable with one of the following:

      • n

        • specifies which variable in the BY statement that #BYVAR should use. The value of n indicates the position of the variable in the BY statement.

        • Example: #BYVAR2 specifies the second variable in the BY statement.

      • variable-name

        • names the BY variable.

        • Example: #BYVAR(SITES) specifies the BY variable SITES.

        • Tip: Variable-name is not case sensitive.

        • Requirement: You must enclose variable-name in parentheses.

#BYLINE

  • substitutes the entire BY line without leading or trailing blanks for #BYLINE in the text string and displays the BY line in the label.




SAS 9.1 Output Delivery System. Users Guide
SAS 9.1 Output Delivery System Users Guide
ISBN: 1590472187
EAN: 2147483647
Year: 2004
Pages: 99
Authors: SAS Institute

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net