BookmarkSubscribeRSS Feed
astha8882000
Obsidian | Level 7

So my code worked, I honestly did so many hit and trials that I really am not sure what made it work, will continue my R&D on that later. But I wanted to understand a very basic purpose of a hash table here:

 

I have a dataset abc, which gets the values from dataset xyz, then what purpose does the hash table serve? Does hh help abc pick values from xyz based on unique phoneno values?

 

data abc;

IF _n_ = 1 THEN DO; 

dcl hash hh (dataset: ''xyz");

hh.definekey ('phoneno');

hh.definedone();

end;

set xyz;

run;

 

novinosrin
Tourmaline | Level 20

You wrote- "I really am not sure what made it work, will continue my R&D on that later". 

 

I like that. 

 

This is just a heads up to give you an idea what's purpose of hash object to begin with. The hash object stores data as key::value pairs in a so called virtual table or you can call it look up table. Basically, we try to match the key with a key in another table and fetch the associated data with key, very similar to a join so to speak. With this understanding your further reading will be more comprehensible. 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 31 replies
  • 3209 views
  • 4 likes
  • 6 in conversation