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-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!

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.

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