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

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;

1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

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

3 REPLIES 3
gauthamk28
Obsidian | Level 7
Proc print data=one;
BrunoMueller
SAS Super FREQ

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

pacruz
Calcite | Level 5
It worked, thank you!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 3 replies
  • 812 views
  • 0 likes
  • 3 in conversation