Friday Half-Day Class Charu Shankar

Baking or Cooking: Learn the Difference Between SAS Arrays and Hash Objects

Presented: Friday September 7, 2018, 1:30pm-5:00pm

Presented by:
SAS Senior Technical Training Specialist, Charu Shankar, teaches by engaging with logic, visuals and analogies to spark critical thinking. She interviews users to recommend the right SAS training. She is a frequent blogger for the SAS Training Post.  When she’s not teaching technology, Charu is passionate about helping people come alive with yoga and is a food blogger.  She also helps support candidates who are looking to land work using SAS through this Linkedin Group.  Charu has presented at over 100 SAS international user group conferences on topics related to SAS programming, SQL, DS2 programming, tips and tricks, efficiencies, new features of SAS and SAS Enterprise Guide.

Hash objects and arrays are exciting to SAS users. But users can often get lost and not grasp the micro level difference between the two techniques. Both are in-memory DATA step techniques. The big difference is arrays are to hash as baking is to cooking. Arrays are like baking. Everything in exact measure has to be put into the pan; the oven has to be just the right temperature, the pans, dough consistency and texture, etc. Once the oven door is shut, don’t open it until the cake is ready. Hash objects, on the other hand, provide more creativity like cooking. You don’t have to have all the measurements at compile time. Unlike an array which needs exact measurements at compile, with hash objects, you can change as you go. Come to this exciting session to learn the difference between these two in-memory techniques. Watch a live demo. Learn to write code to perform these two techniques. Take away two valuable techniques and learn to write code to perform both these techniques with advantages, time savings, programmer efficiency, etc.

Intended Audience: Intermediate to advanced

Tools Discussed: Base SAS

Prerequisite: Preferred prior knowledge of DATA step

Class Outline:

  • Introduction to Table Lookup Techniques
    • Define table lookup.
    • List table lookup techniques.
  • One-Dimensional Arrays
    • Describe array references as a lookup technique.
    • Define one-dimensional arrays.
    • Use a one-dimensional array as a lookup table.
  • Multidimensional Arrays
    • Define a multidimensional array.
    • Explain the differences between a one-dimensional array and a multidimensional array.
    • Use a multidimensional array as a lookup table.
  • Loading a Multidimensional Array from a SAS Data Set
    • Load a multidimensional array from a SAS data set.
    • Identify the advantages of an array as a lookup table.
  • Hash Object Methods
    • Define the DATA step hash object.
  • Loading a Hash Object with Data from a SAS Data Set
    • Investigate hash object syntax.
    • Use hash object methods to load data into a hash object.
    • Use a hash object method to look up data.