DATA Step, Macro, Functions and more

Function to subtract right-to-left data

Accepted Solution Solved
Reply
New Contributor
Posts: 4
Accepted Solution

Function to subtract right-to-left data

[ Edited ]

Hello

 

Is there any function that allows me substract information rigth to left data?

 

Thanks.


Accepted Solutions
Solution
‎03-07-2017 07:48 AM
Super User
Posts: 17,748

Re: Function to subtract right-to-left data

1. DONT YELL. ALL CAPS IS YELLING AND YELLING IS RUDE, ESPECIALLY WHEN ASKING FOR HELP. 

2. You show us what you have but not what you need. 

3. Your vague comment about zeros makes me suspect you want to remove leading zeroes. If that's the case, convert the character variable to a numeric variable.

 

If not, post what you have and what you want, as text, not an image. When you post an image, if you want code as help, are you expecting us to type out your data to test it? Help us help you by making the problem clear and as easy to follow as possible. Please consider taking some more time to illustrate your problem. 

View solution in original post


All Replies
Super User
Posts: 3,101

Re: Function to subtract right-to-left data

Your question is not clear but I suggest you check out the REVERSE function to see if it fits your needs. If you want further help please provide an example of what you want.

New Contributor
Posts: 4

Re: Function to subtract right-to-left data

HELLO SASKIWI THE INFORMATION IS NOT EQUAL, I NEED TO EXTRACT FROM RIGHT TO LEFT AND DO NOT INCLUDE THE ZERO THAT ARE TO THE RIGHT
HELP.png
Super User
Posts: 17,748

Re: Function to subtract right-to-left data

Probably but what does subtract mean? Are you referring to the mathematical operation? Or a string operation? Or something else.

 

As indicated your question is vague, please post some example data and what you expect output. Otherwise, I suggest googling: SAS Functions by Category 9.4

 

One of the first results will be the documentation which lists functions by category and you can find one or several that will help you accomplish what you need. 

New Contributor
Posts: 4

Re: Function to subtract right-to-left data

>HELLO REEZA THE INFORMATION IS NOT EQUAL, I NEED TO EXTRACT FROM RIGHT TO LEFT AND DO NOT INCLUDE THE ZERO THAT ARE TO THE RIGHT
HELP.png
Solution
‎03-07-2017 07:48 AM
Super User
Posts: 17,748

Re: Function to subtract right-to-left data

1. DONT YELL. ALL CAPS IS YELLING AND YELLING IS RUDE, ESPECIALLY WHEN ASKING FOR HELP. 

2. You show us what you have but not what you need. 

3. Your vague comment about zeros makes me suspect you want to remove leading zeroes. If that's the case, convert the character variable to a numeric variable.

 

If not, post what you have and what you want, as text, not an image. When you post an image, if you want code as help, are you expecting us to type out your data to test it? Help us help you by making the problem clear and as easy to follow as possible. Please consider taking some more time to illustrate your problem. 

New Contributor
Posts: 4

Re: Function to subtract right-to-left data

Thanks Reeza for your recommendations And I apologize for the caps, I did not know that rude.
☑ This topic is SOLVED.

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

Discussion stats
  • 6 replies
  • 210 views
  • 6 likes
  • 3 in conversation