Perhaps Srinu99 wanted to print a list of just labels being used in dataset. The procedure below would produce a text list of Names of variables and labels against those names
SASWORK=own library
saswork.COMPUSTAT5=input data set name

Ods rtf file='D:\SASWORK\VARIABLES.rtf';
proc contents
data = saswork.COMPUSTAT5
out = data_info
(keep = label varnum);
run;
ods rtf close;