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'

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1 reply
  • 193 views
  • 0 likes
  • 2 in conversation