BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
cvilme1998
Fluorite | Level 6

example1.png

Above is the exact format I am trying to achieve, but through my code listed below:

%let raw=P:\SAS\71342_example\Data\Raw Data Sets;
%let SASdat=P:\SAS\71342_example\Data\SAS Data Sets;
libname BookData "&SASdat";
filename RawData "&raw";
run;
proc contents data = sashelp.bweight varnum;
run;

 

My output has been this:

The SAS System

The CONTENTS Procedure
Engine/Host Dependent
65536
62
1
817
790
0
YES
C:\Program Files\SASHome\SASFoundation\9.4\core\sashelp\bweight.sas7bdat
9.0401M6
X64_SR12R2
BUILTIN\Administrators
4MB
4128768

 

Variables in Creation Order# Variable Type Len Label12345678910
WeightNum8Infant Birth Weight
BlackNum8Black Mother
MarriedNum8Married Mother
BoyNum8Baby Boy
MomAgeNum8Mother's Age
MomSmokeNum8Smoking Mother
CigsPerDayNum8Cigarettes Per Day
MomWtGainNum8Mother's Pregnancy Weight Gain
VisitNum8Prenatal Visit
MomEdLevelNum8Mother's Education Level
1 ACCEPTED SOLUTION
6 REPLIES 6
cvilme1998
Fluorite | Level 6

Essentially I want to remove the Engine/Host information, and keep the other information

cvilme1998
Fluorite | Level 6

example1.png

Above is the exact format I am trying to achieve, but through my code listed below:

%let raw=P:\SAS\71342_example\Data\Raw Data Sets;
%let SASdat=P:\SAS\71342_example\Data\SAS Data Sets;
libname BookData "&SASdat";
filename RawData "&raw";
run;
proc contents data = sashelp.bweight varnum;
run;

 

My output has been this. Essentially I want to remove the Engine/Host information and keep the other information, and I want it to look like the above output. 

 

The SAS System

The CONTENTS Procedure
Engine/Host Dependent
65536
62
1
817
790
0
YES
C:\Program Files\SASHome\SASFoundation\9.4\core\sashelp\bweight.sas7bdat
9.0401M6
X64_SR12R2
BUILTIN\Administrators
4MB
4128768

 

Variables in Creation Order# Variable Type Len Label12345678910
WeightNum8Infant Birth Weight
BlackNum8Black Mother
MarriedNum8Married Mother
BoyNum8Baby Boy
MomAgeNum8Mother's Age
MomSmokeNum8Smoking Mother
CigsPerDayNum8Cigarettes Per Day
MomWtGainNum8Mother's Pregnancy Weight Gain
VisitNum8Prenatal Visit
MomEdLevelNum8Mother's Education Level
ChrisNZ
Tourmaline | Level 20

If @Kurt_Bremser 's reply doesn't suit your needs,2 options:

1- Have your program edit the output report (HTML file for example) if you can

2- Use option out= and create the report yourself from the output dataset(s)

japelin
Rhodochrosite | Level 12

use ods select.

 

ods html;
ods select Attributes;
proc contents data = sashelp.bweight varnum;
run;
ods html close;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 2716 views
  • 1 like
  • 4 in conversation