Reading Messy Data-section 2.10 - PowerPoint PPT Presentation

1 / 4
About This Presentation
Title:

Reading Messy Data-section 2.10

Description:

... to with characters', along with the colon modifier, to help with messy data (no ... The colon (:) placed before an informat causes SAS to read that value til it ... – PowerPoint PPT presentation

Number of Views:30
Avg rating:3.0/5.0
Slides: 5
Provided by: darganf
Learn more at: http://people.uncw.edu
Category:

less

Transcript and Presenter's Notes

Title: Reading Messy Data-section 2.10


1
Reading Messy Data-section 2.10
  • Can use the _at_ symbol to with characters, along
    with the colon modifier, to help with messy data
    (no predictable lengths, data doesnt line up)
  • The colon () placed before an informat causes
    SAS to read that value til it reaches a blank
    space (or completes the requisite number of
    columns). See how this is used in the example
    on page 49
  • INPUT _at_'' AccessDate DATE11. _at_'GET File 20.
  • reads 2 variables, the second one modified by
    the modifier

2
  • Multiple lines of data per observation can be
    handled with either the / pointer or the n
    pointer in the INPUT line
  • the / pointer moves the input to the next line
  • the n pointer moves the input to the n-th line
  • Multiple Observations per Line of raw data can be
    read by using the _at__at_ at the end of the INPUT
    statement. This line-hold specifier says
    once youve read one observation hold the pointer
    and read another see the example on page 52 -
    note multiple observations on the same line
  • HW Make sure youve read through section 2.12
    and have worked through the examples next time
    well go over your questions in detail

3
Permanent SAS datasets
  • Permanent SAS datasets are formed in your SAS
    programs by so naming them in the DATA name_here
    statement... They are saved permanently with
    all the variable names and formats, etc. that you
    created when you ran the DATA step... Try this
    with Dr. Padgetts dataset. See Section 2.19,
    pages 66-67 for a complete discussion.
  • We can make permanent SAS datasets and recall
    them back to our SAS programs through the LIBNAME
    statements as follows...

4
  • Try this...
  • options ls80
  • dm output 'CLEAR' dm log 'CLEAR'
  • LIBNAME SAVE c\Documents "
  • DATA SAVE.PADGETT
  • INFILE whereever
  • INPUT ... RUN
  • proc print datasave.padgett run quit
  • Now to retrieve it with SET statement...
  • LIBNAME mylib C\Documents "
  • DATA again SET mylib.padgett run
  • proc print dataagain run
Write a Comment
User Comments (0)
About PowerShow.com