## how to remove comma

Solved
Occasional Contributor
Posts: 11

# how to remove comma

How to extract salary without Rs and comma in salary as in the raw file. I am not able to find my mistake.

this is my code

data sasdata.new;
infile "F:\Raw.txt";
input Id @3 Name \$3. @17 Incentive : percent3. @10 Salary : comma9.;
Total=salary+salary*incentive;
run;

attached the raw data file.

Accepted Solutions
Solution
‎04-24-2017 04:39 AM
Posts: 1,147

## Re: how to remove comma

data new;
infile cards missover;
input Id @3 Name \$3. @17 Incentive : percent3. @9 Salary :comma9.;
Total=salary+salary*incentive;
cards;
1 Ram Rs250,100 44%
2 xyz Rs310,000 20%
3 Abc Rs420,000 30%
4 MMN Rs520,000 40%
;

@ holds the input record for the execution of the next INPUT statement within the same iteration of the DATA step. This line-hold specifier is called trailing @.
Thanks,
Jag

All Replies
Super User
Posts: 23,791

## Re: how to remove comma

Doesn't Salary start at 9, not 10?

Occasional Contributor
Posts: 11

## Re: how to remove comma

Hi Reeza,

I am new to sas. Can you tell me the function of @ and : in sas programming. I am not exactly able to get it.

Thanks

Solution
‎04-24-2017 04:39 AM
Posts: 1,147

## Re: how to remove comma

data new;
infile cards missover;
input Id @3 Name \$3. @17 Incentive : percent3. @9 Salary :comma9.;
Total=salary+salary*incentive;
cards;
1 Ram Rs250,100 44%
2 xyz Rs310,000 20%
3 Abc Rs420,000 30%
4 MMN Rs520,000 40%
;

@ holds the input record for the execution of the next INPUT statement within the same iteration of the DATA step. This line-hold specifier is called trailing @.
Thanks,
Jag
Occasional Contributor
Posts: 11