DATA Step StructureΒΆ

DATA steps are declared by the keyword data followed by an output dataset that SAS will write to. The output dataset may be a temporary file (no libname). In most applications, you will specify an input dataset using the set statement. This is the data SAS will read in, manipulate, and save to the output file. The set and data file can be the same file. You can also append multiple datasets together by listing multiple inputs to the set statement. To conclude the data step you use a run statement.

data library.out_filename;
    set library.in_filename;
        /* data step statements go here */
run;

You can append in_filename_1 and in_filename_2 like so

data library.out_filename;
    set library.in_filename_1 library.in_filename_2;
    /* data step statements */
run;