Chapter Contents

Previous

Next
SAS/ACCESS Interface to IMS-DL/I Software

Browsing and Updating with SAS/FSP Procedures

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.  [cautionend]


Using the FSBROWSE Procedure

The FSBROWSE procedure enables you to look at IMS-DL/I data but does not allow you to change them. To use PROC FSBROWSE, submit the following SAS statements in the PROGRAM EDITOR window:

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

[IMAGE]

For more information on the FSBROWSE procedure, see "The FSBROWSE Procedure" in SAS/FSP Software: Usage and Reference.

Note:    Accessing observations by observation number is not supported for IMS-DL/I view descriptors within the FSBROWSE procedure; a WHERE command can be used to view a subset of the data.  [cautionend]


Using the FSEDIT Procedure

The FSEDIT procedure enables you to update the IMS-DL/I data described by a view descriptor if the view descriptor specifies in your PSB a PCB that allows you the appropriate level of update access (insert, replace, delete, or all) for the database segments. For example, if the area codes used in HOME_PHONE and OFFICE_PHONE are incorrect for Richmond, you can correct them with 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

[IMAGE]

For more information on the FSEDIT procedure, see "The FSEDIT Procedure" in SAS/FSP Software: Usage and Reference.


Using the FSVIEW Procedure

The FSVIEW procedure also enables you to browse or update IMS-DL/I data using a view descriptor, depending on how you invoke the procedure.

Using the FSVIEW Procedure to Browse IMS-DL/I Data

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

[IMAGE]


Using the FSVIEW Procedure to Update IMS-DL/I Data

To edit the IMS-DL/I data in a tabular format, you must add the EDIT or MODIFY option to the PROC FSVIEW statement, as shown here:

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.  [cautionend]


Specifying a SAS WHERE Statement While Browsing or Editing

If the IMS-DL/I engine can generate SSAs from the WHERE statement, it then retrieves a subset of the IMS-DL/I data. If the engine cannot generate SSAs from the WHERE statement, the WHERE statement is passed to the SAS System for processing. You can also use a SAS WHERE command to retrieve a subset of the IMS-DL/I data after you have invoked one of the SAS/FSP procedures using the PROC statements.

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

[IMAGE]

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

[IMAGE]

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 through data using the FSEDIT, FSBROWSE, or FSVIEW procedures is different when you are using view descriptors instead of SAS data files. While the FORWARD command works identically in both cases, the BACKWARD command does not.

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

Inserting and deleting database segments with SAS/FSP procedures is also different when you are using view descriptors rather than SAS data files.

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:

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.

CAUTION:
If you delete segments using a view descriptor that references only the upper hierarchical level segments in the database, any children of these segments will also be deleted, even though those child segments are not included in the view descriptor.  [cautionend]

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

[IMAGE]

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

[IMAGE]

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.