## How can I add small epsilon then combine to one variable

Solved
Super Contributor
Posts: 328

# 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

 1 2 1 1.5 2 3 3 4.5 3.1 5.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
Posts: 5,541

## 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

All Replies
Super User
Posts: 23,776

## 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
Posts: 5,541

## 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 and locked.