Chapter Contents |
Previous |
Next |
SAS/ACCESS Interface to IMS-DL/I Software |
If your site has SAS/FSP software as well as SAS/ACCESS software, you can browse and update IMS-DL/I data described by a view descriptor from within a SAS/FSP procedure.
You can use any of three SAS/FSP procedures: FSBROWSE, FSEDIT, and FSVIEW. The FSBROWSE and FSEDIT procedures display one observation at a time, while the FSVIEW procedure produces multiple observations in a tabular format, similar to the PRINT procedure. PROC FSVIEW enables you both to browse and update IMS-DL/I data, depending on which option you choose. The FSBROWSE, FSEDIT, or FSVIEW procedures can only be used with data accessed by a view descriptor, PROC SQL view, DATA step view, or SAS data file; you cannot reference an access descriptor with any SAS procedure or in the SAS DATA step.
Note: The formats assigned by the ACCESS procedure
are by default used as informats by the SAS/FSP procedures
when you add or update a path of data.
Using the FSBROWSE Procedure |
proc fsbrowse data=vlib.custinfo; run;
The FSBROWSE procedure retrieves observations from an IMS-DL/I database one at a time.
Browsing IMS-DL/I Data in the FSBROWSE Window shows the last observation of the customers' data described by the VLIB.CUSTINFO view descriptor. To browse each observation, issue the FORWARD and BACKWARD commands. Because a view descriptor can describe only one path of data in an IMS-DL/I database, you can browse observations in one path of data only.
Browsing IMS-DL/I Data in the FSBROWSE Window
For more information on the FSBROWSE procedure, see "The FSBROWSE Procedure" in SAS/FSP Software: Usage and Reference.
Using the FSEDIT Procedure |
To use PROC FSEDIT, submit the following statements from the PROGRAM EDITOR window:
proc fsedit data=vlib.custinfo; run;
An FSEDIT window appears that looks like the FSBROWSE
window. Scroll to the observation you want, or enter a WHERE statement to
display the correct observation. You can then add or further update the information
about customer
JONATHAN S. WIKOWSKI
, as shown in Updating Information in the FSEDIT Window.
Updating Information in the FSEDIT Window
For more information on the FSEDIT procedure, see "The FSEDIT Procedure" in SAS/FSP Software: Usage and Reference.
Using the FSVIEW Procedure |
To browse IMS-DL/I data in a tabular format, submit the following PROC FSVIEW statements in the PROGRAM EDITOR:
proc fsview data=vlib.custinfo; run;
Browse mode is the default for the FSVIEW procedure. The submitted statements produce the window shown in Browsing IMS-DL/I Data in the FSVIEW Window.
Browsing IMS-DL/I Data in the FSVIEW Window
proc fsview data=vlib.custinfo edit; run;
Note: The CANCEL command in the FSVIEW window
does not cancel your changes; it ends the browse or edit session.
Specifying a SAS WHERE Statement While Browsing or Editing |
If you use a SAS WHERE statement, only the observations specified by that SAS WHERE statement are available. The other observations are not available until you exit the procedure. This is called a permanent WHERE clause.
If you use the SAS WHERE command, you can clear the command to make all the observations available. This is called a temporary WHERE clause.
In the following example, the FSEDIT procedure uses a SAS WHERE statement to retrieve a subset of customers from Richmond. Submitting a SAS WHERE Statement While Invoking FSEDIT shows the FSEDIT window after the statements have been submitted.
proc fsedit data=vlib.custinfo; where city='RICHMOND'; run;
Submitting a SAS WHERE Statement While Invoking FSEDIT
Only the two observations with a CITY value of
RICHMOND
are retrieved for editing; you must scroll forward to see
the second observation. The word
(Subset)
appears after
VLIB.CUSTINFO in the window title to remind you that the data retrieved are
a subset of the data described by the view descriptor. You can then edit
each observation by typing over any incorrect information. Issue the END
command to end your editing session. If you want to cancel changes to an
observation, you can issue the CANCEL command before you scroll to another
observation. Once you scroll, the changes are saved.
You can also enter a SAS WHERE command to display a subset of your data. A SAS WHERE command is a SAS WHERE expression that you enter on the command line. To begin the FSEDIT procedure, submit the following commands in the PROGRAM EDITOR:
proc fsedit data=vlib.custinfo; run;
Entering a SAS WHERE Command in an FSEDIT Window shows what the FSEDIT display looks like when the following command-line command is entered within the FSEDIT window:
where city='RICHMOND'
Entering a SAS WHERE Command in an FSEDIT Window
Only the two observations with a CITY value of
RICHMOND
are retrieved for editing; you must scroll forward to see
the second observation. You can then edit each observation, as described
earlier.
Although these examples have shown how to use a SAS WHERE statement and command with the FSEDIT procedure, you can use a SAS WHERE statement and command in the same way with the FSBROWSE and FSVIEW procedures. For more information on the SAS WHERE statement, refer to SAS Language Reference: Dictionary. For more information on the SAS WHERE command within the SAS/FSP procedures, refer to SAS/FSP Software: Usage and Reference.
Scrolling with SAS/FSP Procedures |
Scrolling backward with SAS/FSP procedures can be slow when you are working with a large database, particularly when you are looking at a path of data in a record near the end of the database. To scroll backward through an IMS-DL/I database, the IMS-DL/I engine must read forward in the database from the beginning until it reaches the observation preceding the one that is displayed when the BACKWARD command was issued. For example, suppose the view defines 5,000 observations, and the current observation is 3,400. To scroll backward to observation 3,399, the FSEDIT procedure must sequentially read observations 1 through 3,398. This can be expensive and time consuming.
Inserting and Deleting Segments with SAS/FSP Procedures |
You can use the FSEDIT and FSVIEW procedures to insert segments into one path of an IMS-DL/I database on which a view descriptor is based, assuming you are using a PCB that allows you insert access to the database segments. There are two ways to add a new segment to an IMS-DL/I database using SAS/FSP procedures:
ADD
on the command line and press ENTER. You can then enter an entire path of
data, which the IMS-DL/I engine inserts in the database using a path call.
If the view descriptor you are using does not include all the variables defined in the access descriptor for the segment to be inserted, low values (hexadecimal zeroes) are placed in those fields in the new segment occurrence inserted into the database. For more information on inserting segments when the SAS observations contain missing values, see Handling Missing Values in Advanced User Topics for the SAS/ACCESS Interface View Engine for IMS-DL/I. Refer to SAS/FSP Software: Usage and Reference for more information on how to use the ADD and DUP commands in the FSEDIT procedure and the AUTOADD and DUP commands in the FSVIEW procedure.
When the DELETE command is used while the FSEDIT or FSVIEW procedure is referencing a view descriptor, the lowest-level existing database segment referenced in the view descriptor is removed permanently from the IMS-DL/I database. Refer to SAS/FSP Software: Usage and Reference for more information on this command.
For example, consider a database consisting of a root segment, a child segment under the root, and another child segment under that child. If you delete a segment in that database using a view descriptor that references only the root and one child, the DELETE command will delete the entire path of data below the root segment. There are two ways you can delete an entire database record:
See Delete Processing in Advanced User Topics for the SAS/ACCESS Interface View Engine for IMS-DL/I for more information on deleting segments.
The following example illustrates how to use the DELETE
command in the FSEDIT procedure. Suppose you want to edit the IMS-DL/I data
described by VLIB.CUSTINFO to eliminate customers who have closed their bank
accounts. If you are using a PCB that allows you delete authority, you can
perform this function by using the FSEDIT procedure from the ACCESS window
or with a PROC FSEDIT statement. Scroll forward to the observations to be
deleted and enter
DELETE
on the command line, as shown in Deleting an IMS-DL/I Segment in an FSEDIT Window.
Deleting an IMS-DL/I Segment in an FSEDIT Window
The DELETE command deletes this root segment from the IMS-DL/I database described by VLIB.CUSTINFO and any child segments under it, and displays a message to that effect, as shown in Using the DELETE Command in the FSEDIT Window.
Using the DELETE Command in the FSEDIT Window
For more information on using SAS/FSP procedures, see SAS/FSP Software: Usage and Reference.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.