BookmarkSubscribeRSS Feed
Benbo123321
Calcite | Level 5

i'm doing the equivalent of a left join in SAS on approximately 32 million rows.  The output contains 7 additional rows compared to the original.  I looked at the USSGL and there seems to be no pattern as to why it generated addtional rows.  Any thoughts?


 

My code:

DATA WORK.TEST;

MERGE FL_AUG (IN=A) XWALK (IN=B KEEP=USSGL DR_CR_IND);

BY USSGL;

IF (A) THEN OUTPUT;

RUN;

2 REPLIES 2
Astounding
PROC Star

Have you checked the XWALK data to see if it contains multiple entries for the same USSGL?  That's the most likely culprit.

PGStats
Opal | Level 21

If USSGL identifies unique observations in FL_AUG then 

 

IF A and first.USSGL then output;

 

should solve the problem.

PG

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!

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
  • 2 replies
  • 740 views
  • 1 like
  • 3 in conversation