BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi Everyone,

I have 2 sas datasets
Dataset A
dateKey dateValue
1012 10/10/2005
1013 05/26/1960

Dataset B
start_date_key xyz abc .....
1012 asdfsfsd sdr4wrwer
1013 sdfrgfgfd dfgfdgdfgdfg

How do I specify in sas to lookup DatasetA's dateKey with Dataset B's start_date_key and retrieve value with least performance impact

Any help in this regard is appreciated

Regards,
Kumar.
1 REPLY 1
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Some choices are (and consider that it depends based on data-volume and look-up return value content):

- use SAS PROC FORMAT to build your look-up table and then use the SAS DATA step PUT function to find a match.
- use SAS DATA step MERGE processing to attempt to match your two files.
- use SAS DATA step SET with KEY= processing to perform a look-up.
- a more recent feature is to consider using SAS DATA step and the HASH table approach to perform your objective.


The SAS support http://support.sas.com/ website (with its SEARCH facility) has a wealth reference of SAS-hosted documentation and supplemental technical and conference papers based on topic-oriented subjects.

Proc Format, a Speedy Alternative to Sort Sort Merge
Jenine Milum, Wachovia a Wells Fargo Company, Charlotte, NC
http://support.sas.com/resources/papers/proceedings09/064-2009.pdf

A Hands-On Introduction to SAS® DATA Step Programming
Debbie Buck, D. B. & P. Associates, Houston, TX
http://www2.sas.com/proceedings/sugi30/134-30.pdf

Getting Started with the DATA Step Hash Object
Jason Secosky, SAS Institute Inc., Cary, NC
Janice Bloom, SAS Institute Inc., Cary, NC
http://support.sas.com/rnd/base/datastep/dot/hash-getting-started.pdf


And more recently from the SGF 2009 confererence:

Scalability of Table Lookup Techniques
Rick Langston, SAS Institute Inc., Cary, NC
http://support.sas.com/resources/papers/proceedings09/037-2009.pdf


Scott Barry
SBBWorks, Inc.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 763 views
  • 0 likes
  • 2 in conversation