04-20-2015 04:00 PM
set works._RefDate_ end=eof;
if eof then call execute('data &syslast; set &syslast;');
if eof then call execute('label AEENDY = "relative day of ' || strip(vlabel(AEENDT)) || '";');
if eof then call execute('run;');
NOTE: CALL EXECUTE generated line.
1 + data WORKS._REFDATE_ ; set WORKS._REFDATE_ ;
2 + label AEENDY = "relative day of End Date of Adverse Event";
3 + run;
But the issue is the variable AEENDY is not assigned the label in SAS Data set,but its showing log.can some help me.
04-20-2015 04:27 PM
Get the value of the label into another variable and use call label instead of label:
NewLabel = catx(' ','relative day of',vlabel(aeendt));
call label (aeendy,NewLabel);
I don't think you even need to go the call execute or worry about EOF part.
04-20-2015 09:25 PM
NewLabel = catx(' ','relative day of',vlabel(AEENDT));
call label (AEENDY,NewLabel);
04-20-2015 11:46 PM
Unfortunately call label doesnt work that way afaik. Its a feature that sorely needs to be added.
Your original code should have worked.
Please post a proc contents before and after the run. When you rename datasets with the same name it can be difficult to debug. Or try using a proc datasets to apply the label instead of a data step.