space
Previous Page | Next Page

Example Programs

SAS Data Files


Data File MYDATA.CLASSES

The SAS data file MYDATA.CLASSES (used in SYSTEM 2000 Data in SAS Programs) was created by using the following SAS program:

    libname mydata 'your-SAS-library';
    data mydata.classes;
       input lastname $ 1-10 firstnme $ 15-25 class $ 30-50;
       datalines;
    AMMER         DAVID          PRESENTING IDEAS
    CANADY        FRANK A.       PRESENTING IDEAS
    GIBSON        MOLLY I.       SUPERVISOR SKILLS
    GIBSON        MOLLY I.       STRESS MGMT
    RICHARDSON    TRAVIS Z.      SUPERVISOR SKILLS
    ;

Output A3.9 shows the results after running the following program on the data file:

    proc print data=mydata.classes;
       title2 'SAS Data File MYDATA.CLASSES';
    run; 

SAS Data File MYDATA.CLASSES

                       SAS Data File MYDATA.CLASSES                        1
 
       OBS    LASTNAME      FIRSTNME       CLASS
 
         1    AMEER         DAVID          PRESENTING IDEAS
         2    CANADY        FRANK A.       PRESENTING IDEAS
         3    GIBSON        MOLLY I.       SUPERVISOR SKILLS
         4    GIBSON        MOLLY I.       STRESS MGMT
         5    RICHARDSON    TRAVIS Z.      SUPERVISOR SKILLS

Data File V6.BIRTHDY

The SAS data file V6.BIRTHDY (used in the section Updating SAS Data Files with SYSTEM 2000 Data) was created by using the following SAS program:

    libname v6 'your-SAS-library';
    data v6.birthdy;
       input lastname $10. firstnme $10. birthday date7.;
       format birthday date7.;
       datalines;
    JONES     FRANK     22MAY53
    MCVADE    CURTIS    25DEC54
    SMITH     VIRGINIA  14NOV49
    TURNER    BECKY     26APR50
    ;
 

Output A3.10 shows the results after running the following program on the data file:

    proc print data=v6.birthdy;
       title2 'SAS Data File V6.BIRTHDY';
       format birthday date7.;
    run; 

SAS Data File V6.BIRTHDY

               SAS Data File V6.BIRTHDY                1
 
       OBS    LASTNAME     FIRSTNME    BIRTHDAY
 
         1    JONES        FRANK       22MAY53
         2    MCVADE       CURTIS      25DEC54
         3    SMITH        VIRGINA     14NOV49
         4    TURNER       BECKY       26APR50

Data File V7.CONSULTING_BIRTHDAYS

The SAS data file V7.CONSULTING_BIRTHDAYS (used in the section Updating SAS Data Files with SYSTEM 2000 Data) was created by using the following SAS program:

data v7.consulting_birthdays;
   input last_name $ 1-13 first_name $ 14-26 
     birthdate DATE7.;
   informat birthdate DATE7.;
   format birthdate DATE7.;
   datalines;
   JOHNSON      ED           30JAN65
   LEWIS        THOMAS       25MAY54
   SMITH        AMANDA       02DEC60
   WILSON       REBECCA      13APR58
;

Output A3.11 shows the results after running the following program on the data file:

proc print data=V7.consulting_birthdays;
   title2 'V7.Consulting_Birthdays Data File';
run;

SAS Data File V.Consulting_Birthdays

               V7.Consulting_Birthdays Data File            1
 
           obs    last_name   first_name    birthdate
 
             1    JOHNSON      ED           30JAN65
             2    LEWIS        THOMAS       25MAY54
             3    SMITH        AMANDA       02DEC60
             4    WILSON       REBECCA      13APR58

Data File MYDATA.CORPHON

The SAS data file MYDATA.CORPHON (used in Browsing and Updating SYSTEM 2000 Data) was created by using the following SAS program:

    libname mydata 'your-SAS-library';
    data mydata.corphon;
       input lastname $15. firstnme $15. phone $10.;
       datalines;
    BOWMAN         HUGH E.        109 XT901
    FAULKNER       CARRIE ANN     132 XT417
    GARRETT        OLAN M.        212 XT208
    KNAPP          PATRICE R.     222 XT 12
    KNIGHT         ALTHEA         213 XT218
    MILLSAP        JOEL B.        131 XT224
    MUELLER        PATSY          223 XT822
    NATHANIEL      DARRYL         118 XT544
    SALAZAR        YOLANDA        111 XT169
    WATERHOUSE     CLIFTON P.     101 XT109
    ;

Output A3.12 shows the results after running the following program on the data file:

    proc print data=mydata.corphon;
       title 'SAS Data File MYDATA.CORPHON';
    run; 

SAS Data File MYDATA.CORPHON

                   SAS Data File MYDATA.CORPHON               1
 
           OBS    LASTNAME      FIRSTNME        PHONE
 
             1    BOWMAN        HUGH E.       109 XT901
             2    FAULKNER      CARRIE ANN    132 XT417
             3    GARRETT       OLAN M.       212 XT208
             4    KNAPP         PATRICE R.    222 XT 12
             5    KNIGHT        ALTHEA        213 XT218
             6    MILLSAP       JOEL B.       131 XT224
             7    MUELLER       PATSY         223 XT822
             8    NATHANIEL     DARRYL        118 XT544
             9    SALAZAR       YOLANDA       111 XT169
            10    WATERHOUSE    CLIFTON P.    101 XT109

Data File TRANS.BANKING

The SAS data file TRANS.BANKING (used in Creating and Loading SYSTEM 2000 Databases, as input to the DBLOAD procedure to create and load data into the SYSTEM 2000 database BANKING) was created by using the following SAS program:

    libname trans 'your.SAS.library';
    data trans.banking;
       input custname & $20.
             custid & $7.
             acctnum & 4.
             accttyp & $1.
             transtyp & $1.
             transamt & dollar10.2
             transdat & date7.;
       format acctnum 4.
              transamt dollar10.2
              transdat date7.;
       informat transdat date.;
       datalines;
    booker, john  74-9838  8349  s  d  $40.00  05jun89
    lopez, pat    38-7274  9896  s  d  $15.67  23jun89
        
           ...more data lines
        
   ;

Output A3.13 shows the results after running the following program on the data file:

    proc print data=trans.banking;
       title 'Data in SAS Data File TRANS.BANKING';
    run; 

SAS Data File TRANS.BANKING

                  Data in SAS Data File TRANS.BANKING                           1
 
OBS  CUSTNAME       CUSTID   ACCTNUM  ACCTTYP  TRANSTYP   TRANSAMT  TRANSDAT
 
  1  BOOKER, JOHN   74-9838   8349       S         D        $40.00  05JUN89
  2  LOPEZ, PAT     38-7274   9896       S         D        $15.67  23JUN89
  3  JONES, APRIL   85-4941   4141       C         W       $213.78  29JUN89
  4  BOOKER, JOHN   74-9838   8349       S         I        $34.76  30JUN89
  5  MILLER, NANCY  07-6163   7890       S         I        $53.98  30JUN89
  6  LOPEZ, PAT     38-7274   9896       S         I        $16.43  30JUN89
  7  JONES, APRIL   85-4941   4141       C         W       $354.70  30JUN89
  8  MILLER, NANCY  07-6163   7890       S         D     $1,245.87  01JUL89
  9  JONES, APRIL   85-4941   4141       C         D     $2,298.65  01JUL89
 10  MILLER, NANCY  07-6163   3876       C         W        $45.98  08JUL89
 11  ROGERS, MIKE   96-5052   4576       C         D        $75.00  10JUL89
 12  BOOKER, JOHN   74-9838   3673       C         D       $150.00  10JUL89
 13  LOPEZ, PAT     38-7274   9896       S         D        $50.00  10JUL89
 14  BOOKER, JOHN   74-9838   3673       C         W        $65.43  13JUL89
 15  ROGERS, MIKE   96-5052   4576       C         W        $12.34  13JUL89
 16  ROGERS, MIKE   96-5052   4576       C         W        $45.67  13JUL89
 17  MILLER, NANCY  07-6163   3876       C         D        $56.79  14JUL89
 18  ROGERS, MIKE   96-5052   4576       C         W        $12.16  15JUL89

Note:   The input SAS data file TRANS.BANKING must be sorted before you can use the data for the examples in Creating and Loading SYSTEM 2000 Databases. The programs using PROC DBLOAD create and load a three-level SYSTEM 2000 database. Each logical entry represents a customer. Records at level 1 contain data for the accounts by customer; records at level 2 contain transaction data.  [cautionend]

The following program sorts the input SAS data file TRANS.BANKING by the variables CUSTNAME and ACCTNUM:

    proc sort data=trans.banking;
       by custname acctnum;
    run; 

After you sort the data file TRANS.BANKING, you can use it to create the database BANKING (shown in Creating and Loading SYSTEM 2000 Databases), which also contains the new database definition and the stored data.

space
Previous Page | Next Page | Top of Page