Browsing and Updating with the QUEST Procedure

Use the QUEST procedure to access a SYSTEM 2000 database directly, that is, without using a view descriptor. This procedure is basically a messenger for SYSTEM 2000 statements: When you submit a statement in PROC QUEST, SAS scans the statement and passes it to SYSTEM 2000, which executes it.
SYSTEM 2000 includes an interactive language (also named QUEST) that is used for creating, browsing, updating, and managing SYSTEM 2000 databases. PROC QUEST 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 EXIT statement, you end the session.
Because the QUEST language is interactive, SYSTEM 2000 responds to each statement as soon as you submit it. As in PROC SQL, you do not need a RUN statement.
In this example, management is considering a reorganization and a list of all managers is requested. That information is available in the database Employee, which can be accessed in Multi-User mode. The following program uses PROC QUEST to browse and update a SYSTEM 2000 database.
    proc quest s2kmode=m;
A message appears in the Log window, which verifies that you have accessed SYSTEM 2000. 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 by using the TALLY statement in SYSTEM 2000.
    tally manager;
To end the SYSTEM 2000 session and print your report, submit the following:
   exit;
The following output displays the results.
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, suppose that Olan Garrett, the Vice-President for Marketing, wants to make one change in his department. He decides to have Jerry Lee Smith report to a different manager. Again, use PROC QUEST to access the database Employee.
   proc quest s2kmode=m;
   user, demo; data base name is employee;
Request a list of all Marketing employees and their current managers by using the LIST statement in SYSTEM 2000. The following output displays the results.
   list employee number, last name, forename, manager,
     ordered by manager
     where department eq marketing at 1;
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. To do this, submit the following SYSTEM 2000 statement:
  change manager eq mas* wh employee number eq 1313;
SYSTEM 2000 issues a message that one record was selected to be changed.
To end the SYSTEM 2000 session, submit the following:
  exit;
Note: The commands QUIT and END are aliases for EXIT.