## how to add a fix number to data (with positive and negative values) without getting affected by sign

Solved
Frequent Contributor
Posts: 87

# how to add a fix number to data (with positive and negative values) without getting affected by sign

``````data have;
infile cards truncover expandtabs;
input X;
cards;
248
182
115
48
-19
-84
-146
-205
-258
-307
349
384
-413
-436
452
462
-468
-469
-467
-463
;
run;``````

So that the output looks like this:

 X X_new 248 308 182 242 115 175 48 108 -19 -79 -84 -144 -146 -206 -205 -265 -258 -318 -307 -367 349 409 384 444 -413 -473 -436 -496 452 512 462 522 -468 -528 -469 -529 -467 -527 -463 -523

Accepted Solutions
Solution
‎11-25-2016 12:11 PM
Posts: 3,186

## Re: how to add a fix number to data (with positive and negative values) without getting affected by

``````data have;
infile cards truncover expandtabs;
input X ;
X_plus_60=(abs(x)+60)*(x/abs(x));
cards;
248
182
115
48
-19
-84
-146
-205
-258
-307
349
384
-413
-436
452
462
-468
-469
-467
-463
;
run;

``````

All Replies
Solution
‎11-25-2016 12:11 PM
Posts: 3,186

## Re: how to add a fix number to data (with positive and negative values) without getting affected by

``````data have;
infile cards truncover expandtabs;
input X ;
X_plus_60=(abs(x)+60)*(x/abs(x));
cards;
248
182
115
48
-19
-84
-146
-205
-258
-307
349
384
-413
-436
452
462
-468
-469
-467
-463
;
run;

``````
☑ This topic is solved.