SlideShare a Scribd company logo
Introduction to
    Data Set Options
         Mark Tabladillo, Ph.D.
Software Developer, MarkTab Consulting
Associate Faculty University of Phoenix
          Faculty,
           January 30, 2007
Introduction
• Data set options allow features during
  dataset processing
• Most SAS data set options can apply to
  either input or output SAS data sets in
  DATA steps or procedure (PROC) steps
• Data set options allow the data step to
  control variables, observations, security,
      t l    i bl     b     ti          it
  and data set attributes
Outline
• Define data set options
• Provide examples in four categories
• Di
  Discuss d t set processing rules
          data t          i     l
Outline
• Define data set options
• Provide examples in four categories
• Di
  Discuss d t set processing rules
          data t          i     l
Definition
• Data set options specify actions that
  apply only to the SAS data set with which
  they appear
       appear.




http://support.sas.com/onlinedoc/913/getDoc/en/lrcon.hlp/a002612367.htm
Syntax
• Specify a data set option in parentheses
  after a SAS data set name. To specify
  several data set options separate them
                   options,
  with spaces.
  (option-1=value-1<...option-n=value-n>)
  (option 1=value 1< option n=value n>)




http://support.sas.com/onlinedoc/913/getDoc/en/lrcon.hlp/a002612367.htm
Outline
• Define data set options
• Provide examples in four categories
• Di
  Discuss d t set processing rules
          data t          i     l
Quick Examples
• Data set options enable us to perform
  operations such as these:
    – Renaming variables
    – Selecting only the first or last n observations
      for processing
    – Dropping variables from processing or from
      the output data set
    – Specifying a password for a data set
    – Adding dataset labels
http://support.sas.com/onlinedoc/913/getDoc/en/lrcon.hlp/a002612367.htm
Common Option Categories
•   Variable Control
•   Observation Control
•   Security
    S     it
•   Data Set Attributes
Examples Dataset
data work.sales (drop=i randomState);
        length state $2 sales 8 randomState 3;
        do i = 1 to 2500;
                  randomState = round(rand('gaussian',3,1)+0.5);
                  if randomState in (1,2,3,4,5) then do;
                           select(randomState);
                             l t( d St t )
                                     when(1) state='TN';
                                     when(2) state='AL';
                                     when(3) state='GA';
                                          ( )            ;
                                     when(4) state='FL';
                                     when(5) state='MS';
                           end;
                           sales = int(rand('gaussian' 1000000 500000));
                                   int(rand('gaussian',1000000,500000));
                           output work.sales;
                  end;
        end;
        run;
List of Common Options
              SAS Data Set Option      Description


Variable      DROP= Data Set           Excludes variables from
   Control      Option                   processing or from output SAS
                                         data sets
              KEEP= Data Set           Specifies variables for processing
                Option
                 p                       or for writing to output SAS data
                                                      g       p
                                         sets

              RENAME= Data Set         Changes the name of a variable
                Option
                O i




http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000104210.htm
Examples: Variable Control
 data work salesReformat;
      work.salesReformat;
         set work.sales (drop=sales);
         run;

 data work.salesReformat2;
         set work.sales (keep=state);
         run;

 proc sort data=work.sales (rename=(state=salesState))
         out=work.salesReformat3 (drop=sales);
         by salesState;
         run;
List of Common Options
              SAS Data Set Option      Description



Observation   FIRSTOBS= Data Set       Specifies which observation SAS
  Control        Option                  processes first

              IN= Data Set Option      Creates a variable that indicates
                                          whether the data set contributed
                                          data to the current observation
              OBS= Data Set Option     Specifies when to stop processing
                                         obse a o s
                                         observations

              WHERE= Data Set          Selects observations that meet the
                Option                    specified condition


http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000104210.htm
Examples: Observation Control
   * (obs - firstobs) + 1 = results;
   data work.selectObs1;
               set work.sales (firstobs=1 obs=200);
                              (                  );
               run;

   data work.selectObs2;
            set work.sales (firstobs=200 obs=400);
                           (                    );
            run;

   proc print data=work.sales (obs=25);
             run;
                ;

   proc freq data=work.sales (firstobs=1);
             tables state;
             run;;

   proc means data=work.sales (obs=max);
           class state;
                    ;
           var sales;
           run;
Examples: Observation Control
  data work combineObs1;
       work.combineObs1;
          set work.selectObs1 (in=in1) work.selectObs2 (in=in2);
          length source $12;
          if in1 then source = 'Dataset One';
          else if in2 then source = 'Dataset Two';
          run;

  data work combineObs2;
       work.combineObs2;
          set work.selectObs1 (in=in1) work.selectObs2 (in=in2);
          if in1 and in2 then output;
          run;
List of Common Options
           SAS Data Set Option         Description

Security   ALTER= Data Set Option      Assigns an alter password to a SAS file and
                                          enables access to a password-
                                          protected SAS file
           ENCRYPT= Data Set           Encrypts SAS data files
             Option
           PW= Data Set Option         Assigns a read, write, or alter password to a
                                          SAS file and enables access to a
                                          password-protected SAS file
           READ= Data Set Option       Assigns a read password to a SAS file and
                                          enables access to a read-protected
                                          SAS file
           WRITE= Data Set Option      Assigns a write password to a SAS file and
                                          enables access to a write-protected
                                          SAS file


http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000104210.htm
Examples: Security
data work.secure1 (alter=NoErrors);
        set work.sales;
        run;

data work.secure2;
        set work.sales (alter=NoErrors);
            work sales
        run;

* Note: A SAS password does not control access to a SAS file beyond the SAS
system.
system You should use the operating system-supplied utilities and file-system
                                        system supplied               file system
security controls in order to control access to SAS files outside of SAS.;
data work.secure3 (encrypt=yes pw=Scramble);
        set work.sales;
        run;

proc sort data=work.secure3 (pw=scramble) out=work.secure4;
        by state sales;
          y           ;
        run;
List of Common Options
              SAS Data Set Option      Description
Data Set      COMPRESS= Data Set       Controls the compression of
Attributes      Option                   observations in an output SAS data
                                         set
              GENMAX= Data Set         Requests generations for a data set
                Option                   and specifies the maximum number
                                         of versions
              INDEX D
              INDEX= Data S
                          Set          D fi
                                       Defines i d
                                                indexes when a SAS d
                                                         h         data set
                 Option                   is created

              LABEL= Data Set          Specifies a label for the SAS data set
                Option




http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000104210.htm
Examples: Data Set Attributes
data work.compress1 (compress=yes label=quot;Attempt at Compressionquot;);
        set work.sales;
        run;

data work masterSalesDataset (genmax=3);
     work.masterSalesDataset (genmax 3);
        set work.sales;
        run;

d t work.masterSalesDataset;
data   k     t S l D t     t
       set work.masterSalesDataset work.selectObs1;
       run;

data work.masterSalesDataset;
        set work.sales work.selectObs1;
        run;
Outline
• Define data set options
• Provide examples in four categories
• Di
  Discuss d t set processing rules
          data t          i     l
Input and Output Datasets
• If a data set option is associated with an
  input data set, the action applies to the
  data set that is being read.
                          read
• If the option appears in the DATA
  statement or after an output data set
  specification in a PROC step, SAS applies
  the action to the output data set
                                 set.


http://support.sas.com/onlinedoc/913/getDoc/en/lrcon.hlp/a002612367.htm
Input and Output Datasets
   data
   d t _null_;
          ll
          run;

       ;
   data;
            run;

   data _null_;
           set _null_;
                null ;
           if _n_ ge 0 then put 'hello';
           run;

   data _null_;
           if _n_ ge 0 then put 'hello';
           set _null_;
           run;
Order of Execution
• When data set options appear on both input and
  output data sets in the same DATA or PROC
  step, SAS applies data set options to input data
  sets before it evaluates programming statements
  or before it applies data set options to output
  data t
  d t sets.
• Likewise, data set options that are specified for
  the data set being created are applied after
  programming statements are processed.

http://support.sas.com/onlinedoc/913/getDoc/en/lrcon.hlp/a002612367.htm
Order of Execution

data work.salesReformat4 (rename=(sales=monthlySales));
        set work.sales;
        sales = sales/12;
        run;

data work.salesReformat5;
        set work.sales (rename=(sales=monthlySales));
        monthlySales = monthlySales/12;
        run;
Specification Conflicts
• In some instances data set options
            instances,
  conflict when they are used in the same
  statement For example you cannot
  statement.       example,
  specify both the DROP= and KEEP=
  options for the same variable in the same
  statement.



http://support.sas.com/onlinedoc/913/getDoc/en/lrcon.hlp/a002612367.htm
Statement Definition
• A SAS statement is a series of items that
  may include keywords, SAS names,
  special characters and operators
          characters,    operators.
• All SAS statements end with a semicolon.
• A SAS statement either requests SAS to
           t t    t ith          t       t
  perform an operation or gives information
  to th
  t the system.
            t


http://support.sas.com/onlinedoc/913/getDoc/en/lrcon.hlp/a002612375.htm
Timing Conflicts
• Timing can also be an issue in some
  cases. For example, if using KEEP= and
  RENAME
  RENAME= on a data set specified in the
  SET statement, KEEP= needs to use the
  original variable names, because SAS will
                    names
  process KEEP= before the data set is
  read.
  read The new names specified in
  RENAME= will apply to the programming
  statements that follow the SET statement
                                 statement.
http://support.sas.com/onlinedoc/913/getDoc/en/lrcon.hlp/a002612367.htm
Timing Conflicts

proc sort data=work.sales (keep=sales state
rename=(sales=monthlySales))
        out=work.salesReformat6;
        out=work salesReformat6;
        by state monthlySales;
        run;

proc sort data=work.sales (rename=(sales=monthlySales)
keep=sales state)
        out=work.salesReformat7;
        by state monthlySales;
        run;
Overriding System Options
• Many system options and data set options
  share the same name and have the same
  function.
• The data set option overrides the system
  option for the data set in the step in which
    p                               p
  it appears.
• System options remain in effect for all
     y      p
  DATA and PROC steps in a SAS job or
  session, unless they are respecified.
http://support.sas.com/onlinedoc/913/getDoc/en/lrcon.hlp/a002612367.htm
Conclusion
• DATA set options allow features during
  data step processing
• The SAS System Documentation provides
  specific details on the syntax
Contact Information
• Mark Tabladillo
  MarkTab Consulting
  http://www.marktab.com/
  http://www marktab com/

More Related Content

What's hot

SAS Macros
SAS MacrosSAS Macros
SAS Macros
guest2160992
 
Sas Functions INDEX / INDEXC / INDEXW
Sas Functions INDEX / INDEXC / INDEXWSas Functions INDEX / INDEXC / INDEXW
Sas Functions INDEX / INDEXC / INDEXW
THARUN PORANDLA
 
Introduction to SAS
Introduction to SASIntroduction to SAS
Introduction to SAS
izahn
 
SAS cheat sheet
SAS cheat sheetSAS cheat sheet
SAS cheat sheet
Ali Ajouz
 
CDISC SDTM Domain Presentation
CDISC SDTM Domain PresentationCDISC SDTM Domain Presentation
CDISC SDTM Domain PresentationAnkur Sharma
 
Understanding sas data step processing.
Understanding sas data step processing.Understanding sas data step processing.
Understanding sas data step processing.
Ravi Mandal, MBA
 
Introduction to clinical sas programming
Introduction to clinical sas programmingIntroduction to clinical sas programming
Introduction to clinical sas programming
ray4hz
 
SAS Proc SQL
SAS Proc SQLSAS Proc SQL
SAS Proc SQL
guest2160992
 
Basics of SAS
Basics of SASBasics of SAS
Basics of SAS
Taddesse Kassahun
 
Base SAS Statistics Procedures
Base SAS Statistics ProceduresBase SAS Statistics Procedures
Base SAS Statistics Procedures
guest2160992
 
Introduction to clinical sas
Introduction to clinical sasIntroduction to clinical sas
Introduction to clinical sas
Vijayaraghava Karpurapu
 
SDTM (Study Data Tabulation Model)
SDTM (Study Data Tabulation Model)SDTM (Study Data Tabulation Model)
SDTM (Study Data Tabulation Model)
SWAROOP KUMAR K
 
Understanding SAS Data Step Processing
Understanding SAS Data Step ProcessingUnderstanding SAS Data Step Processing
Understanding SAS Data Step Processing
guest2160992
 
SAS - overview of SAS
SAS - overview of SASSAS - overview of SAS
SAS - overview of SAS
Vibrant Technologies & Computers
 
Introduction To Sas
Introduction To SasIntroduction To Sas
Introduction To Sashalasti
 
Introduction to SDTM
Introduction to SDTMIntroduction to SDTM
Introduction to SDTM
Devender Palsa
 
ADaM - Where Do I Start?
ADaM - Where Do I Start?ADaM - Where Do I Start?
ADaM - Where Do I Start?
Dr.Sangram Parbhane
 
A Roadmap for SAS Programmers to Clinical Statistical Programming
A Roadmap for SAS Programmers to Clinical Statistical ProgrammingA Roadmap for SAS Programmers to Clinical Statistical Programming
A Roadmap for SAS Programmers to Clinical Statistical Programming
Mohammad Majharul Alam
 
SAS Programming Notes
SAS Programming NotesSAS Programming Notes
SAS Programming Notes
Gnana Murthy A
 

What's hot (20)

SAS Macros
SAS MacrosSAS Macros
SAS Macros
 
Sas Functions INDEX / INDEXC / INDEXW
Sas Functions INDEX / INDEXC / INDEXWSas Functions INDEX / INDEXC / INDEXW
Sas Functions INDEX / INDEXC / INDEXW
 
Introduction to SAS
Introduction to SASIntroduction to SAS
Introduction to SAS
 
SAS cheat sheet
SAS cheat sheetSAS cheat sheet
SAS cheat sheet
 
CDISC SDTM Domain Presentation
CDISC SDTM Domain PresentationCDISC SDTM Domain Presentation
CDISC SDTM Domain Presentation
 
Understanding sas data step processing.
Understanding sas data step processing.Understanding sas data step processing.
Understanding sas data step processing.
 
Introduction to clinical sas programming
Introduction to clinical sas programmingIntroduction to clinical sas programming
Introduction to clinical sas programming
 
SAS Proc SQL
SAS Proc SQLSAS Proc SQL
SAS Proc SQL
 
Basics of SAS
Basics of SASBasics of SAS
Basics of SAS
 
Base SAS Statistics Procedures
Base SAS Statistics ProceduresBase SAS Statistics Procedures
Base SAS Statistics Procedures
 
Introduction to clinical sas
Introduction to clinical sasIntroduction to clinical sas
Introduction to clinical sas
 
SDTM (Study Data Tabulation Model)
SDTM (Study Data Tabulation Model)SDTM (Study Data Tabulation Model)
SDTM (Study Data Tabulation Model)
 
Understanding SAS Data Step Processing
Understanding SAS Data Step ProcessingUnderstanding SAS Data Step Processing
Understanding SAS Data Step Processing
 
Sas cheat
Sas cheatSas cheat
Sas cheat
 
SAS - overview of SAS
SAS - overview of SASSAS - overview of SAS
SAS - overview of SAS
 
Introduction To Sas
Introduction To SasIntroduction To Sas
Introduction To Sas
 
Introduction to SDTM
Introduction to SDTMIntroduction to SDTM
Introduction to SDTM
 
ADaM - Where Do I Start?
ADaM - Where Do I Start?ADaM - Where Do I Start?
ADaM - Where Do I Start?
 
A Roadmap for SAS Programmers to Clinical Statistical Programming
A Roadmap for SAS Programmers to Clinical Statistical ProgrammingA Roadmap for SAS Programmers to Clinical Statistical Programming
A Roadmap for SAS Programmers to Clinical Statistical Programming
 
SAS Programming Notes
SAS Programming NotesSAS Programming Notes
SAS Programming Notes
 

Viewers also liked

Set and Merge
Set and MergeSet and Merge
Set and Mergevenkatam
 
Return of the Codes -- SAS', Windows' and Your's
Return of the Codes -- SAS', Windows' and Your'sReturn of the Codes -- SAS', Windows' and Your's
Return of the Codes -- SAS', Windows' and Your's
Mark Tabladillo
 
Digital investigation
Digital investigationDigital investigation
Digital investigationlaurencowey
 
Set Theory In C++
Set Theory In C++Set Theory In C++
Set Theory In C++
Yan (Andrew) Zhuang
 
Digital investigation
Digital investigationDigital investigation
Digital investigation
unnilala11
 
9. Searching & Sorting - Data Structures using C++ by Varsha Patil
9. Searching & Sorting - Data Structures using C++ by Varsha Patil9. Searching & Sorting - Data Structures using C++ by Varsha Patil
9. Searching & Sorting - Data Structures using C++ by Varsha Patil
widespreadpromotion
 
Data Sets You Free: Analytics for Content Strategy
Data Sets You Free: Analytics for Content StrategyData Sets You Free: Analytics for Content Strategy
Data Sets You Free: Analytics for Content Strategy
Jonathon Colman
 

Viewers also liked (9)

Set and Merge
Set and MergeSet and Merge
Set and Merge
 
Return of the Codes -- SAS', Windows' and Your's
Return of the Codes -- SAS', Windows' and Your'sReturn of the Codes -- SAS', Windows' and Your's
Return of the Codes -- SAS', Windows' and Your's
 
Set, merge, and update
Set, merge, and updateSet, merge, and update
Set, merge, and update
 
Digital investigation
Digital investigationDigital investigation
Digital investigation
 
Set Theory In C++
Set Theory In C++Set Theory In C++
Set Theory In C++
 
Digital investigation
Digital investigationDigital investigation
Digital investigation
 
Hashing
HashingHashing
Hashing
 
9. Searching & Sorting - Data Structures using C++ by Varsha Patil
9. Searching & Sorting - Data Structures using C++ by Varsha Patil9. Searching & Sorting - Data Structures using C++ by Varsha Patil
9. Searching & Sorting - Data Structures using C++ by Varsha Patil
 
Data Sets You Free: Analytics for Content Strategy
Data Sets You Free: Analytics for Content StrategyData Sets You Free: Analytics for Content Strategy
Data Sets You Free: Analytics for Content Strategy
 

Similar to Introduction to SAS Data Set Options

Sas-training-in-mumbai
Sas-training-in-mumbaiSas-training-in-mumbai
Sas-training-in-mumbai
Unmesh Baile
 
Sas classes in mumbai
Sas classes in mumbaiSas classes in mumbai
Sas classes in mumbai
Vibrant Technologies & Computers
 
Data handling in r
Data handling in rData handling in r
Data handling in r
Abhik Seal
 
Prog1 chap1 and chap 2
Prog1 chap1 and chap 2Prog1 chap1 and chap 2
Prog1 chap1 and chap 2rowensCap
 
SAS and R Code for Basic Statistics
SAS and R Code for Basic StatisticsSAS and R Code for Basic Statistics
SAS and R Code for Basic Statistics
Avjinder (Avi) Kaler
 
SAS and R Code for Basic Statistics
SAS and R Code for Basic StatisticsSAS and R Code for Basic Statistics
SAS and R Code for Basic Statistics
Avjinder (Avi) Kaler
 
Stata tutorial university of princeton
Stata tutorial university of princetonStata tutorial university of princeton
Stata tutorial university of princeton
Douglas Branco Dias Santana
 
SAS Commands
SAS CommandsSAS Commands
SAS Commands
Suvojyoti Chowdhury
 
Get up to Speed (Quick Guide to data.table in R and Pentaho PDI)
Get up to Speed (Quick Guide to data.table in R and Pentaho PDI)Get up to Speed (Quick Guide to data.table in R and Pentaho PDI)
Get up to Speed (Quick Guide to data.table in R and Pentaho PDI)
Serban Tanasa
 
Introducción al Software Analítico SAS
Introducción al Software Analítico SASIntroducción al Software Analítico SAS
Introducción al Software Analítico SAS
Jorge Rodríguez M.
 
SAS Online Training by Real Time Working Professionals in USA,UK,India,Middle...
SAS Online Training by Real Time Working Professionals in USA,UK,India,Middle...SAS Online Training by Real Time Working Professionals in USA,UK,India,Middle...
SAS Online Training by Real Time Working Professionals in USA,UK,India,Middle...
Oracle Apps R12, Financials,SCM,PA,HRMSCorporate Training
 
Sas Talk To R Users Group
Sas Talk To R Users GroupSas Talk To R Users Group
Sas Talk To R Users Group
georgette1200
 
A Divine Data Comedy
A Divine Data ComedyA Divine Data Comedy
A Divine Data Comedy
Mike Harris
 
Calling r from sas (msug meeting, feb 17, 2018) revised
Calling r from sas (msug meeting, feb 17, 2018)   revisedCalling r from sas (msug meeting, feb 17, 2018)   revised
Calling r from sas (msug meeting, feb 17, 2018) revised
Barry DeCicco
 
Draft sas and r and sas (may, 2018 asa meeting)
Draft sas and r and sas (may, 2018 asa meeting)Draft sas and r and sas (may, 2018 asa meeting)
Draft sas and r and sas (may, 2018 asa meeting)
Barry DeCicco
 
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
Tony jambu   (obscure) tools of the trade for tuning oracle sq lsTony jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
InSync Conference
 
Introduction to-sas-1211594349119006-8
Introduction to-sas-1211594349119006-8Introduction to-sas-1211594349119006-8
Introduction to-sas-1211594349119006-8thotakoti
 
Sas
SasSas
Slice for Distributed Persistence (JavaOne 2010)
Slice for Distributed Persistence (JavaOne 2010)Slice for Distributed Persistence (JavaOne 2010)
Slice for Distributed Persistence (JavaOne 2010)
Pinaki Poddar
 

Similar to Introduction to SAS Data Set Options (20)

Sas-training-in-mumbai
Sas-training-in-mumbaiSas-training-in-mumbai
Sas-training-in-mumbai
 
SAS Internal Training
SAS Internal TrainingSAS Internal Training
SAS Internal Training
 
Sas classes in mumbai
Sas classes in mumbaiSas classes in mumbai
Sas classes in mumbai
 
Data handling in r
Data handling in rData handling in r
Data handling in r
 
Prog1 chap1 and chap 2
Prog1 chap1 and chap 2Prog1 chap1 and chap 2
Prog1 chap1 and chap 2
 
SAS and R Code for Basic Statistics
SAS and R Code for Basic StatisticsSAS and R Code for Basic Statistics
SAS and R Code for Basic Statistics
 
SAS and R Code for Basic Statistics
SAS and R Code for Basic StatisticsSAS and R Code for Basic Statistics
SAS and R Code for Basic Statistics
 
Stata tutorial university of princeton
Stata tutorial university of princetonStata tutorial university of princeton
Stata tutorial university of princeton
 
SAS Commands
SAS CommandsSAS Commands
SAS Commands
 
Get up to Speed (Quick Guide to data.table in R and Pentaho PDI)
Get up to Speed (Quick Guide to data.table in R and Pentaho PDI)Get up to Speed (Quick Guide to data.table in R and Pentaho PDI)
Get up to Speed (Quick Guide to data.table in R and Pentaho PDI)
 
Introducción al Software Analítico SAS
Introducción al Software Analítico SASIntroducción al Software Analítico SAS
Introducción al Software Analítico SAS
 
SAS Online Training by Real Time Working Professionals in USA,UK,India,Middle...
SAS Online Training by Real Time Working Professionals in USA,UK,India,Middle...SAS Online Training by Real Time Working Professionals in USA,UK,India,Middle...
SAS Online Training by Real Time Working Professionals in USA,UK,India,Middle...
 
Sas Talk To R Users Group
Sas Talk To R Users GroupSas Talk To R Users Group
Sas Talk To R Users Group
 
A Divine Data Comedy
A Divine Data ComedyA Divine Data Comedy
A Divine Data Comedy
 
Calling r from sas (msug meeting, feb 17, 2018) revised
Calling r from sas (msug meeting, feb 17, 2018)   revisedCalling r from sas (msug meeting, feb 17, 2018)   revised
Calling r from sas (msug meeting, feb 17, 2018) revised
 
Draft sas and r and sas (may, 2018 asa meeting)
Draft sas and r and sas (may, 2018 asa meeting)Draft sas and r and sas (may, 2018 asa meeting)
Draft sas and r and sas (may, 2018 asa meeting)
 
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
Tony jambu   (obscure) tools of the trade for tuning oracle sq lsTony jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
 
Introduction to-sas-1211594349119006-8
Introduction to-sas-1211594349119006-8Introduction to-sas-1211594349119006-8
Introduction to-sas-1211594349119006-8
 
Sas
SasSas
Sas
 
Slice for Distributed Persistence (JavaOne 2010)
Slice for Distributed Persistence (JavaOne 2010)Slice for Distributed Persistence (JavaOne 2010)
Slice for Distributed Persistence (JavaOne 2010)
 

More from Mark Tabladillo

How to find low-cost or free data science resources 202006
How to find low-cost or free data science resources 202006How to find low-cost or free data science resources 202006
How to find low-cost or free data science resources 202006
Mark Tabladillo
 
Microsoft Build 2020: Data Science Recap
Microsoft Build 2020: Data Science RecapMicrosoft Build 2020: Data Science Recap
Microsoft Build 2020: Data Science Recap
Mark Tabladillo
 
201909 Automated ML for Developers
201909 Automated ML for Developers201909 Automated ML for Developers
201909 Automated ML for Developers
Mark Tabladillo
 
201908 Overview of Automated ML
201908 Overview of Automated ML201908 Overview of Automated ML
201908 Overview of Automated ML
Mark Tabladillo
 
201906 01 Introduction to ML.NET 1.0
201906 01 Introduction to ML.NET 1.0201906 01 Introduction to ML.NET 1.0
201906 01 Introduction to ML.NET 1.0
Mark Tabladillo
 
201906 04 Overview of Automated ML June 2019
201906 04 Overview of Automated ML June 2019201906 04 Overview of Automated ML June 2019
201906 04 Overview of Automated ML June 2019
Mark Tabladillo
 
201906 03 Introduction to NimbusML
201906 03 Introduction to NimbusML201906 03 Introduction to NimbusML
201906 03 Introduction to NimbusML
Mark Tabladillo
 
201906 02 Introduction to AutoML with ML.NET 1.0
201906 02 Introduction to AutoML with ML.NET 1.0201906 02 Introduction to AutoML with ML.NET 1.0
201906 02 Introduction to AutoML with ML.NET 1.0
Mark Tabladillo
 
201905 Azure Databricks for Machine Learning
201905 Azure Databricks for Machine Learning201905 Azure Databricks for Machine Learning
201905 Azure Databricks for Machine Learning
Mark Tabladillo
 
201905 Azure Certification DP-100: Designing and Implementing a Data Science ...
201905 Azure Certification DP-100: Designing and Implementing a Data Science ...201905 Azure Certification DP-100: Designing and Implementing a Data Science ...
201905 Azure Certification DP-100: Designing and Implementing a Data Science ...
Mark Tabladillo
 
Big Data Advanced Analytics on Microsoft Azure 201904
Big Data Advanced Analytics on Microsoft Azure 201904Big Data Advanced Analytics on Microsoft Azure 201904
Big Data Advanced Analytics on Microsoft Azure 201904
Mark Tabladillo
 
Managing Enterprise Data Science 201904
Managing Enterprise Data Science 201904Managing Enterprise Data Science 201904
Managing Enterprise Data Science 201904
Mark Tabladillo
 
Training of Python scikit-learn models on Azure
Training of Python scikit-learn models on AzureTraining of Python scikit-learn models on Azure
Training of Python scikit-learn models on Azure
Mark Tabladillo
 
Big Data Adavnced Analytics on Microsoft Azure
Big Data Adavnced Analytics on Microsoft AzureBig Data Adavnced Analytics on Microsoft Azure
Big Data Adavnced Analytics on Microsoft Azure
Mark Tabladillo
 
Advanced Analytics with Power BI 201808
Advanced Analytics with Power BI 201808Advanced Analytics with Power BI 201808
Advanced Analytics with Power BI 201808
Mark Tabladillo
 
Microsoft Cognitive Toolkit (Atlanta Code Camp 2017)
Microsoft Cognitive Toolkit (Atlanta Code Camp 2017)Microsoft Cognitive Toolkit (Atlanta Code Camp 2017)
Microsoft Cognitive Toolkit (Atlanta Code Camp 2017)
Mark Tabladillo
 
Machine learning services with SQL Server 2017
Machine learning services with SQL Server 2017Machine learning services with SQL Server 2017
Machine learning services with SQL Server 2017
Mark Tabladillo
 
Microsoft Technologies for Data Science 201612
Microsoft Technologies for Data Science 201612Microsoft Technologies for Data Science 201612
Microsoft Technologies for Data Science 201612
Mark Tabladillo
 
How Big Companies plan to use Our Big Data 201610
How Big Companies plan to use Our Big Data 201610How Big Companies plan to use Our Big Data 201610
How Big Companies plan to use Our Big Data 201610
Mark Tabladillo
 
Georgia Tech Data Science Hackathon September 2016
Georgia Tech Data Science Hackathon September 2016Georgia Tech Data Science Hackathon September 2016
Georgia Tech Data Science Hackathon September 2016
Mark Tabladillo
 

More from Mark Tabladillo (20)

How to find low-cost or free data science resources 202006
How to find low-cost or free data science resources 202006How to find low-cost or free data science resources 202006
How to find low-cost or free data science resources 202006
 
Microsoft Build 2020: Data Science Recap
Microsoft Build 2020: Data Science RecapMicrosoft Build 2020: Data Science Recap
Microsoft Build 2020: Data Science Recap
 
201909 Automated ML for Developers
201909 Automated ML for Developers201909 Automated ML for Developers
201909 Automated ML for Developers
 
201908 Overview of Automated ML
201908 Overview of Automated ML201908 Overview of Automated ML
201908 Overview of Automated ML
 
201906 01 Introduction to ML.NET 1.0
201906 01 Introduction to ML.NET 1.0201906 01 Introduction to ML.NET 1.0
201906 01 Introduction to ML.NET 1.0
 
201906 04 Overview of Automated ML June 2019
201906 04 Overview of Automated ML June 2019201906 04 Overview of Automated ML June 2019
201906 04 Overview of Automated ML June 2019
 
201906 03 Introduction to NimbusML
201906 03 Introduction to NimbusML201906 03 Introduction to NimbusML
201906 03 Introduction to NimbusML
 
201906 02 Introduction to AutoML with ML.NET 1.0
201906 02 Introduction to AutoML with ML.NET 1.0201906 02 Introduction to AutoML with ML.NET 1.0
201906 02 Introduction to AutoML with ML.NET 1.0
 
201905 Azure Databricks for Machine Learning
201905 Azure Databricks for Machine Learning201905 Azure Databricks for Machine Learning
201905 Azure Databricks for Machine Learning
 
201905 Azure Certification DP-100: Designing and Implementing a Data Science ...
201905 Azure Certification DP-100: Designing and Implementing a Data Science ...201905 Azure Certification DP-100: Designing and Implementing a Data Science ...
201905 Azure Certification DP-100: Designing and Implementing a Data Science ...
 
Big Data Advanced Analytics on Microsoft Azure 201904
Big Data Advanced Analytics on Microsoft Azure 201904Big Data Advanced Analytics on Microsoft Azure 201904
Big Data Advanced Analytics on Microsoft Azure 201904
 
Managing Enterprise Data Science 201904
Managing Enterprise Data Science 201904Managing Enterprise Data Science 201904
Managing Enterprise Data Science 201904
 
Training of Python scikit-learn models on Azure
Training of Python scikit-learn models on AzureTraining of Python scikit-learn models on Azure
Training of Python scikit-learn models on Azure
 
Big Data Adavnced Analytics on Microsoft Azure
Big Data Adavnced Analytics on Microsoft AzureBig Data Adavnced Analytics on Microsoft Azure
Big Data Adavnced Analytics on Microsoft Azure
 
Advanced Analytics with Power BI 201808
Advanced Analytics with Power BI 201808Advanced Analytics with Power BI 201808
Advanced Analytics with Power BI 201808
 
Microsoft Cognitive Toolkit (Atlanta Code Camp 2017)
Microsoft Cognitive Toolkit (Atlanta Code Camp 2017)Microsoft Cognitive Toolkit (Atlanta Code Camp 2017)
Microsoft Cognitive Toolkit (Atlanta Code Camp 2017)
 
Machine learning services with SQL Server 2017
Machine learning services with SQL Server 2017Machine learning services with SQL Server 2017
Machine learning services with SQL Server 2017
 
Microsoft Technologies for Data Science 201612
Microsoft Technologies for Data Science 201612Microsoft Technologies for Data Science 201612
Microsoft Technologies for Data Science 201612
 
How Big Companies plan to use Our Big Data 201610
How Big Companies plan to use Our Big Data 201610How Big Companies plan to use Our Big Data 201610
How Big Companies plan to use Our Big Data 201610
 
Georgia Tech Data Science Hackathon September 2016
Georgia Tech Data Science Hackathon September 2016Georgia Tech Data Science Hackathon September 2016
Georgia Tech Data Science Hackathon September 2016
 

Recently uploaded

FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 

Introduction to SAS Data Set Options

  • 1. Introduction to Data Set Options Mark Tabladillo, Ph.D. Software Developer, MarkTab Consulting Associate Faculty University of Phoenix Faculty, January 30, 2007
  • 2. Introduction • Data set options allow features during dataset processing • Most SAS data set options can apply to either input or output SAS data sets in DATA steps or procedure (PROC) steps • Data set options allow the data step to control variables, observations, security, t l i bl b ti it and data set attributes
  • 3. Outline • Define data set options • Provide examples in four categories • Di Discuss d t set processing rules data t i l
  • 4. Outline • Define data set options • Provide examples in four categories • Di Discuss d t set processing rules data t i l
  • 5. Definition • Data set options specify actions that apply only to the SAS data set with which they appear appear. http://support.sas.com/onlinedoc/913/getDoc/en/lrcon.hlp/a002612367.htm
  • 6. Syntax • Specify a data set option in parentheses after a SAS data set name. To specify several data set options separate them options, with spaces. (option-1=value-1<...option-n=value-n>) (option 1=value 1< option n=value n>) http://support.sas.com/onlinedoc/913/getDoc/en/lrcon.hlp/a002612367.htm
  • 7. Outline • Define data set options • Provide examples in four categories • Di Discuss d t set processing rules data t i l
  • 8. Quick Examples • Data set options enable us to perform operations such as these: – Renaming variables – Selecting only the first or last n observations for processing – Dropping variables from processing or from the output data set – Specifying a password for a data set – Adding dataset labels http://support.sas.com/onlinedoc/913/getDoc/en/lrcon.hlp/a002612367.htm
  • 9. Common Option Categories • Variable Control • Observation Control • Security S it • Data Set Attributes
  • 10. Examples Dataset data work.sales (drop=i randomState); length state $2 sales 8 randomState 3; do i = 1 to 2500; randomState = round(rand('gaussian',3,1)+0.5); if randomState in (1,2,3,4,5) then do; select(randomState); l t( d St t ) when(1) state='TN'; when(2) state='AL'; when(3) state='GA'; ( ) ; when(4) state='FL'; when(5) state='MS'; end; sales = int(rand('gaussian' 1000000 500000)); int(rand('gaussian',1000000,500000)); output work.sales; end; end; run;
  • 11. List of Common Options SAS Data Set Option Description Variable DROP= Data Set Excludes variables from Control Option processing or from output SAS data sets KEEP= Data Set Specifies variables for processing Option p or for writing to output SAS data g p sets RENAME= Data Set Changes the name of a variable Option O i http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000104210.htm
  • 12. Examples: Variable Control data work salesReformat; work.salesReformat; set work.sales (drop=sales); run; data work.salesReformat2; set work.sales (keep=state); run; proc sort data=work.sales (rename=(state=salesState)) out=work.salesReformat3 (drop=sales); by salesState; run;
  • 13. List of Common Options SAS Data Set Option Description Observation FIRSTOBS= Data Set Specifies which observation SAS Control Option processes first IN= Data Set Option Creates a variable that indicates whether the data set contributed data to the current observation OBS= Data Set Option Specifies when to stop processing obse a o s observations WHERE= Data Set Selects observations that meet the Option specified condition http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000104210.htm
  • 14. Examples: Observation Control * (obs - firstobs) + 1 = results; data work.selectObs1; set work.sales (firstobs=1 obs=200); ( ); run; data work.selectObs2; set work.sales (firstobs=200 obs=400); ( ); run; proc print data=work.sales (obs=25); run; ; proc freq data=work.sales (firstobs=1); tables state; run;; proc means data=work.sales (obs=max); class state; ; var sales; run;
  • 15. Examples: Observation Control data work combineObs1; work.combineObs1; set work.selectObs1 (in=in1) work.selectObs2 (in=in2); length source $12; if in1 then source = 'Dataset One'; else if in2 then source = 'Dataset Two'; run; data work combineObs2; work.combineObs2; set work.selectObs1 (in=in1) work.selectObs2 (in=in2); if in1 and in2 then output; run;
  • 16. List of Common Options SAS Data Set Option Description Security ALTER= Data Set Option Assigns an alter password to a SAS file and enables access to a password- protected SAS file ENCRYPT= Data Set Encrypts SAS data files Option PW= Data Set Option Assigns a read, write, or alter password to a SAS file and enables access to a password-protected SAS file READ= Data Set Option Assigns a read password to a SAS file and enables access to a read-protected SAS file WRITE= Data Set Option Assigns a write password to a SAS file and enables access to a write-protected SAS file http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000104210.htm
  • 17. Examples: Security data work.secure1 (alter=NoErrors); set work.sales; run; data work.secure2; set work.sales (alter=NoErrors); work sales run; * Note: A SAS password does not control access to a SAS file beyond the SAS system. system You should use the operating system-supplied utilities and file-system system supplied file system security controls in order to control access to SAS files outside of SAS.; data work.secure3 (encrypt=yes pw=Scramble); set work.sales; run; proc sort data=work.secure3 (pw=scramble) out=work.secure4; by state sales; y ; run;
  • 18. List of Common Options SAS Data Set Option Description Data Set COMPRESS= Data Set Controls the compression of Attributes Option observations in an output SAS data set GENMAX= Data Set Requests generations for a data set Option and specifies the maximum number of versions INDEX D INDEX= Data S Set D fi Defines i d indexes when a SAS d h data set Option is created LABEL= Data Set Specifies a label for the SAS data set Option http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000104210.htm
  • 19. Examples: Data Set Attributes data work.compress1 (compress=yes label=quot;Attempt at Compressionquot;); set work.sales; run; data work masterSalesDataset (genmax=3); work.masterSalesDataset (genmax 3); set work.sales; run; d t work.masterSalesDataset; data k t S l D t t set work.masterSalesDataset work.selectObs1; run; data work.masterSalesDataset; set work.sales work.selectObs1; run;
  • 20. Outline • Define data set options • Provide examples in four categories • Di Discuss d t set processing rules data t i l
  • 21. Input and Output Datasets • If a data set option is associated with an input data set, the action applies to the data set that is being read. read • If the option appears in the DATA statement or after an output data set specification in a PROC step, SAS applies the action to the output data set set. http://support.sas.com/onlinedoc/913/getDoc/en/lrcon.hlp/a002612367.htm
  • 22. Input and Output Datasets data d t _null_; ll run; ; data; run; data _null_; set _null_; null ; if _n_ ge 0 then put 'hello'; run; data _null_; if _n_ ge 0 then put 'hello'; set _null_; run;
  • 23. Order of Execution • When data set options appear on both input and output data sets in the same DATA or PROC step, SAS applies data set options to input data sets before it evaluates programming statements or before it applies data set options to output data t d t sets. • Likewise, data set options that are specified for the data set being created are applied after programming statements are processed. http://support.sas.com/onlinedoc/913/getDoc/en/lrcon.hlp/a002612367.htm
  • 24. Order of Execution data work.salesReformat4 (rename=(sales=monthlySales)); set work.sales; sales = sales/12; run; data work.salesReformat5; set work.sales (rename=(sales=monthlySales)); monthlySales = monthlySales/12; run;
  • 25. Specification Conflicts • In some instances data set options instances, conflict when they are used in the same statement For example you cannot statement. example, specify both the DROP= and KEEP= options for the same variable in the same statement. http://support.sas.com/onlinedoc/913/getDoc/en/lrcon.hlp/a002612367.htm
  • 26. Statement Definition • A SAS statement is a series of items that may include keywords, SAS names, special characters and operators characters, operators. • All SAS statements end with a semicolon. • A SAS statement either requests SAS to t t t ith t t perform an operation or gives information to th t the system. t http://support.sas.com/onlinedoc/913/getDoc/en/lrcon.hlp/a002612375.htm
  • 27. Timing Conflicts • Timing can also be an issue in some cases. For example, if using KEEP= and RENAME RENAME= on a data set specified in the SET statement, KEEP= needs to use the original variable names, because SAS will names process KEEP= before the data set is read. read The new names specified in RENAME= will apply to the programming statements that follow the SET statement statement. http://support.sas.com/onlinedoc/913/getDoc/en/lrcon.hlp/a002612367.htm
  • 28. Timing Conflicts proc sort data=work.sales (keep=sales state rename=(sales=monthlySales)) out=work.salesReformat6; out=work salesReformat6; by state monthlySales; run; proc sort data=work.sales (rename=(sales=monthlySales) keep=sales state) out=work.salesReformat7; by state monthlySales; run;
  • 29. Overriding System Options • Many system options and data set options share the same name and have the same function. • The data set option overrides the system option for the data set in the step in which p p it appears. • System options remain in effect for all y p DATA and PROC steps in a SAS job or session, unless they are respecified. http://support.sas.com/onlinedoc/913/getDoc/en/lrcon.hlp/a002612367.htm
  • 30. Conclusion • DATA set options allow features during data step processing • The SAS System Documentation provides specific details on the syntax
  • 31. Contact Information • Mark Tabladillo MarkTab Consulting http://www.marktab.com/ http://www marktab com/