Certification_-_SAS_Base_-_Summary_Note.pdf - SAS Data...

This preview shows page 1 - 3 out of 42 pages.

1 Chapter 1 Base Programming SAS Programs 1. Interactive window using to directly modify data, such as the Report window. (P14) proc report data=data-set; columns id name sex age actlevel; run; 2. Invoke procedures that create output in the form of report. (P15) proc tabulate data=data-set; class sex; var height weight; table sex*(height weight), mean; run; Referencing SAS Files 1. LIBNAME statement used to define the libref, clinic, and to give SAS the physical location of the data files. (P18) libname clinic ‘c: \Users\Name\ sasuser’; data clinic.admit2; set clinic.admit; weight=round(weight); run; 2. Rules for SAS Names: (P19) - libref: must have a length of only 8 characters - dataset names and variable names: 1-32 characters - label: descriptive text in descriptor portion, up to 256 characters (P27) SAS Data Sets 1. SAS data set = descriptor portion + data portion (P20) Descriptor portion - the name of the data set; date and time that dataset created; the number of observations; the number of variables ; variable attributes (variable’s name, type, length, format, informat, and label) (P23) 2. Missing value - Char: blank; Num: period. (P24) 3. Variable’s length (P25) - Char: up to 32,767 bytes; 20 characters = 20 bytes - Num: a default of 8 bytes (no matter how long it is) Using the Programming Workspace 1. SAS Library (P38) - Sashelp: read-only library - Sasuser: storing personal settings (Permanent) - Work: temporary library 2. Notice: SAS can use external files, but they are not managed by SAS (P40) Chapter 2 Referencing Files and Setting Options Overview 1. LIBNAME statement is global, remaining in effect until modifying it, cancelling it or ending SAS session. LIBNAME statement assigns the libref for the current SAS session only. Each time begin a SAS session, must assign a libref to each permanent SAS data library that contains files that you want to access in that session. (P50) 2. SAS Engine is a set of internal instructions that SAS uses for writing to or reading from files in a SAS library. (P51) 3. Use LIBNAME statement to reference files that were created with other software products LIBNAME libref engine ‘SAS -data- library’ (P52) 4. Interface Library Engines Only for BMDP, OSIRIS, SPSS (P53) eg: libname re pdata spss ‘g: \ myspss.spss’ %species the libref Rptdata and the engine SPSS for the file G:\Myspss.dat in the Windows operating environment%
Image of page 1

Subscribe to view the full document.

2 Viewing SAS Libraries 1. Viewing Active Libraries (Menu control) 2. Viewing the Contents of a SAS Library (Menu control) 3. Viewing a File’s Contents - Displayed in the VIEWTABLE window (Menu control) 4. PROC CONTENTS - Create SAS output that describes either of the following: the contents of a library; the descriptor information for an individual SAS data set (P56) proc contents data=sas-file-specification nods; run; where sas-file-specification specifies an entire library or a specific SAS data set within a library: libref.sas-data-set or libref._all_ nods : suppresses the printing of detailed information about each file, using only when _all_ is specified.
Image of page 2
Image of page 3
  • Fall '14
  • Imperative programming, Switch statement, Data element

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern