Chapter Contents

Previous

Next
SAS/ACCESS Interface to SYSTEM 2000 Data Management Software: Reference

Browsing and Updating Using the QUEST Procedure

The QUEST procedure allows you to access a SYSTEM 2000 database directly, that is, without using a view descriptor. The procedure is basically a messenger for SYSTEM 2000 statements: when you submit a statement in the QUEST procedure, the SAS System scans the statement and passes it to SYSTEM 2000 software, which then executes it.

SYSTEM 2000 software includes an interactive language, also called QUEST, that is used for creating, browsing, updating, and managing SYSTEM 2000 databases. The QUEST procedure gives you full access to that language, either from interactive line-mode sessions or batch mode. In effect, when you submit the PROC QUEST statement, you start a SYSTEM 2000 session; when you submit the END statement, you end the session.

Because the QUEST language is interactive, SYSTEM 2000 software responds to each statement as soon as you submit it. Like the SQL procedure, you do not use a RUN statement to have the statements executed; you simply submit them.

The following example illustrates how to browse and update a SYSTEM 2000 database using the QUEST procedure.

Suppose management is considering a reorganization. They request a list of all managers. That information is available in the EMPLOYEE database, which can be accessed in Multi-User mode. First, submit the PROC QUEST statement.

    proc quest s2kmode=m;

A message appears in the LOG window verifying that you have accessed SYSTEM 2000 software. Now, submit SYSTEM 2000 statements to specify your password for the database and to open the database.

    user, demo;
    data base name is employee;

Request a list of managers with the SYSTEM 2000 TALLY statement.

    tally manager;

TALLY Statement Output displays the list produced.

TALLY Statement Output
   *******************************************
    ITEM-        MANAGER
   *******************************************
   OCCURRENCES   VALUE
   -------------------------------------------
           1     AFG
           3     CPW
           2     FAC
           3     GVH
           5     HEB
           2     ILP
           4     JBM
           3     JC
           1     JFS
           2     JLH
           1     MAS
           3     MYJ
           4     OMG
           3     PQ
           3     PRK
           1     RMJ
           3     SQT
           4     TZR
           7     VPB
   -------------------------------------------
          19 DISTINCT VALUES
   -------------------------------------------
          55 TOTAL OCCURRENCES
   -------------------------------------------

Now, you could end the SYSTEM 2000 session and print your report.

   exit;

Suppose that Olan Garrett, the Vice-President for Marketing, wants to make just one change in his department. He decides to have Jerry Smith report to a different manager. Again, use the QUEST procedure to access the EMPLOYEE database.

   proc quest s2kmode=m;
   user,demo; data base name is employee;

Request a list of all Marketing employees and their current managers with the SYSTEM 2000 LIST statement.

   list employee number, last name, forename, 
      manager,
     ordered by manager
     where department eq marketing at 1;

LIST Statement Output displays the list produced.

LIST Statement Output
   * EMPLOYEE NUMBER   LAST NAME    FORENAME               MANAGER
   ***
   *            1313   SMITH        JERRY LEE              AFG
   *            1217   RODRIGUEZ    ROMUALDO R             GVH
   *            1077   GIBSON       GEORGE J.              GVH
   *            1133   WILLIAMSON   JANICE L.              GVH
   *            1327   BROOKS       RUBEN R.               MAS
   *            1011   VAN HOTTEN   GWENDOLYN              OMG
   *            1161   RICHARDSON   TRAVIS Z.              OMG
   *            1007   BROWN        VIRGINIA P.            OMG
   *            1017   WAGGONNER    MERRILEE D             TZR
   *            1119   GOODSON      ALAN F.                TZR
   *            1234   SHROPSHIRE   LELAND G.              TZR
   *            1031   CHAN         TAI                    TZR
   *            1050   AMEER        DAVID                  VPB
   *            1145   JUAREZ       ARMANDO                VPB
   *            1015   SCHOLL       MADISON A.             VPB
   *            1062   LITTLEJOHN   FANNIE                 VPB

After looking at the report, Olan Garrett decides to have Jerry Lee Smith report to Madison Scholl. The SYSTEM 2000 statement you would enter is as follows:

  change manager eq mas* wh employee number eq 1313;

SYSTEM 2000 software issues a message that one record was selected for the change. To end the SYSTEM 2000 session, issue:

  end;


Chapter Contents

Previous

Next

Top of Page

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