jeudi 17 novembre 2016

Defining a new field conditionally using a put statement

I am trying to define a new value for an observation with a user defined format. However, my if/then/else statement seems to only work for observations with a year value of "2014". The put statements are not working for other values. In SAS, the put statement is blue in the first statement, and black in the other two. Does anyone know what I am missing here? Here is my code:

data claims_t03_group;
    set output.claims_t02_group;
    if year = "2014" then test = put(compress(lookup,"_"),$G_14_PROD35.);
    else if year = "2015" then test = put(compress(lookup,"_"),$G_15_PROD35.);
    else test = put(compress(lookup,"_"),$G_16_PROD35.);
    run;

Aucun commentaire:

Enregistrer un commentaire