## How to required output (multiple of 500)?

Frequent Contributor
Posts: 97

# How to required output (multiple of 500)?

hi ,

i am working with large data base , but i am providing the sample one.

DATA TAXSAVERS;
DATALINES;
2779 50
16050 50
18000 45
17000 65
2566  20
;
RUN;

I need the  REQUITED DATABASE as follows

1) The first step is "load should be deducted " i.e 2779-50=2729

2) The gross or final TAXSAVER amount should be multiple of 500...i.e 2729 ...would be 2500.

shall i  use the MOD function for the second step.

Super Contributor
Posts: 644

## Re: How to required output (multiple of 500)?

DATA TAXSAVERS;

taxsaver = round(nett - 250, 500) ;
DATALINES;
2779 50
16050 50
18000 45
17000 65
2566  20
;
RUN;

The sum function will calculate the nett amount and return only the original amount if you have null (missing) values for load.

The round function will calculate to the nearest multiple of, in this case, 500; to get the highest value less than or equal to the given amount take 250 off first.

Richard

Frequent Contributor
Posts: 97

## Re: How to required output (multiple of 500)?

thanks richard good work...

is there any way to do in PROC SQL...?

Posts: 4,736

## Re: How to required output (multiple of 500)?

Something like below?

DATA TAXSAVERS;
DATALINES;
2779 50
16050 50
18000 45
17000 65
2566  20
;
RUN;

proc sql;
create table want as