Wednesday, March 7, 2018

New way to keep data structure in DATA step

In most time, you don't want to add any new variable in DATA step. Normally we create one list of all original variables before DATA step. Actually we can have better way to address this. Please see codes at below:
DATA TEST (DROP=START -- END);
    IF 0 THEN SET SASHELP.CLASS;
    IF 0 THEN START = 0;

    SET SASHELP.CLASS;

    A=1;B=1; * Test Variables;

    IF 0 THEN END = 0;
RUN; 

No comments: