data adsl01; length usubjid $10 sex $1 age 8 trt01pn 8; input usubjid $ sex $ age trt01pn; datalines; 101 M 25 1 102 F 30 2 103 M 27 1 ; run; data adsl02; set adsl01; label usubjid = "Unique Subject Identifier" sex = "Sex" age = "Age" trt01pn = "Planned Treatment for Period 01 (N)" ; run; proccontentsdata=adsl02 out=cont01(keep=name label length); run;
We create a dataset adsl01 with proper lengths using the LENGTH statement.
Then in a new step, we assign variable labels using the LABEL statement.
These labels help provide human-readable names for variables (visible in procedures like PROC PRINT, PROC REPORT, etc.).