mardi 19 juillet 2016

Creating a flag for first and last in SAS

I want to be able to create a flag, here called timeflag, that is set to 1 for every first and last entry of a certain Session, designated by logflag. What I have is the following but this gives me null data points

data OUT.TENMAY_TIMEFLAG;
    set IN.TENMAY_LOGFLAG;
    if first.logflag then timeflag = 1;
    if last.logflag then timeflag = 1;
run;

What is it about the first. and last. functions that I am not understanding here or is it that I have 2 if statements?

Aucun commentaire:

Enregistrer un commentaire