Help using Base SAS procedures

Merging and creating variables

Reply
Super Contributor
Posts: 259

Merging and creating variables

IS it possible to merge and then do other procedures like creating variables etc.

data help;

merge data1(in=a) data 2;

by key;

if a;

newfield=field1+field2;

run;

not working for me

SAS Employee
Posts: 340

Re: Merging and creating variables

data 2

      ^------------- You have a whites pace here!!

data data1(keep=key field1) data2(keep=key field2);

  input key field1 field2;

datalines;

1 1 0

2 2 0

3 3 1

4 4 0

5 5 0

;

run;

data help;

merge data1(in=a) data2;

by key;

if a;

newfield=field1+field2;

run;

Ask a Question
Discussion stats
  • 1 reply
  • 148 views
  • 0 likes
  • 2 in conversation