05-27-2014 05:14 PM
I have a data set and I attached it to my message. You can see it below.
I want to calculate bolt_volume. It looks simple but I couldn't get correct results. The formula has already written in excel sheet.
bolt_volume[row2] = ( bolt_area[row1] + bolt_area[row2] ) / 2 * bolt_len[row2]
bolt_volume[row3] = ( bolt_area[row2] + bolt_area[row3] ) / 2 * bolt_len[row3]
Thank you for your help.
05-29-2014 08:52 PM
My original data set has more than 2000 observations. After I saw your message, I checked your codes and Nadeem's codes for my data set. But I couldn't see wrong values 1st record of the 2nd through Nth by groups.
05-29-2014 10:54 PM
I stand corrected! I hadn't noticed that bolt_len was always missing for your first record within an id. If that is the case in all situations, then Naeem's code will provide the correct result.
06-13-2017 04:14 AM - edited 06-14-2017 08:12 AM
An operator in SAS is a symbol which is used in a mathematical, logical or comparison expression.
Example Arithmetic Operators.
input @1 COL1 4.2 @7 COL2 3.1;
Add_result = COL1+COL2;
Sub_result = COL1-COL2;
Mult_result = COL1*COL2;
Div_result = COL1/COL2;
Expo_result = COL1**COL2;
PROC PRINT DATA=MYDATA1;
On running the above code, we get the following output.
Need further help from the community? Please ask a new question.