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

Can someone please help in adding 60 to each row in the following data:

 

 

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:

 

XX_new
248308
182242
115175
48108
-19-79
-84-144
-146-206
-205-265
-258-318
-307-367
349409
384444
-413-473
-436-496
452512
462522
-468-528
-469-529
-467-527
-463-523
1 ACCEPTED SOLUTION

Accepted Solutions
Haikuo
Onyx | Level 15
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;

View solution in original post

1 REPLY 1
Haikuo
Onyx | Level 15
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;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 1 reply
  • 1284 views
  • 0 likes
  • 2 in conversation