SAS Programming

DATA Step, Macro, Functions and more
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;

sas-innovate-white.png

Join us for our biggest event of the year!

Four days of inspiring keynotes, product reveals, hands-on learning opportunities, deep-dive demos, and peer-led breakouts. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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