Chapter Contents

Previous

Next
SAS/FSP Software Procedures Guide

Browsing and Editing SAS Data Sets

In the FSVIEW procedure, observations are displayed in the FSVIEW window. The FSVIEW Window identifies important features of the FSVIEW window.

The FSVIEW Window

[IMAGE]

By default,

Unless you use a WHERE statement in conjunction with the PROC FSVIEW statement, all observations in the data set are available for browsing or editing. The FSVIEW procedure ignores the FIRSTOBS= and OBS= system options.

CAUTION:
The FSVIEW procedure edits a SAS data set in place. The FSVIEW procedure does not leave an unedited copy of the original. If you need to preserve a copy of the original data, be sure to copy the data set before you begin editing.  [cautionend]


How the Control Level Affects Editing

The editing behavior of the FSVIEW procedure depends on which control level you select when the data set is opened. The control level is the degree to which the procedure can restrict access to the data set.

The FSVIEW procedure supports two levels of control:
record locks only the observation that is currently being edited. With this control level, you can open multiple FSVIEW windows for browsing or editing the same data set. Other users can edit the same data set simultaneously.
member locks the entire data set. No other window or user can open the data set while this control level is in effect.

By default, the FSVIEW procedure selects record-level control when it opens a SAS data set. You can specify the control level with the MODIFY command in the FSVIEW window, or by using the CNTLLEV= data set option with the data set name in the PROC FSVIEW statement, FSVIEW command, or BROWSE or EDIT command. The CNTLLEV= data set option is described in SAS Language Reference: Dictionary.


Editing with Record-level Control

When record-level control is selected, you must lock an observation for editing before you can change variable values in that observation. To lock an observation, move the cursor to the line for the desired observation and press ENTER. The line is highlighted to indicate that it is locked. (You can use the HI command to control which type of highlighting is used.) Once the observation is locked, you can change values in the variable columns. Scroll right or left to display additional columns. If you have defined formulas for any data set variables, the values of the variables that have formulas are updated only when observations are locked.

The lock on the current observation is released when you lock a different observation for editing. In addition, the lock is released when any of the following commands cause the currently locked observation to scroll out of the window:

FORWARD n
BACKWARD AUTOADD
TOP DUP
BOTTOM

The lock is always released when you issue any of the following commands:

DELETE
SORT
WHERE


Editing with Member-level Control

When the MEMBER control level is selected, the FSVIEW procedure obtains exclusive control over the data set. In this case, all observations are available for editing. It is not necessary to select an individual observation before editing; simply move the cursor to the desired observation and enter the new value in the desired variable column.


Opening Multiple FSVIEW Windows

After entering the FSVIEW procedure, you can use the BROWSE, EDIT, and NEW commands to open additional FSVIEW windows to concurrently browse or edit other SAS data sets. The multiple FSVIEW windows may overlap visually, but each is completely independent of the others.

Opening additional FSVIEW windows within the current FSVIEW session by using the EDIT or BROWSE commands consumes fewer computer resources than starting additional FSVIEW sessions with the FSVIEW command.

If you invoke the FSVIEW procedure with a PROC FSVIEW statement, some of the PROC FSVIEW statement options affect the behavior of the additional FSVIEW windows:


FSVIEW Window Commands

In addition to the global commands that are discussed in SAS/FSP Software Global Commands, you can issue the following commands when editing a data set with the FSVIEW procedure. When browsing, you can use all the following commands except those that are identified as editing commands:
Scrolling

n
=variable
BACKWARD <n | HALF | PAGE | MAX>
BOTTOM
FORWARD <n | HALF | PAGE | MAX>
HSCROLL n
LEFT <n | MAX>
RIGHT <n | MAX>
SMOOTH <ON | OFF>
TOP
VSCROLL n | HALF | PAGE

Managing the Data Set

AUTOSAVE <n>
BROWSE data-set <FORMULA=SAS-catalog<.formula-entry>>
CANCEL
CREATE data-set <REPLACE> <variable-list | ALL | ?>
EDIT data-set <FORMULA=SAS-catalog<.formula-entry>>
END
MODIFY <RECORD|MEMBER>
NEW data-set <LIKE=data-set>
<FORMULA=SAS-catalog<.formula-entry>>
SAVE
WHERE <<ALSO> expression> <UNDO | CLEAR>

Editing the Data Set

(The commands in this group are valid only when the FSVIEW window is opened for editing.)

AUTOADD | ADD <ON | OFF>
CURSOR <variable>
DELETE | DEL <obs <... obs-n>>
DUP <n <obs>>
INITIAL <obs | CLEAR>
PROTECT ON | OFF <variable <... variable-n>>
SORT <ASCENDING | DESCENDING> variable <... <ASCENDING | DESCENDING> variable-n>

Managing Formulas

DEFINE <variable-name <$> <(<format><,<informat><,label>>)><=formula>>
FORMULA <formula-name>
RESET <ALL | variable <... variable-n>>
REVIEW
SAVE FORMULA <formula-name>

Changing the Display

COLOR area color <highlight>
DROP <variable <... variable-n>>
FORMAT variable-list 'format' <... variable-list-n 'format-n'>
HI <ON | OFF> | <color <highlight>> | <RESET <ALL>>
INFORMAT variable-list 'informat' <... variable-list-n 'informat-n'>
MOVE variable | variable-range <target-variable>
RENAME current-variable-name new-variable-name
SETWSZ <CLEAR>
SHOW ID | VAR variable <...variable-n>

Other

KEYS
OBS
PARMS


Command Descriptions

Here are descriptions of the FSVIEW window commands:

n
scrolls the FSVIEW window vertically so that the specified observation occupies the top line. Type the desired observation number on the command line, then press ENTER. You receive an error message if you specify a value that is greater than the highest observation number.

The n command is still valid when ID variables are used in place of observation numbers to identify observations. However, the command is not valid when the engine that is being used to read the data set does not support access by observation number. When an engine does not support observation numbers, the column label is ROW instead of OBS. The command also is not valid while a permanent or temporary WHERE clause is in effect.

=variable
scrolls the FSVIEW window horizontally so that the column for the specified variable is visible.

AUTOADD <ON | OFF>
ADD <ON | OFF>
(editing command; not valid while browsing a data set)

turns the autoadd feature on or off. While the autoadd feature is on, a new observation is always displayed. If observation numbers are used in the ID column, the new observation is identified with the word NEW.

Note:   The AUTOADD command is not permitted if the FSVIEW session is initiated with a PROC FSVIEW statement that includes the NOADD option.  [cautionend]

By default, all values in the new observation are missing. You can use the INITIAL command to store the current contents of an existing observation; the stored values are then copied into new observations when they are displayed by the autoadd feature.

By default, the cursor is positioned on the column for the leftmost variable in the FSVIEW window whenever a new observation is displayed. You can use the CURSOR command to specify the variable on which the cursor is positioned when the new observation is displayed.

The new observation is not actually added to the displayed data set until you add values and press ENTER, or until you issue any FSVIEW command other than LEFT or RIGHT. While entering values, you can use the LEFT and RIGHT commands to scroll among the variable columns without adding the new observation to the data set. After the observation is added, another new observation is displayed.

If the new observation has not been modified when you issue the END command, the observation is not added to the data set.

When the AUTOADD command is used without the ON or OFF arguments, it acts as a toggle, turning the autoadd feature on if it is currently off or off if it is currently on.

AUTOSAVE <n>
specifies how frequently the FSVIEW procedure automatically saves the data set. The n value determines how many modifications must be made before an automatic save is performed. By default, the procedure saves the data set automatically whenever 25 observations have been modified since the last save.

To check the current value of AUTOSAVE parameter, issue the AUTOSAVE command without specifying an n value.

You can change the default AUTOSAVE value for an FSVIEW application by changing the value in the Autosave value field in the FSVIEW Parameters window. See Customizing the FSVIEW Environment for details.

Regardless of the AUTOSAVE value, you can save the data set at any time using the SAVE command.

BACKWARD <n | HALF | PAGE | MAX>
scrolls vertically toward the top of the window. The following scroll amounts can be specified:
n scrolls upward by the specified number of observations.
HALF scrolls upward by half the number of lines in the window.
PAGE scrolls upward by the number of lines in the window.
MAX scrolls upward until the first observation is at the top of the window.

If the scrolling increment is not explicitly specified, the window is scrolled by the amount specified in the VSCROLL parameter. The default VSCROLL amount is HALF.

BOTTOM
scrolls forward until the last observation in the data set is displayed at the bottom of the window.

You can interrupt the BOTTOM scroll operation before the last observation is reached. This feature is useful when you want to halt a scroll request while you are browsing or editing a large data set. To halt a BOTTOM scroll operation that is in progress, press the interrupt key or key combination for your system. The FSVIEW procedure displays a requestor window that gives you the options of canceling or resuming the scrolling operation.

Note:   The key or key combination that is used to interrupt an active process depends on your host operating system and terminal device. For example, some systems have a key labeled BREAK or ATTENTION (or ATTN). Other systems use a combination of the CTRL key and another key. Refer to your host documentation to determine the interrupt key or key combination for your host operating system and terminal device.  [cautionend]

BROWSE data-set<(data-set-options)> <FORMULA=SAS-catalog<.formula-entry>>
opens another FSVIEW window and displays the specified SAS data set for browsing. The current FSVIEW window remains open, but the new FSVIEW window becomes the active window. All FSVIEW procedure browsing commands are valid in the new window (except for those that are disabled with PROC FSVIEW statement options). When you use the END command to close the new window, you return to the FSVIEW window from which the BROWSE command was issued.

The additional FSVIEW window may overlay the current one. To control where the additional window appears, use the WREGION command before issuing the BROWSE command. You can use the SWAP command to move among concurrent FSVIEW windows.

You can use the MODIFY command to change the new window from browsing to editing, unless the procedure is initiated by a PROC FSVIEW statement that includes the BROWSEONLY option.

You can add data set options following the data set name. The options must be enclosed in parentheses. The FIRSTOBS= and OBS= options are ignored; all other data set options are valid. Refer to SAS Language Reference: Dictionary for a list and descriptions of data set options.

You can add the FORMULA= argument to the BROWSE command to associate a FORMULA entry with the displayed data set. The syntax for the FORMULA= argument is the same as for the PROC FSVIEW statement's FORMULA= option.

CANCEL
closes the FSVIEW window and saves the data set without recording any updated information in the associated FORMULA entry. (Changes to variable values are recorded; changes to formulas and to other general parameters are not.) If only one FSVIEW window is open in the current FSVIEW session, the CANCEL command also ends the FSVIEW procedure.

COLOR area color<highlight>
sets the color and highlighting attributes of different areas of the window. You can specify the following areas:
VAR variable value columns (except for ID variables)
VARNAME variable names that are used as column headings (except for ID variables)
ID ID value columns (or the observation number column if ID variables are not used)
IDNAME ID variable names that are used as column headings (or the heading of the observation number column if ID variables are not used).

The following values are valid for the color argument:

BLACK CYAN MAGENTA RED
BLUE GRAY ORANGE WHITE
BROWN GREEN PINK YELLOW

The following values are valid for the highlight argument:

H (high intensity) U (underlined)
R (reverse video) B (blinking)

In addition to the areas specific to the FSVIEW procedure, you can specify colors and attributes for the following FSVIEW window areas by using the global COLOR command:

BACKGROUND BORDER MESSAGE
BANNER COMMAND

Refer to the online Help for base SAS software for more information on the COLOR command.

CREATE data-set<(data-set-options)> <REPLACE> <variable-list | ALL | ?>
creates a new SAS data set, using some or all of the variables from the data set that is currently displayed. The new data set duplicates both the structure and contents of the displayed data set. You can select which variables are included in the new data set in any of the following ways:

Both computed variables and data set variables can be selected. Computed variables in the displayed data set become data set variables in the created data set.

You can add data set options following the data set name. The options must be enclosed in parentheses. Refer to SAS Language Reference: Dictionary for a list and descriptions of data set options.

By default, the CREATE command fails with an error message if the named data set already exists. If you want the new data set to replace an existing data set that has the same name, specify the REPLACE option. If you use the REPLACE option, it must precede the variable name arguments.

CURSOR <variable>
(editing command; not valid while browsing a data set)

specifies the variable column on which the cursor is positioned when a new observation is displayed. (New observations are created by the autoadd feature or by the DUP command.) By default, the cursor is positioned on the leftmost variable column in the FSVIEW window when the new observation is added.

You can specify the desired variable name as an argument for the CURSOR command, or you can type CURSOR on the command line, position the cursor on the desired variable column, and press ENTER.

DEFINE <variable-name <$> <(<format><,<informat><,label>>)> <=formula>>
defines a formula for a computed variable or for an existing data set variable.

When you use the DEFINE command alone or with only the variable-name argument, the FSVIEW Define window is opened. In this window you can enter all the information necessary to define the formula. You can also use this form of the command to open the FSVIEW Define window to edit an existing formula. See Defining Formulas for more information on using the FSVIEW Define window.

If the variable name that you specify does not exist in the displayed data set, the FSVIEW procedure creates a computed variable. When creating a computed variable, the procedure assumes by default that the variable is numeric. To create a character variable, add the $ argument following the variable name if you are specifying the formula in the DEFINE command argument. (Do not use the $ argument if you want to open the FSVIEW Define window.)

You can supply the formula as an argument with the DEFINE command. In this case, the FSVIEW Define window is not opened. Separate the formula from the variable name with an equal sign (=).

Formulas are not limited to SAS expressions. They can also include any valid SAS Component Language (SCL) functions or statements except those that are valid only in SAS/AF software and the following statements:
CONTROL (except for CONTROL ENTER)
CURSOR
ERRORON
ERROROFF
PROTECT
UNPROTECT
Refer to SAS Component Language: Reference for details about including SCL elements in FSVIEW formulas.

You can specify a format, informat, and label for the variable in the DEFINE command. The arguments for these values must be enclosed in parentheses and must appear before the equal sign that begins the formula definition. The values must be specified in the order format, informat, label. You can omit any of the values as long as you include the necessary commas.

If you omit the format argument when defining a computed variable, the default format is BEST12. for numeric variables or $8. for character variables. If you omit the informat argument, the default informat is 12. for numeric variables and $8. for character variables.

You can also use the format, informat, and label arguments to change the format, informat, or label of an existing variable. For an existing variable, you can supply these arguments without supplying a formula. (The arguments must still be enclosed in parentheses.) For data set variables, these arguments change the format, informat, and label that are recorded in the FORMULA entry, but they do not affect any format, informat, or label for the variable that is recorded in the data set itself.

If the cursor is positioned on a variable column when the DEFINE command is issued, the column for the new computed variable appears immediately to the right of the column on which the cursor was positioned. Otherwise, the column for the new computed variable appears to the right of the displayed variable columns.

DELETE <obs <... obs-n>>
DEL <obs <... obs-n>>
(editing command; not valid while browsing a data set)

deletes one or more observations from the data set you are editing.

CAUTION:
The DELETE command deletes observations from the displayed data set, not just from the FSVIEW window. You cannot recover the contents of a deleted observation.  [cautionend]

Note:   The DELETE command is not permitted if the FSVIEW session is initiated with a PROC FSVIEW statement that includes the NODELETE option.  [cautionend]

The behavior of the DELETE command depends on the control level at which the data set is currently opened for editing.

For member-level control
To delete a single observation, follow the DELETE command with the observation number of the observation to be deleted. You can also type DELETE (or DEL) on the command line, position the cursor on the observation to be deleted, and press ENTER.

To delete multiple observations, follow the DELETE command with a list of observation numbers. Separate the observation numbers with at least one space. For example, issue the following command to delete observations 5 and 10:

delete 5 10

To delete a range of observations, specify the first and last observation numbers of the range, separated by a dash. For example, the following command deletes all observations between 5 and 10, inclusive:

delete 5-10

For record-level control
You can delete only one observation at a time, and you must lock the observation before you can delete it. Either follow the DELETE command with the observation number for the locked observation to be deleted or type DELETE (or DEL) on the command line, position the cursor on the locked observation to be deleted, and press ENTER.

DROP <variable <...variable-n>>
excludes one or more variables from the FSVIEW window. The DROP command affects only the display, not the actual data set.

If you issue the DROP command without arguments, the Select Table Variables window is opened for you to select the variables to be dropped. Refer to Selecting Variables for FSVIEW Operations for more information on using the Select Table Variables window.

To exclude a single variable, follow the DROP command with the name of the variable to be dropped. Alternatively, you can type DROP on the command line, position the cursor on the variable column to be dropped, and press ENTER.

To exclude multiple variables, follow the DROP command with a list of variable names. Separate the variable names with at least one space. For example, the following command drops the variables X and Z from the display:

drop x z

You can indicate a range of variables by specifying the first and last variables to be dropped, separated by a dash. For example, the following command drops all the variables between X and Z, inclusive:

drop x-z

Note:   At least one variable, in addition to any ID variables specified, must remain displayed.  [cautionend]

Use the SHOW command to redisplay dropped variables.

DUP <n <obs>>
(editing command; not valid while browsing a data set)

copies the specified observation n times and adds the new observation(s) to the displayed data set. The FSVIEW window is automatically scrolled forward so that the new observations appear at the top of the window.

Note:   The DUP command is not permitted if the FSVIEW session is initiated with a PROC FSVIEW statement that includes the NOADD option.  [cautionend]

You can select the observation to copy by supplying its number as the obs argument in the DUP command. To specify the obs argument, you must also specify the n argument (the number of times you want the observation duplicated). For example, the following command duplicates observation 5 one time:

dup 1 5

Alternatively, you can select the observation to copy by typing DUP on the command line, positioning the cursor on the desired observation, and pressing ENTER. By default, the observation is duplicated once. To duplicate the same observation again, leave the cursor on the command line and issue the DUP command again. Alternatively, you can follow the DUP command with the desired number of copies. For example, if the cursor is on the command line, the following command duplicates the most recently duplicated observation three times:

dup 3

If the cursor is positioned on an observation, then that observation is duplicated three times.

By default, the cursor is positioned on the leftmost displayed variable column of the first added observation. You can use the CURSOR command to select a particular variable to which the cursor is moved when the duplicate observation is displayed.

EDIT data-set<(data-set-options> <FORMULA=SAS-catalog<.formula-entry>>
opens another FSVIEW window and displays the specified data set for editing. The current FSVIEW window remains open, but the new FSVIEW window becomes the active window. All FSVIEW window commands are valid in the new window. When you use the END command to close the new window, you return to the FSVIEW window from which the EDIT command was issued.

Note:   The EDIT command is not valid if the FSVIEW session is initiated by a PROC FSVIEW statement that includes the BROWSEONLY option.  [cautionend]

The additional FSVIEW window may overlay the current one. To control where the additional window appears, use the WREGION command before issuing the EDIT command. You can use the SWAP command to move among concurrent FSVIEW windows.

You can add data set options following the data set name. The options must be enclosed in parentheses. The FIRSTOBS= and OBS= options are ignored; all other data set options are valid. Refer to SAS Language Reference: Dictionary for a list and descriptions of data set options.

END
saves any changes that you make to the displayed data set (if it is open for editing), updates the FORMULA entry (if a formula name or formula catalog has been specified), closes the current FSVIEW window, and returns to the previous FSVIEW window.

If only one FSVIEW window is open, the END command ends the FSVIEW procedure.

FORMAT variable-list 'format' <... variable-list-n 'format-n'>
changes the format of one or more variables for display purposes only. The FORMAT command does not change any formats that are stored with the variables in the data set. Formats that are specified in the FORMAT command take precedence over formats that have been defined in the displayed data set or that are assigned in FORMAT statements.

The format name can be any SAS format, or it can be a custom format that you have defined with the FORMAT procedure. The format name must be enclosed in quotes.

You can specify multiple variables either individually or as a range. Separate two variable names with a dash to indicate a range. For example, the following command changes the display formats of variables X and Z only:

format x z 'date7.'

The following command changes the display format of all the variables between X and Z, inclusive:

format x-z 'date7.'

You can assign multiple formats in a single FORMAT command. For example, the following command assigns different display formats to the variables X and Z:

format x 'date7.' z 'monyy5.'

Note:   Be aware that the format you assign a variable affects the informats you can assign with the INFORMAT statement. For example, suppose the data set that is displayed by the FSVIEW procedure contains a variable AMOUNT that is assigned the format DOLLAR10.2 but an informat of 10.2. Because of the format, values in the AMOUNT column are displayed with commas and a leading dollar sign, so the value 1250 would be displayed as $1,250.00. However, if you edit this value (for example, changing it to $1,150.00) and press ENTER, an error condition occurs. The 10.2 informat does not permit the dollar sign ($) or comma characters in entered values. An appropriate informat for this variable is COMMA., which does permit these characters.  [cautionend]

To remove a format assignment from the FORMULA entry so that the format that is defined in the data set is used, issue a FORMAT command that specifies the variable name but no format name. For example, to cancel the format for the variable X that is stored in the FORMULA entry, issue the following command in the FSVIEW window:

format x

FORMULA <formula-name>
reads in a FORMULA entry.

The general form of the formula-name argument is

<<libref.>catalog-name.>entry-name<.FORMULA>
You can specify a one-, two-, three-, or four-level name:

If you omit the formula-name argument altogether, the procedure looks for an entry that has the default name. The default formula name is the name that was used in the previous FORMULA command. If no previous FORMULA command has been issued, then the default name is the name that was specified in the FORMULA= option of the PROC FSVIEW statement or in the formula-name argument of the FSVIEW command when the procedure was initiated. If no formula name was specified when the procedure was invoked, then the name of the displayed data set is used as the default FORMULA entry name. The procedure looks for the default entry in the current formula catalog. If no formula catalog has previously been specified, then the procedure looks for the default entry in your personal PROFILE catalog.

If the specified FORMULA entry exists, it replaces the FORMULA entry that is currently being used for the FSVIEW window. All current formula definitions are removed.

If the specified entry does not currently exist, then no entry is read in and a warning message is issued. An entry that has the specified name is created when you issue an END command to close the FSVIEW window, or when you issue a SAVE FORMULA command without specifying another formula name.

The FORMULA command is valid even if you do not use the FORMULA= option in the PROC FSVIEW statement or the formula-name argument in the FSVIEW command when you initiate the FSVIEW session.

FORWARD <n | HALF | PAGE | MAX>
scrolls vertically toward the bottom of the window. The following scroll amounts can be specified:
n scrolls downward by the specified number of observations.
HALF scrolls downward by half the number of lines in the window.
PAGE scrolls downward by the number of lines in the window.
MAX scrolls downward until the last observation is at the bottom of the window.

Note:   See the discussion of the BOTTOM command for details about the restrictions that apply.  [cautionend]

If the scrolling increment is not explicitly specified, the window is scrolled by the amount that is specified in the VSCROLL parameter. The default VSCROLL amount is HALF.

Note:   Regardless of the specified scroll increment, the FSVIEW procedure does not scroll beyond the last observation in the data set.  [cautionend]

HI <ON | OFF>
HI <color <highlight>>
HI <RESET <ALL>>
controls the highlighting status of an individual row or of the entire window, or sets the highlighting characteristics for an individual row or for the entire window.

To turn highlighting on for an unhighlighted row or to turn it off for a highlighted row, use the HI command. Type HI on the command line, position the cursor on the row that you want the command to affect, and press ENTER (or position the cursor on the desired row and press the function key to which the HI command has been assigned).

To turn highlighting on for all unhighlighted rows, use the HI ON command. To turn highlighting off for all highlighted rows, use the HI OFF command.

To set default highlighting characteristics for the entire window, follow the HI command with the desired color and (optionally) an attribute. The following values are valid for the color argument:

BLACK CYAN MAGENTA RED
BLUE GRAY ORANGE WHITE
BROWN GREEN PINK YELLOW

The following values are valid for the highlight argument:

H (high intensity) U (underlined)
R (reverse video) B (blinking)

To change the highlighting characteristics for an individual row, type HI on the command line, followed by the new color and (optionally) the new attribute, position the cursor on the desired row, and then press ENTER.

To reset all rows to the default color and highlighting attribute, use the HI RESET ALL command.

To reset the highlight characteristics of an individual row to the default, type HI RESET on the command line, position the cursor on the desired row, and then press ENTER.

HSCROLL n
sets the default horizontal scrolling amount for the LEFT and RIGHT commands. For n, specify the number of variable columns to scroll by. The default amount is one column.

INFORMAT variable-list 'informat' <... variable-list-n 'informat-n'>
changes the informat of one or more variables in the FSVIEW window. The INFORMAT command does not change any informats that are stored with the variables in the data set. Informats that are specified with the INFORMAT command take precedence over informats that are defined in the data set or assigned in INFORMAT statements.

The informat name can be any SAS informat, or it can be a custom informat that you have defined with the FORMAT procedure. The informat name must be enclosed in quotes.

You can list multiple variable names individually or as a range. Separate two variable names with a dash to indicate a range. For example, the following command selects the informats for the variables X and Z only:

informat x z 'date7.'

The following command selects the informat for all the variables between X and Z, inclusive:

informat x-z 'date7.'

You can also assign multiple informats in a single INFORMAT command. For example, the following command selects different informats for the variables X and Z:

informat x 'date7.' z 'monyy5.'

Note:   When using informats with the FSVIEW procedure, you should make sure the informats that you assign to variables are compatible with the formats for those variables. That is, the output that the format produces should be valid input for the informat. Otherwise, you complicate the process of editing the values of variables. For example, suppose the data set that is displayed by the FSVIEW procedure contains a variable AMOUNT that is assigned the informat 10.2 and the format DOLLAR10.2. Because of the format, values in the AMOUNT column are displayed with commas and a leading dollar sign, so the value 1250 would be displayed as $1,250.00. However, if you edit this value (for example, changing it to $1,150.00) and press ENTER, an error condition occurs. The 10.2 informat does not permit the dollar sign ($) or comma characters in entered values. An appropriate informat for this variable is COMMA., which does permit these characters.  [cautionend]

To remove an informat assignment from the FORMULA entry so that the informat that is defined the data set is used, issue an INFORMAT command that specifies the variable name but no informat name. For example, to cancel the informat for the variable X that is stored in the FORMULA entry, issue the following command in the FSVIEW window:

informat x

INITIAL <obs | CLEAR>
(editing command; not valid while browsing a data set)

selects an observation whose contents are used as initial values for added observations. By default, all variables in a new observation that is added by the autoadd feature are initialized with missing values. You can use this command to record the current variable values from an existing observation for use as initial values for new observations.

The values of the selected observation are recorded in the FORMULA entry. The recorded values are then used to initialize autoadded observations. Any subsequent changes that you make to the observation designated in the INITIAL command do not affect the stored values that are used to initialize new observations.

You can identify the desired observation by specifying its observation number as the obs argument in the INITIAL command, or you can type INITIAL on the command line, position the cursor on the desired observation, and press ENTER.

Use the INITIAL CLEAR command to reset the initial variable values for new observations to missing values.

KEYS
opens the KEYS window for browsing and editing function key definitions for the FSVIEW window. Function key definitions are stored in catalog entries of type KEYS.

The default function key definitions for the FSVIEW window are stored in the FSVIEW.KEYS entry in the SASHELP.FSP system catalog. If you are using this default set of key definitions when you issue the KEYS command and you change any key definitions in the KEYS window, a new copy of the FSVIEW.KEYS entry is created in your personal PROFILE catalog (SASUSER.PROFILE, or WORK.PROFILE if the SASUSER library is not allocated). The changes that you make are recorded in your personal copy of the KEYS entry.

LEFT <n | MAX>
scrolls the FSVIEW window to the left in increments of variable columns. The following scroll amounts can be specified:
n scrolls to the left by the specified number of variable columns.
MAX scrolls to the leftmost variable column.

If the LEFT command is used without arguments, the FSVIEW window is scrolled by the amount that is specified in the HSCROLL parameter. The default HSCROLL amount is one column.

MODIFY <RECORD | MEMBER>
UPDATE <RECORD | MEMBER>
changes the FSVIEW window from browsing to editing, or changes the control level of an FSVIEW window that is already open for editing.

Note:   The MODIFY command is not permitted if the FSVIEW session is initiated with a PROC FSVIEW statement that includes the BROWSEONLY option.  [cautionend]

The data set can be opened for editing with either member- or record-level control. (Refer to How the Control Level Affects Editing for more information on control levels.) You can specify a control level by using the RECORD or MEMBER arguments with the MODIFY command. If you do not use either argument, the default is record-level control (unless you use the CNTLLEV=MEMBER data set option with the data set name when you open the FSVIEW window).

When the FSVIEW window is open for editing, you can use the MODIFY RECORD and MODIFY MEMBER commands to change the current control level for the window.

The MODIFY command fails if the specified control level would cause a locking conflict. For example, you cannot specify MODIFY MEMBER if the same data set is open with record-level control in another FSVIEW window.

MOVE variable | variable-range <target-variable>
moves a variable column or a range of variable columns.

Note:   The MOVE command affects only the order of variables in the FSVIEW window, not the actual position of the variables in the data set.  [cautionend]

To move a single variable, type MOVE on the command line, followed by the name of the variable to be moved; then place the cursor on the variable that you want the moved variable to follow and press ENTER.

To move a range of variables, specify the name of the first and last variables of the range, separated by a dash. All variables in the range must be of the same class, either ID or VAR. Indicate the variable that you want the range to follow by specifying the variable name as the target-variable argument. For example, the following command moves the variables VAR1 through VAR3 to the right of the variable VAR6:

move var1-var3 var6

You can also move a range of variables by typing MOVE and the variable range on the command line, positioning the cursor on the desired target variable, and pressing ENTER.

In order to move only one variable and specify the target variable as a command argument, you must supply the name of the moved variable as a range. For example, the following command moves the variable VAR2 after the variable VAR6:

move var2-var2 var6

NEW <(data-set-options)> <LIKE=data-set<(data-set-options)>> <FORMULA=SAS-catalog<.formula-entry>>
opens the FSVIEW NEW window for creating a new data set.

Note:   An error message is returned if the data set that you specify in the NEW command already exists. You cannot use the NEW command to change variable names or attributes in an existing data set.  [cautionend]

In the FSVIEW NEW window you enter the names of your variables, the type, length, and (if desired) a label, format, and informat. See Creating New SAS Data Sets for more information on using the FSVIEW NEW window. After you define the structure of the data set, an additional FSVIEW window is opened for entering values in the new data set.

You can add data set options following the data set name. The options must be enclosed in parentheses. Refer to SAS Language Reference: Dictionary for a list and descriptions of SAS data set options.

You can add the LIKE= option to specify an existing data set whose variable names and attributes are copied into the FSVIEW NEW window when it is opened. The data set name in the LIKE= option can also be followed by a list of data set options.

Note:   If you use the LIKE= option to specify the data set that is currently displayed in the FSVIEW window, and if that data set is opened with member-level control, you receive an error message, and the characteristics of the displayed data set are not copied into the FSVIEW NEW window. The variable names and attributes of a data set cannot be read while the data set is opened with member-level locking. To avoid this problem, you can use the MODIFY RECORD command to change the displayed data set to record-level control before issuing a NEW command with a LIKE= option that specifies the displayed data set.  [cautionend]

You can add the FORMULA= option to specify a formula to be associated with the new FSVIEW window that is opened for the data set. The rules for the formula-name argument are the same as in the FORMULA= option of the PROC FSVIEW statement. See the description of the FORMULA option in PROC FSVIEW Statement for details.

OBS
displays the number of the observation on which the cursor is currently positioned. This is useful when observation numbers are not displayed because an ID variable is used. Type OBS on the command line, position the cursor on an observation, and press ENTER. Or position the cursor on the desired observation and press the function key to which you assigned the OBS command.

PARMS
opens the FSVIEW Parameters window, from which general parameters for the FSVIEW session can be reviewed and modified. Refer to Customizing the FSVIEW Environment for more information on the parameters that can be set in the FSVIEW Parameters window.

PROTECT ON | OFF <variable <...variable-n>>
(editing command; not valid while browsing a data set)

prevents changes from being made to the values in one or more variable columns when the data set is being edited.

You must follow the PROTECT command with either the ON or OFF argument, depending on whether you want to turn the protection feature on or off for the column. You can specify which column you want the command to affect by specifying the variable name as an argument for the command, or by typing PROTECT ON or PROTECT OFF on the command line, positioning the cursor on the desired column, and pressing ENTER.

Note:   You cannot use the PROTECT OFF command to turn off protection for computed variables.  [cautionend]

You can control the protection feature for multiple columns with a single PROTECT command. You can provide a list of variable names, separated by spaces, as arguments for the command, or you can select a range of variable columns by specifying the names of the first and last variables in the range, separated by a dash. For example, the following command turns on protection for the variables X and Z:

protect on x z

The following command turns on protection for all variables between X and Z, inclusive:

protect on x-z

RENAME current-variable-name new-variable-name
changes the name for a specified variable column for the purposes of the FSVIEW window display only. The variable name in the data set is not changed; only the name that is used for the variable column in the FSVIEW window is changed. The new name is stored in a FORMULA entry rather than in the data set itself.

Like the original variable name, the new name is limited to 32 characters. All the other rules for SAS names are also applicable.

If the renamed variable is used in any formulas, the formulas are updated to reflect the new name.

RESET <ALL | variable <... variable-n>>
deletes some or all formula definitions. For computed variables, resetting the formula deletes the variable column from the FSVIEW window.

You can remove the formula definitions for more than one variable with a single RESET command. You can provide a list of variable names, separated by spaces, as arguments for the command, or you can select a range of variables by specifying the names of the first and last variables in the range, separated by a dash. For example, the following command resets formula definitions for the variables X and Z:

reset x z

The following command resets formula definitions for all variables between X and Z, inclusive:

reset x-z

Use the RESET ALL command to remove all current formula definitions.

REVIEW
opens the FSVIEW REVIEW window, in which all current formula definitions are displayed. See Defining Formulas for more information on using the FSVIEW REVIEW window.

If no formulas are currently defined, the FSVIEW REVIEW window is not opened. Instead, a message in the FSVIEW window's message line indicates that no formula definitions exist.

RIGHT <n | MAX>
scrolls the FSVIEW window to the right in increments of variable columns. The following scroll amounts can be specified:
n scrolls to the right by the specified number of variable columns.
MAX scrolls to the rightmost variable column.

If the RIGHT command is used without arguments, the FSVIEW window is scrolled by the amount that is specified in the HSCROLL parameter. The default HSCROLL amount is one column.

SAVE
stores all changes that have been made to the data set since the last time it was saved. See also the AUTOSAVE command.

SAVE FORMULA <formula-name>
stores all current formula definitions, general parameter settings, and FSVIEW window characteristics in a FORMULA entry.

The general form of the formula-name argument is

<<libref.>catalog-name.>entry-name<.FORMULA>
You can specify a one-, two-, three-, or four-level name:

If you omit the formula-name argument altogether, the procedure stores the entry using the default name. The default formula name is the name that was used in the previous FORMULA command. If no FORMULA command has been issued, the default name is the name that was specified in the FORMULA= option of the PROC FSVIEW statement or in the formula-name argument of the FSVIEW command when the procedure was initiated. If no formula name was specified when the procedure was invoked, then the name of the displayed data set is used as the default FORMULA entry name. The procedure stores the default entry in the current formula catalog. If no formula catalog has previously been specified, the procedure stores the default entry in your personal PROFILE catalog.

SETWSZ <CLEAR>
records the current size and position of the FSVIEW window in the FORMULA entry. The SETWSZ CLEAR command removes any previously recorded size and position information.

SHOW ID | VAR variable <...variable-n>
adds dropped variables to the FSVIEW window and controls how they are displayed. Dropped variables are variables that have been excluded from the FSVIEW window by using the DROP command, or variables that were omitted from the VAR and ID statements when the procedure was initiated.

You must follow the SHOW command with an argument that indicates whether the variables are to be displayed as ID variables or as scrolling variables. ID variables remain on the left side of the window as you scroll the other variable columns horizontally.

New scrolling variables are added to the right of existing scrolling variable columns. The first ID variable that you add replaces the observation number column. Additional ID variables are added to the right of existing ID variable columns, before the first scrolling variable column.

Note:   The combined width for all ID variables cannot exceed 53 columns. If a single ID variable exceeds this length, it is truncated to 53 characters. If multiple ID variables are used, then only variables that can be displayed in 53 columns without truncation appear in the FSVIEW window. Any additional ID variables are not visible.  [cautionend]

You can add more than one variable with a single SHOW command. You can provide a list of variable names, separated by spaces, as arguments for the command, or you can specify a range of variable columns by specifying the names of the first and last variables in the list, separated by a dash. For example, the following command adds the variables X and Z as scrolling variables:

show var x z

The following command adds all variables between X and Z, inclusive, as scrolling variables:

show var x-z

In addition to adding variables that are currently dropped from the window, you can use the SHOW command to change current ID variables into scrolling variables and vice versa. For example, suppose that the FSVIEW window currently displays an ID variable that is named PRICE that you want to scroll with the other variables. Use the following command to redefine it as a scrolling variable:

show var price

Similarly, to change a scrolling variable into an ID variable, use the SHOW command to redefine it as an ID variable.

You can also issue the SHOW ID or SHOW VAR commands with no variables specified to open the Select Table Variables window. The Select Table Variables window provides a selection list from which the variables to be added can be chosen. See Selecting Variables for FSVIEW Operations for more information on using the Select Table Variables window.

SMOOTH <ON | OFF>
turns smooth scrolling on and off, which determines how the FSVIEW window behaves when the scrollbar is used. When smooth scrolling is turned on, the contents of the FSVIEW window are refreshed as the thumb of the scrollbar is moved. When smooth scrolling is turned off, the contents of the FSVIEW window are not refreshed until the thumb of the scrollbar is released after it is moved.

When the SMOOTH command is used without the ON or OFF arguments, it acts as a toggle, turning the smooth scrolling feature on if it is currently off or off if it is currently on.

The current state of the smooth scrolling feature is recorded in the FORMULA entry when the entry is saved. The saved state takes effect when the FORMULA entry is loaded.

SORT <ASCENDING | DESCENDING> variable <...<ASCENDING | DESCENDING> variable-n>
(editing command; not valid while browsing a data set)

sorts the data set by the specified variables and saves the data set. If you have deleted any observations from the data set, the remaining observations are renumbered sequentially when you issue the SORT command.

CAUTION:
The SORT command sorts the data set itself, not just the displayed values. The FSVIEW procedure sorts a data set in place. It does not leave an unsorted copy of the original. If you need to preserve a copy of the original data, make a copy of the data set before using the SORT command.

If the KEEP= or DROP= data set options were specified with the PROC FSVIEW statement or FSVIEW command, then only the specified variables will be retained in the data set after it is sorted.  [cautionend]

Note:   The SORT command is not valid while a permanent or temporary WHERE clause is in effect.  [cautionend]

By default, the procedure sorts the data set in ascending order of each specified variable. To sort a data set in descending order of a particular variable, precede the variable name with the DESCENDING option. You must specify the DESCENDING option separately for each variable. For example, the following command sorts the data in descending order by STATE and in descending order by CITY within STATE:

sort descending state descending city
You can also use the ASCENDING option to explicitly indicate the default sorting order.

If the sort fails for any reason, the FSVIEW procedure is immediately terminated in order to preserve the contents of the data set.

If your site or SAS session uses a host sort utility rather than the sort utility that is supplied by the SAS System, you may not be able to use your system's attention key to cancel a sort that is in progress.

TOP
scrolls the FSVIEW window vertically so that the first observation in the data set appears at the top of the window.

You can interrupt the TOP scroll operation before the first observation is reached. This feature is useful when you want to halt a scroll request while browsing or editing a large data set. To halt a TOP scroll operation that is in progress, press the interrupt key or key combination for your system. The FSVIEW procedure displays a requestor window that gives you the options of canceling or resuming the scrolling operation.

Note:   The key or key combination that is used to interrupt an active process depends on your host operating system and terminal device. For example, some systems have a key labeled BREAK or ATTENTION (or ATTN). Other systems use a combination of the CTRL key and another key. Refer to your host documentation to determine the interrupt key or key combination for your host operating system and terminal device.  [cautionend]

UPDATE <RECORD | MEMBER>
See the MODIFY command.

VSCROLL n | HALF | PAGE
sets the default vertical scrolling amount for the FORWARD and BACKWARD commands. The following scroll amounts can be specified:
n scroll by the specified number of lines.
HALF scroll by half the number of lines in the window.
PAGE scroll by the full number of lines in the window.

The default amount is HALF.

WHERE <<ALSO> expression> | <UNDO | CLEAR>
imposes one or more sets of conditions that observations in the data set must meet in order to be displayed. Expression is any valid WHERE expression that includes one or more of the variables in the input data set. Refer to the description of the WHERE statement in SAS Language Reference: Dictionary for details about the operators and operands that are valid in WHERE expressions. Observations that do not satisfy the specified conditions cannot be displayed or edited.

The complete set of conditions is called a temporary WHERE clause. The conditions can be modified or canceled during the FSVIEW session. In contrast, the WHERE statement defines a permanent WHERE clause that cannot be changed or canceled during the FSVIEW session and which is not affected by WHERE commands. See WHERE Statement for details.

The word Where... appears in the upper-right corner of the window whenever a temporary WHERE clause is in effect.

The WHERE command has several forms:

WHERE expression
applies the conditions that are specified in expression as the new temporary WHERE clause, replacing any clause that was previously in effect.

WHERE ALSO expression
adds the conditions that are specified in expression to the existing temporary WHERE clause.

WHERE UNDO
deletes the most recently added set of conditions from the temporary WHERE clause.

WHERE
WHERE CLEAR
cancels the current temporary WHERE clause.

If you edit values in an observation so that it no longer meets the conditions of the WHERE clause, that observation can still be displayed and edited. However, a warning message is printed whenever the observation is displayed, indicating that the observation no longer meets the WHERE conditions.

If you use the ADD or DUP command to add a new observation and then enter values that do not meet the WHERE conditions, that observation cannot be displayed or edited once you scroll to another observation.


Chapter Contents

Previous

Next

Top of Page

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