BookmarkSubscribeRSS Feed
GN0001
Barite | Level 11
Hello team,
I have a hash table created:
Data product. Result(drop =IDkey);
If _N_ = 0 then set thisdata;
Declare hash h(dataset: ‘thisdata’);
h.define key =(‘IDkey’);
h.definedata( ‘thisfield’ ‘that field’)
h.defineDone();
Do until (done)
Set sometable end=done;
rc=h.find(key:IDkey);
If rc ne 0 then then do
Thisfield= “ “;
That field=“ “;
End;
Output;
End;
Stop;
Run;


I understood by end of h.define(done), I can’t understand lines afterwards. Any help os greatly appreciated. 🙏🙏🙏🙏blue & blue
Blue Blue
1 REPLY 1
Astounding
PROC Star

rc=

Based on the observation from SOMETABLE, look in the hash table for matching value for IDKey.  Retrieve the values for 'Thisfield' and 'Thatfield' from the hash table, based on a match for IDKey.

 

if rc ne 0

If the search through the hash table does not find a matching value for IDKey, assign missing values to 'Thisfield' and 'Thatfield'

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 496 views
  • 0 likes
  • 2 in conversation