Sie sind auf Seite 1von 2

EXERCISES CHAPTER 2

1. Start SAS, write a SAS code containing a data step (it can include anything)
and a PROC PRINT step and read the log.
2. Create a new library with a libref ExerData and read all the data sets into
this library.
3. Read this raw data into SAS under the name populartours by using
both cards(or datalines) statement and with external file (for external file
you need to copy and paste the raw data into a new txt file.).
country nightsstay airfare staypckgcost tourcompany
France

793

575 Major

Spain

10

805

510 Hispania

India

10

722

982 1020 Express

Peru
Japan

489 Royal
590 Mundial

Greece

12

748 Express

New Zealand

16 1368 1539 Southsea

Ireland

787

628 Express

Venezuela

426

505 Mundial

Italy

852

598 Express

Russia

14 1106 1024 A-B-C

Switzerland
Australia

816

834 Tour2000

12 1299 1169 Southsea

Brazil

682

610 Almeida

4. Read this raw data into SAS under the name employees by using
both cards(or datalines) statement and with external file (for external file
you need to copy and paste the raw data into a new txt file.).
----+----1----+----2----+----3----+----4----+----5----+----6
ID

Date1

Date2

Date3

FirstName LastName Salary

312445

12/01/4908/23/5604/29/73 Joe von Mises

$41,230

473941

11/09/5106/21/5903/21/71 John Stevenson $100,459

5. Read NatPark.dat file in Example 2.1.4 of Chapter 2 Presentations into SAS.


6. Read this raw data into SAS under the name friendbdays by using
both cards(or datalines) statement and with external file (for external file
you need to copy and paste the raw data into a new txt file.).
Name bday
John

1 Jan 1960

Mary 11 Jul 1955


Kate 12 Nov 1962
Mark

8 Jun 1959

7. PRINT any of the data sets above by direct referencing the file (use PROC
PRINT).

8.

Write the contents of any of the data sets above. Examine the output of the
PROC CONTENTS.

Das könnte Ihnen auch gefallen