Create format from dataset

This post was kindly contributed by SAS & Statistics - go there to comment and to read the full post.

data fmt(keep=fmtname start label);
&nbsp &nbsp &nbsp set temp;
&nbsp &nbsp &nbsp fmtname=”TRTFMT”;
&nbsp &nbsp &nbsp start=trtgrp;
&nbsp &nbsp &nbsp label=trtlbl;
run;

proc format library=work cntlin=fmt;
run;

=================
TEMP:
trtgrp&nbsp &nbsp &nbsp trtlbl
1&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp Treatment 1
2&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp Treatment 2
3&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp Placebo

This post was kindly contributed by SAS & Statistics - go there to comment and to read the full post.