Help using Base SAS procedures

How to add conditional statements using hash object

Reply
N/A
Posts: 0

How to add conditional statements using hash object

Hi,
I have big datasets to merge , so thought of using hash object for this .Can anyone tell me, how to include the conditional statements in this? My code using merge looks as below

data merged;
merge p(in=a) q(in=b) r(in=c) r(in=d);
by var1;
if a and b then flag_p=1;else flag_p=0;
if a and c then flag_p=1;else flag_q=0;
if a and d then flag_p=1;else flag_r=0;
run;

Your help w'd be highly appreciated.

Thanks,
SL
Super Contributor
Super Contributor
Posts: 3,174

Re: How to add conditional statements using hash object

What aspect of the hash object feature do you feel would be better than a DATA step MERGE process, as shown below?

Scott Barry
SBBWorks, Inc.
N/A
Posts: 0

Re: How to add conditional statements using hash object

Scott,

I am working with the datasets of 12,19 and 33 GB sized files which are to be sorted before merging and that results in lot of time consumption, which w'd be greatly reduced using hash objects.However I figured out to do what I wanted. I you want to know more about hash objects features, then google it ,its really efficient while dealing with big datasets.

Thanks for showing interest,
SL
Ask a Question
Discussion stats
  • 2 replies
  • 100 views
  • 0 likes
  • 2 in conversation