SAS Tutorial | The SAS Hash Object: A Deeper and Wider Look at the Fundamentals and Functionality
Vložit
- čas přidán 15. 07. 2024
- Most programmers use the SAS® hash object as a lookup table to help combine two data sets by a common key. This is regrettable because the hash object is a versatile and dynamic data management tool that can be used to do so much more! However, in order to take advantage of its true potential, the understanding of its fundamentals and functionality must be deeper than that sufficient for doing a table lookup using a coding example. This tutorial pursues two goals: Present the fundamentals of the hash object with enough depth to enable a programmer to use it not only to accomplish simple tasks but also use it creatively. Illustrate the functionality of the hash object above and beyond table lookup. After focusing on and based on these underlying works, we will discuss the aspects of the hash object functionality related to concrete data processing tasks, such as: Using the hash object to split, join, unduplicate and aggregate data. Using it to support the creation and updating of a star schema data warehouse. Parameterizing hash table operations to create flexible and scalable programs. Addressing potential issues related to the hash objects memory-resident nature.
Session ID: 5306
Presenters: Don Henderson, Henderson Consulting; Paul Dorfman, Dorfman Consulting
Topic: Programming
Industry: Non-Industry Specific
Audience: Programmer
Level: intermediate
Content Outline
00:00:00 - Introduction
00:07:42 - Part 1 - A Deeper and Wider Look at the Fundamentals
01:06:59 - Overview of Part II - The Hash Object as a BI Tool
01:12 04 - The Sample Data - What it is and How to Download and Create it Locally
01:18:36 - The Hash Object as a Persistent Data Store
01:24:09 - The Hash Object to Perform Simple Data Aggregation
01:35:47 - Adding Meaningful Labels to the Aggregation Results
01:43:18 - Enhancing the Aggregation to Include Multiple (hierarchical) Levels
01:51:27 - The Use of the Hash Object to Calculated Unique Counts
01:58:47 - Multi-Level Aggregation - Hard-Coded
02:10:16 - Multi-Level Aggregation - Data-Driven/Parameterized
02:18:25 - Looping Thru Hash Objects - Introducing Hash of Hashes (HoH)
02:23:46 - Enhancing Parameterized Multi-Level Aggregation Using HoH
02:35:27 - Adding Unique Counts Using HoH
02:41:36 - Summary and How to Contact the Authors
Sample Data and Programs
If you are interested in creating the data used in Part II of this presentation, please visit Allan Bowe's Bizarro Ball project at github.com/allanbowe/BizarroB...
You can either download all the programs from our book at support.sas.com/downloads/pac...
Or a zip file which contains just the (slightly modified) programs presented in Part II at github.com/sascommunities/sas...
Learn more about SAS Software
Free SAS Online Training - www.sas.com/en_us/training/of...
Contact SAS® - www.sas.com/en_us/contact.geo...
SUBSCRIBE TO THE SAS USERS CZcams CHANNEL #SASUsers #LearnSAS #SASGF
czcams.com/users/SASUsers?sub_...
ABOUT SAS
SAS is a trusted analytics powerhouse for organizations seeking immediate value from their data. A deep bench of analytics solutions and broad industry knowledge keep our customers coming back and feeling confident. With SAS®, you can discover insights from your data and make sense of it all. Identify what’s working and fix what isn’t. Make more intelligent decisions. And drive relevant change.
CONNECT WITH SAS
SAS ► www.sas.com/contact
SAS Customer Support ► support.sas.com
SAS Communities ► communities.sas.com
SAS Analytics Explorers ► explorers.sas.com
Facebook ► / sassoftware
Twitter ► / sassoftware
LinkedIn ► / sas
Blogs ► blogs.sas.com
RSS ►www.sas.com/rss - Věda a technologie
2023 and this is still solid gold!! Much appreciated!!
Glad you liked it! Thank you for the feedback!
This is one of the great Tutorial , thanks to SAS.
Thank you. ☺ Looking for a video on hash object fundamentals since a long time.
Great stuff! Very well done and informative.
Glad you enjoyed it! Thanks for sharing!
Great tutorial! Thank you!
Thanks so much!!!
Glad it helped!
Thanks for the tutorial,
You are welcome! Glad you found it helpful! 👍
I have a question about te material covered around 1:03:00.
Would it be correct to say that the code `h = _new_ hash()` assign to the variable h (stored in the PDV) a pointer to the hash object (stored in the heap, I suppose)?
Michele, thank you for your inquiry. We are checking on this for you!
@@SASUsers I just found the answer in Don and Paul's book, here's the relevant extract
"
[H = _new_ hash() ;]
Now let us see what actions [this] deceptively simple statement implies:
● Create a new instance of hash object H.
● Generate a distinct non-scalar value of type hash to identify the newly created hash object
instance. One way to think of it is of a pointer to the location in memory where the object instance
resides.
● Assign this pointer value to PDV variable H of type hash.
"
If you have something to add please feel free to share it :)
Michele, thanks for letting us know! We don't have anything else to add at this time.
Good job sas. But ... why the sas syntax is some complex?. I mean, i love sas languague, but i really think than C languague is more intuitive and easy to understand.
If you have any specific suggestions, we would love to hear from you! Please submit feedback through SAS Idea Exchange: 2.sas.com/6054MkGLs. Additional info on customer feedback, here: 2.sas.com/6055MkGLt