SAS - Notes- Basics

Embed Size (px)

Citation preview

  • 8/10/2019 SAS - Notes- Basics

    1/3

    SAS

    1. Identify which of the following variable names are valid SAS names:

    Height

    HeightInCentimeters

    Height_in_centimeters

    Wt-Kg

    x123y456

    76Trombones

    MiXeDCasE

    Sas Names follow a simple naming rule:

    All SAS variable names and data set names can be no longer than 32 characters.

    They must begin with a letter OR _ (underscore) character.

    The remaining characters in the name may be letters, digits, or underscore character.

    Characters such as dashes and spaces are not allowed.

    2. In the following list, classify each data set name as valid or invalid:

    Clinic

    clinic

    work

    hyphens-in-the-name

    123GO

    Demographics_2006

    Question #3.

    You have a data set consisting of Student ID, English, History, Math, and Science test scores on 10

    students.

    The number of variables is __________

    The number of observations is __________

    http://techbus.safaribooksonline.com/9781599941653/app01lev1sec1#ch01qa1a1http://techbus.safaribooksonline.com/9781599941653/app01lev1sec1#ch01qa1a1
  • 8/10/2019 SAS - Notes- Basics

    2/3

    Question#4

    True or false:

    You can place more than one SAS statement on a single line.

    You can use several lines for a single SAS statement.

    SAS has three data types: character, numeric, and integer.

    OPTIONS and TITLE statements are considered global statements.

    SAS has only two types of variables: character and numeric. This makes it much simpler to use and

    understand than some other programs that have many more data types (for example, integer, long

    integer, and logical).

    SAS determines a fixed storage length for every variable.

    Most SAS users never need to think about storage lengths for numerical valuesthey are stored in 8

    bytes (about14 or 15 significant digits, depending on your operating system) if you dont specify

    otherwise.

    Each character value (data stored as letters, special characters, and numerals) is assigned a fixed storage

    length explicitly by program statements or by various rules that SAS has about the length of character

    values.

    Question#5

    What is the default storage length for SAS numeric variables (in bytes)?

    Most SAS users never need to think about storage lengths for numerical valuesthey are stored in 8

    bytes (about14 or 15 significant digits, depending on your operating system) if you dont specify

    otherwise.

    1.

    What are the data types in SAS?

    Two types of data types (a) Numeric (b) Character

    2. Related Terms

    SAS Dataset TableObservation Row

    Variable Column

    3.

    What is the limitation on the max. number of variables?

    Limitation on Prior to SAS 9.1 From and After SAS 9.1

    Max. No of Variables 32767 Depends on the capacity of the

    Computer

    Max. No of Variables Depends on the capacity of the

    Computer

    Depends on the capacity of the

    Computer

    4.

    What is SAS descriptor portion?.(1)

    SAS Dataset name

    (2)

    Date on which SAS dataset is created

    (3) Version of SAS

    (4) Information about each variable

    Name of the variable

    Type

    Length

    Position at which field is located

  • 8/10/2019 SAS - Notes- Basics

    3/3

    5.

    Rules for names of variables and SAS dataset members?

    o Name must be 32 characters or lesser in length

    o Name must start with a letter or an underscore (_)

    o Name can contain only letters, numerals or underscores. No special characters

    o Name may be upper case or lower case

    SAS is case insensitive

    6.

    What is the meaning of system option VALIDVARNAMES=ANYIt means that variable name can contain special characters including spaces.

    7.

    What are the steps in SAS?

    DATA

    PROC

    8. Which step creates SAS dataset?

    DATA

    9. What is the SAS dataset name for the below example.

    DATA distance;

    Miles =26.22;

    Kilometers = 1.61 * miles;

    Name of the dataset: DISTANCE

    10.

    What does DATA and PROC step do?

    DATA step to create a SAS dataset and then passes the data to a PROC step after processing.

    DATA