Chapter Contents |
Previous |
Next |
SAS/FSP Software Procedures Guide |
In the FSEDIT procedure, observations are viewed and edited in the FSEDIT window. By default, this window is opened when you begin an FSEDIT session. If you use the procedure to create a new data set, the FSEDIT window is opened after the structure of the new data set has been defined in the FSEDIT NEW window.
Typical FSEDIT Window shows the features of a typical FSEDIT window. The window includes fields that contain the values of variables in the data set, as well as labels that identify the fields.
By default, the window's title bar includes both the name of the current data set and the current observation number. No observation number is displayed when the engine that is being used to read the data set does not support access by observation number. For example, observation numbers are not displayed when the data set is compressed.
Unless you use a WHERE statement in conjunction with the PROC FSEDIT statement, all observations in the data set are available for editing. The FSEDIT procedure ignores the FIRSTOBS= and OBS= system options.
How the Control Level Affects Editing |
The editing behavior of the FSEDIT procedure depends on which control level is selected when the data set is opened. The control level is the degree to which the procedure can restrict access to the data set.
The FSEDIT procedure supports two levels of control:
record | locks only the observation that is currently being edited. With this control level, you can open multiple FSEDIT windows for browsing or editing the same data set. Using SAS/SHARE software, 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 FSEDIT procedure selects record-level control when it opens a SAS data set. You can specify the control level with the UPDATE command in the FSEDIT window, or by using the CNTLLEV= data set option with the data set name in the PROC FSEDIT statement or in the FSEDIT command. See FSEDIT Window Commands for details about the UPDATE command. The CNTLLEV= data set option is described in SAS Language Reference: Dictionary.
Scrolling |
When the FSEDIT window is opened, an initial observation is displayed for editing. Scroll forward or backward to view other observations.
If an observation contains more variables than can be displayed in the FSEDIT window at one time, the information in each observation is divided into discrete units called screens. Each screen contains as many variable fields as will fit in the FSEDIT window. Scroll right or left to move among the screens to view the additional variables.
Note: The FSEDIT window supports a maximum
of 100 screens per observation. If you attempt to open a data set that has
an extremely large number of variables, such that more than 100 screens would
be required to accommodate all of the variables, then only variables that
fit within 100 screens are displayed. You can use the VAR statement in conjunction
with the PROC FSEDIT statement to restrict the number of variables that are
displayed in the FSEDIT window.
Adding Observations |
There are two ways to add observations to the data set:
The new observation is not actually added to the data set until you move to another observation, save the data set, or end the procedure. You can cancel the observation before it is added to the data set.
Entering and Editing Variable Values |
To enter a value for a variable, simply type the value in the entry field (usually indicated by underscores) that follows the variable name or label. To edit a value, type the new value over the old value.
When an observation is displayed for editing, you can enter values only on the command line and in entry fields. All other areas of the window are protected.
FSEDIT Window Commands |
In addition to the global commands that are discussed in SAS/FSP Software Global Commands, you can use the following commands while editing observations:
Scrolling
| ||||||||||
Searching
| ||||||||||
Editing
Observations
| ||||||||||
Saving Data
| ||||||||||
Creating Letters and
Reports
(These commands are valid only if the LETTER= option is used in the PROC FSEDIT statement.)
| ||||||||||
Other
|
Command Descriptions |
Here are descriptions of the FSEDIT window commands:
This command is not valid when the engine that is being used to read the data set does not support access by observation number or when a permanent or temporary WHERE clause is in effect.
This command has no effect if the FSEDIT window does not use multiple screens.
This command is particularly useful in multiscreen applications and in custom displays.
The new observation is not actually added to the data set until you scroll to another observation, issue a SAVE command, or end the FSEDIT session. You can use the CANCEL or DELETE commands to cancel the new observation before it is added to the data set.
To check the current value of the AUTOSAVE parameter, issue the AUTOSAVE command without specifying an n value.
When creating a FSEDIT application, you can change the default AUTOSAVE value by changing the Autosave value field in the FSEDIT Parms window.
Regardless of the AUTOSAVE value, you can save the data set at any time by using the SAVE command.
Note: Some engines do not support the BOTTOM
command.
Depending on which engine is used, deleted observations may not be physically removed from the data set, even though they are no longer accessible. To remove deleted observations, use a DATA step or any other process, such as the SORT procedure, that re-creates the data set.
Note: Some engines,
such as the V5 engine, do not support deleting observations. In this case,
the DELETE command merely resets all variables in the observation to missing
values.
The duplicate observation is not actually added to the data set until you scroll to another observation, issue a SAVE command, or end the FSEDIT procedure. You can use the CANCEL or DELETE commands to cancel the new observation before it is added to the data set.
If you use the SEND command in the FSLETTER window, fields in the document are filled with the values of corresponding variables from the current FSEDIT observation during the FSLETTER send step. When you end the FSLETTER session, the FSEDIT session resumes.
For more information about creating letters and other documents, refer to The FSLETTER Procedure. See also the LETTER and SEND commands.
variable-name comparison-operator search-value |
= | ^= or ¬= | > | >= | < | <= |
EQ | NE | GT | GE | LT | LE |
The following restrictions apply to the search-value value:
Raleigh
:
find city=raleighYou must instead use the following command:
find city=Raleigh
When the CAPS attribute is assigned to the variable field that is being searched, the value is converted to uppercase for purposes of the search, regardless of the case in which it is entered.
find cost=1234.50 find cost='1,234.50'
The FIND command searches informatted values of the specified variable. If the variable has a decimal value, then you must specify at least the decimal point in the search value. For example, if a variable that is named COST has the informat 5.2 and the value 6.00, then searching for the value 6 would not find a match, but searching for the value 6. would.
The command plus the string cannot be longer than 256 characters. Also, you cannot specify more than 20 find variables.
If a list of criteria is specified, all those criteria must be met in order for an observation to be selected. For example, the following command locates only observations for which the YRS variable contains the value 3 and the STATE variable contains NC:
find yrs=3 state=NCThe command will not locate observations that meet only one of the criteria. Use the FIND@ command to locate observations that meet some but not all of the conditions in the list.
After you issue a FIND command, you can use the RFIND command to repeat the search for the next matching observation.
You can interrupt a FIND operation that is in progress. This feature is useful when you want to halt a search request while editing or browsing a large data set. To halt an active FIND operation, press the interrupt key or key combination for your system. The FSEDIT procedure halts the operation and displays the following message:
NOTE: Search was discontinued due to user break request.
To resume the search, issue an RFIND command.
Note: The key or
key combination you use to interrupt an active process depends on your host
operating system and terminal device. For example, some systems have a key
that is labeled BREAK or ATTENTION (or ATTN). Other systems use a combination
of the CTRL key and another key. Refer to your host documentation if you are
unfamiliar with the interrupt key for your operating system and terminal device.
NC
for the variable
STATE:
find@ yrs>1 state=NC
See the discussion of the FIND command for an explanation of the format for search-criterion values.
After you issue a FIND@ command, you can use the RFIND command to repeat the search for the next matching observation.
The default key definitions for the FSEDIT window are stored in the FSEDIT.KEYS entry in the SASHELP.FSP 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 FSEDIT.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.
Note: The FSEDIT and FSBROWSE
procedures use the same default KEYS entry. Changes that you make in the FSEDIT
window also affect the default key definitions for the FSBROWSE window.
If your FSEDIT session does not use an existing SCREEN entry, you can specify a KEYS entry for your FSEDIT session by using the KEYS= option with the PROC FSEDIT statement. If you do use an existing SCREEN entry, the KEYS entry name that is recorded in the SCREEN entry is used. If you issue a KEYS command when a KEYS entry has been specified, the FSEDIT procedure looks for that entry first in the catalog that contains the SCREEN entry (if a SCREEN entry is used), then in your personal PROFILE catalog. The first KEYS entry found that has the specified name is opened for editing.
If the specified KEYS entry is not found in either catalog, then all function key definitions are blank when the KEYS window is opened. If you then enter key definitions, the specified entry is created when the KEYS window is closed. The new entry is created in the catalog that contains the current SCREEN entry if a SCREEN entry is used; otherwise, it is created in your personal PROFILE catalog.
From the FSLETTER DIRECTORY window, you can create new documents, or you can select existing documents for editing or printing. If you issue a SEND command in the FSLETTER window, fields in the document are filled with the values of the corresponding variables from the current FSEDIT observation. When you end the FSLETTER session, the FSEDIT session resumes.
The following restrictions apply to the search-value value:
Raleigh
:
locate raleighYou must instead use the following command:
locate Raleigh
When the CAPS attribute is assigned to the variable field that is being searched, the value is converted to uppercase for purposes of the search, regardless of the case in which it is entered.
locate 573.04
The LOCATE command finds only observations for which the specified search value exactly matches the variable value. Use the LOCATE: or SEARCH command to find partial matches.
After you issue a LOCATE command, you can use the RFIND command to repeat the search for the next observation that contains the specified value.
You can interrupt a LOCATE operation that is in progress. This feature is useful when you want to halt a search request while editing or browsing a large data set. To halt an active LOCATE operation, press the interrupt key or key combination for your system. The FSEDIT procedure halts the operation and displays the following message:
NOTE: Search was discontinued due to user break request.
To resume the search, issue an RFIND command.
Note: The key or
key combination you use to interrupt an active process depends on your host
operating system and terminal device. For example, some systems have a key
that is labeled BREAK or ATTENTION (or ATTN). Other systems use a combination
of the CTRL key and another key. Refer to your host documentation if you are
unfamiliar with the interrupt key for your operating system and terminal device.
Note: For numeric variables, the LOCATE: command
finds only exact matches
(like the LOCATE command). You cannot search for partial matches in numeric
variables.
The LOCATE: command finds only observations for which the specified search value matches the beginning characters of the variable value. For example, the following command finds occurrences of both Burlington and Burnsville:
locate: Bur
Use the SEARCH command to find matches anywhere in the variable value rather than just at the beginning.
After you issue a LOCATE: command, you can use the RFIND command to repeat the search for the next observation that contains the specified value.
If the application you are using is password-protected, you must specify the assigned password with the MODIFY command before you can modify the SCREEN entry.
For example, to find observations that contain particular values of a variable named DISTRICT, issue this command:
name districtThen specify the desired district value in a LOCATE command to find observations that belong to a specific district.
In an application, you can specify a default search variable in the FSEDIT Parms window.
Note: When you are using an FSEDIT application, the OVERRIDE
command is valid only if the application allows overriding. Applications developers
can block the overriding of error conditions that are caused by blank required
fields, by values outside the acceptable range, or both.
See also the AUTOSAVE command.
The following restrictions are applicable to the search-string value:
Raleigh
:
search raleighYou must instead use the following form of the command:
search Raleigh
When the CAPS attribute is assigned to the variable field that is being searched, the value is converted to uppercase for purposes of the search, regardless of the case in which it is entered.
If a list of values is
specified, all of the strings must occur in an
observation in order for it to be located. For example, the following command
locates only observations for which the specified variables include both the
strings Smith
and NC
:
search Smith NC
The strings can occur in two different variable values (if more than one variable is named in the STRING command) or both in the same variable value.
To find observations that contain some but not necessarily all of the values in the list, use the SEARCH@ command.
After you issue a SEARCH command, you can use the RFIND command to repeat the search for the next observation that contains the specified value.
You can interrupt a SEARCH operation that is in progress. This feature is useful when you want to halt a search request while editing or browsing a large data set. To halt an active SEARCH operation, press the interrupt key or key combination for your system. The FSEDIT procedure halts the operation and displays the following message:
NOTE: Search was discontinued due to user break request.
To resume the search, issue an RFIND command.
Note: The key or
key combination you use 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 if you are unfamiliar
with the interrupt key for your operating system and terminal device.
For example, the following command displays the next observation that
contains either Cary
, Raleigh
, or Chapel Hill
in one of
the variables identified in the STRING command:
search@ Cary Raleigh 'Chapel Hill'
After you issue a SEARCH@ command, you can use the RFIND command to repeat the search for the next observation that contains the specified value.
The letter-name value is the one-level name of an existing LETTER entry in the SAS catalog that is specified in the LETTER= option of the PROC FSEDIT statement. An error message is printed if the specified LETTER entry does not exist.
Use the END command to enter the second stage of the send step, or use the CANCEL command to cancel the FSLETTER session. When you end the FSLETTER session, the FSEDIT session resumes.
The SEND command provides a method for producing one copy of a document for one observation. See The FSLETTER Procedure for more details.
For example, the following command causes the next SEARCH or SEARCH@ command to search the two specified variables:
string address1 address2
If you forget which variables are currently identified, issue the STRING command with no following values to display the current variables on the window's message line.
In a custom application, you can specify default search variables in the FSEDIT Parms window.
The UPDATE command fails if the specified control level would cause a locking conflict. For example, you cannot specify UPDATE MEMBER if the same data set is open with a control level of RECORD in another FSEDIT session.
The complete set of conditions that are imposed by a WHERE command is called a temporary WHERE clause. These conditions can be modified or canceled during the FSEDIT session. In contrast, a WHERE statement that is submitted by the PROC FSEDIT statement defines a permanent WHERE clause that cannot be changed or canceled during the FSEDIT 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 border whenever a temporary WHERE clause is in effect.
The WHERE command has the following forms:
Whenever you change the temporary WHERE clause, the procedure scrolls to the first observation in the data set that meets the specified conditions. When you cancel the temporary WHERE clause, the procedure displays the first observation in the data set.
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 be edited. However, a warning message is printed whenever the observation is displayed, indicating that the observation no longer meets the WHERE conditions.
When you use the ADD or DUP commands to add a new observation, you can enter values that do not meet the WHERE conditions. However, once you scroll to another observation, that observation cannot be displayed or edited again while the WHERE clause is in effect.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.