How can I add small epsilon then combine to one variable

Accepted Solution Solved
Reply
Super Contributor
Posts: 297
Accepted Solution

How can I add small epsilon then combine to one variable

data bb;

  input t;

  m=t+_n_*0.5;

  cards ;

1

2

5

3

;

OUTPUT

11.01.5
22.03.0
33.04.5
43.15.1

How can I make the output as a variable with 8 observation and order it like this

1  1.0

2   1.5

3  2.0

4  3.0

5  3.0

6  3.1

7  4.5

8  5.1


Accepted Solutions
Solution
‎01-09-2014 08:58 PM
Respected Advisor
Posts: 4,644

Re: How can I add small epsilon then combine to one variable

I think you got your example a bit mixed up. Anyway, this is probably what you want:

data bb;

input t;

output;

t = t + _n_*0.5;

output;

cards;

1

2

5

3

;

PG

PG

View solution in original post


All Replies
Super User
Posts: 17,801

Re: How can I add small epsilon then combine to one variable

Try using an explicit output statement after the calculation?

Untested below:

data bb;

  input t;

  m=t+_n_*0.5;

output;

  cards ;

1

2

5

3

;

run;

Solution
‎01-09-2014 08:58 PM
Respected Advisor
Posts: 4,644

Re: How can I add small epsilon then combine to one variable

I think you got your example a bit mixed up. Anyway, this is probably what you want:

data bb;

input t;

output;

t = t + _n_*0.5;

output;

cards;

1

2

5

3

;

PG

PG
☑ This topic is SOLVED.

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

Discussion stats
  • 2 replies
  • 146 views
  • 0 likes
  • 3 in conversation