About "data federation" in SAS

I am studying data merging in SAS and find the following example

data newdata;
merge yourdata (in=a) otherdata (in=b);
by permno date;   

I do not know what to do? (in = a) "and" (in = b) "means? Thanks.

+3
source share
1 answer

yourdata(in=a)creates a flag variable in a program data vector called 'a' that contains 1 if the entry belongs to your date and 0 if it doesn’t. You can then use these variables to perform conditional operations based on the recording source.

It might be easier to understand if you saw

data newdata;
merge yourdata(in=ThisRecordIsFromYourData) otherdata(in=ThisRecordIsFromOtherData);
by permno date;
run;

Suppose that the records from your data needed to be manipulated at this step, but not from other data, you could do something like

data newdata;
merge yourdata(in=ThisRecordIsFromYourData) otherdata(in=ThisRecordIsFromOtherData);
by permno date;
if ThisRecordIsFromYourData then do;
  * some operation here for yourdata records only ;
end;
run;

, "" , if. , if ThisRecordIsFromYourData and ThisRecordIsFromOtherData; SAS , from (, ).

+7

Source: https://habr.com/ru/post/1786784/


All Articles