Restriction: | You cannot use the WHERE option to affect the output because PROC CONTENTS does not process any observations. |
Tip: | You can use data set options with the DATA=, OUT=, and OUT2= options. You can use any global statements as well. |
Example: | Describing a SAS Data Set |
contents data=HtWt;To obtain the contents of a specific version from a generation group, use the GENNUM= data set option as shown in the following CONTENTS statement:
contents data=HtWt(gennum=3);
proc datasets memtype=data; contents data=_all_; run;
OUT2= does not suppress the printed output from the statement. To suppress the printed output, use the NOPRINT option.
data a; length aa 7 bb 6 cc $10 dd 8 ee 3; aa = 1; bb = 2; cc = 'abc'; dd = 3; ee = 4; ff = 5; output; run; proc contents data=a out=a1; run; proc print data=a1(keep=name length varnum npos); run;
NEW PROC CONTENTS RESULTS NEEDED HERE!!!! The SAS System OBS NAME LENGTH VARNUM NPOS 1 aa 7 1 16 2 bb 6 2 23 3 cc 10 3 32 4 dd 8 4 0 5 ee 3 5 29 6 ff 8 6 8
NEW PROC PRINT HERE.
data b; length aa 6 cc $1; aa = 1; cc = 'x'; output; run; proc contents data=b out=b1; run; proc print data=b1(keep=name length varnum npos); run;
The SAS System OBS NAME LENGTH VARNUM NPOS 1 aa 6 1 0 2 cc 1 2 6