Help using Base SAS procedures

Lookup a reference dataset for value

Reply
N/A
Posts: 0

Lookup a reference dataset for value

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.
Super Contributor
Super Contributor
Posts: 3,174

Re: Lookup a reference dataset for value

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.
Ask a Question
Discussion stats
  • 1 reply
  • 78 views
  • 0 likes
  • 2 in conversation