Merging the two large datasets using joins/unique key/primary key

Reply
Occasional Contributor
Posts: 5

Merging the two large datasets using joins/unique key/primary key

Hi,

I am little bit fimilar with Merge in SAS and Joins in Proc SQL. May be I am missing

something, but I am struggling to do a simple lookup in SAS as we do in vlookup in excel.

For example

Dataset A has two variables:

ID Visits

1 Two

2 Three

1 One

3 Two

Dataset B has two variable

ID Location

1 A

2 B

3 A

1 C

2 B

and attached the two excel .csv files ,these are merging the two excel .csv files import in sas.

These are two data sets merging by item_code & Sub Category_Code

in sas sql  using joins/primary key/unique key.

I am also try but some errors are occured.

Errors are :

9908  proc sql;

9909    create table vlook.Merge as

9910       select DKG.Item_Code,IM.Sub Category_Code

                                       -------------

                                       22

ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, ',', -, /, <, <=, <>,

              =, >, >=, ?, AND, AS, CONTAINS, EQ, EQT, GE, GET, GT, GTT, LE, LET, LIKE, LT, LTT, NE,

              NET, OR, ^=, |, ||, ~=.

9911           from VLOOK.DKG,VLOOK.IM

9912             where DKG.Item_Code=IM.Item_Code;

9913  quit;

NOTE: The SAS System stopped processing this step because of errors.

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 secon

Plz any one can try it...

Thanks and Regards,

Nag.

Super Contributor
Posts: 644

Re: Merging the two large datasets using joins/unique key/primary key

Missing underscore between Sub and Category?  There should not be a space in that position.

Richard in NZ

Ask a Question
Discussion stats
  • 1 reply
  • 323 views
  • 3 likes
  • 2 in conversation