Hello, I have a variable in my dataset called 'Case_Notes' that could start with a dollar value, and I want to extract that dollar value into a new variable called 'Protected Balance' if it exists. I have been directed to perl regular expressions but am getting lost and could use some help. Here is an example of what the data looks like: Case_Notes $15,229.00 , 9999999999 - known fraud " 9999999999" $1,740.00 , 9999999999- known fraud - calling on multiple accounts $1,155.79 , 9999999999- known fraud -male fraudster calling on female account $14,026.81, 9999999999 - known fraud - fraudster continues to call in $12,495.00 , 9999999999- fraudster calling on multiple accounts $9,936.00 , 9999999999- known fraud - young female calling as ch - true person lives in OH $9,936.00 , 9999999999- known fraud - young female calling as ch - true person lives in OH $5,150.00 , 9999999999- known fraud - male fraudster still calling in $2,565.67 , 9999999999- Two accounts opened and different addresses. Caller stated he send docs in already. $5,150.00 , 9999999999- known fraud - male fraudster still calling in $5,150.00 , 9999999999- known fraud - male fraudster still calling in 9999999999- known fraud - ani calling in IVR on multiple accounts |3974950358 - known fraud - ani calling in IVR on multiple accounts 9999999999 - fraudster calling in , true person lives in SC. 9999999999 - known fraud - female calling on multiple accounts What I need is: Protected_Balance $15,229.00 - $1,740.00 $1,155.79 $14,026.81 $9,936.00 $9,936.00 $5,150.00 $2,565.67 $5,150.00 $5,150.00 - - My latest attempt was: data want;
set have;
format ProtectedBalance dollar10.2;
ProtectedBalance = prxchange('s/.*(\$\d+).*/\1/',-1,case_notes);
where Fraud_Status = 'FRAUD';
run; But that got me nowhere. Any help would be appreciated.
... View more