DATA Step, Macro, Functions and more

I need help computing the volume of the following.

Accepted Solution Solved
Reply
Contributor
Posts: 21
Accepted Solution

I need help computing the volume of the following.

DATA one;
INPUT Type $ Circumference (inch) Height (ft) Crown (ft);
Volume=0.319 * height * 0.0000163 * circumference^2;
DATALINES;
oak, black 222 105 112
hemlock, eastern 149 138 52
ash, white 258 80 70
cherry, black 187 91 75
maple, red 210 99 74
elm, american 229 127 104
;
RUN;
PROC PRINT;
var Volume;
RUN;


Accepted Solutions
Solution
‎03-17-2017 01:17 PM
SAS Super FREQ
Posts: 708

Re: I need help computing the volume of the following.

Hi

 

Try the code below. Bedefault the delimter for data items is a blank, so you also need to read the type.

The exponentiation operator in SAS is **

 

DATA one;

INPUT Type $ type2 $  Circumference Height Crown;
Volume = 0.319 * height * 0.0000163 * circumference**2;
DATALINES;
oak, black 222 105 112
hemlock, eastern 149 138 52
ash, white 258 80 70
cherry, black 187 91 75
maple, red 210 99 74
elm, american 229 127 104
;

PROC PRINT;
RUN;

Bruno

View solution in original post


All Replies
Contributor
Posts: 21

Re: I need help computing the volume of the following.

Proc print data=one;
Solution
‎03-17-2017 01:17 PM
SAS Super FREQ
Posts: 708

Re: I need help computing the volume of the following.

Hi

 

Try the code below. Bedefault the delimter for data items is a blank, so you also need to read the type.

The exponentiation operator in SAS is **

 

DATA one;

INPUT Type $ type2 $  Circumference Height Crown;
Volume = 0.319 * height * 0.0000163 * circumference**2;
DATALINES;
oak, black 222 105 112
hemlock, eastern 149 138 52
ash, white 258 80 70
cherry, black 187 91 75
maple, red 210 99 74
elm, american 229 127 104
;

PROC PRINT;
RUN;

Bruno

Contributor
Posts: 21

Re: I need help computing the volume of the following.

Posted in reply to Bruno_SAS
It worked, thank you!
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 152 views
  • 0 likes
  • 3 in conversation