DATA Step, Macro, Functions and more

The STRIP function call has too many arguments.

Accepted Solution Solved
Reply
Super Contributor
Posts: 345
Accepted Solution

The STRIP function call has too many arguments.

I want to remove leading zero and trailing zero, so I want to modify my variable by doing below:

var2 = strip(var1,'0');

I got the error message:

The STRIP function call has too many arguments.

 

 

anybody helps to solve this?

thanks


Accepted Solutions
Solution
‎07-20-2016 12:33 PM
Respected Advisor
Posts: 3,156

Re: The STRIP function call has too many arguments.

Unfortunately STRIP() does not have that function. For details, please refer strip function

 

For your problems, you can either try using a combination of multiple functions/multiple steps, Or using PRX function in one shot:

 

DATA HAVE;
INPUT STR $20.;
CARDS;
0012200
00023
22000
200340
;


DATA WANT;
SET HAVE;
NEW_STR=PRXCHANGE('s/^ *0*|0* *$//io', -1, str);
run;

 

 

View solution in original post


All Replies
Solution
‎07-20-2016 12:33 PM
Respected Advisor
Posts: 3,156

Re: The STRIP function call has too many arguments.

Unfortunately STRIP() does not have that function. For details, please refer strip function

 

For your problems, you can either try using a combination of multiple functions/multiple steps, Or using PRX function in one shot:

 

DATA HAVE;
INPUT STR $20.;
CARDS;
0012200
00023
22000
200340
;


DATA WANT;
SET HAVE;
NEW_STR=PRXCHANGE('s/^ *0*|0* *$//io', -1, str);
run;

 

 

☑ This topic is solved.

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

Discussion stats
  • 1 reply
  • 414 views
  • 1 like
  • 2 in conversation