01-23-2014 06:52 PM
I'm trying to create a very simple function in SAS 9.3 where I send an address value to a custom-built function, and I want to return an updated value. Here is where the function is created:
proc fcmp outlib=work.functions.test;
I'm not certain what to put for the oulib in the proc fcmp line. Will it work if I use "work.functions.test"?
So basically I want to send the address to the Clean() function and use compress to remove any periods. Here is where I call the function:
NewAddress=Clean("123 Jefferson Ave.");
I tried many many variations of this, and I keep getting the error saying unable to convet a character value to numeric. Any suggestions on what I'm doing wrong? The error log is below. Your help is greatly appreciated!
ERROR: Unable to convert a character value to a numeric value in function 'Clean' in statement number 3 at line 6 column 2.
The statement was:
0 (6:2) _Clean_ = Move N<=C(CleanAddress=" ")
ERROR: Exception occurred during subroutine call.
NewAddress=. NewAdress=. _ERROR_=1 _N_=1
01-23-2014 07:07 PM
It looks like I need to let the function know that the input is character type.
function Clean(address $) $ 50;