Recently in the SAS Community Library: SAS' @BethEbersole reveals 4 steps to stop money laundering, solve law-enforcement cases, find missing children and more with SAS Visual Investigator.
Hi, I have a table from which I want to store in a macro variable all columns that contain a specific value. For example: data have; input abc def ghi jkl 8.; datalines; 1 4 2 3 6 99 0 8 3 99 6 5 2 4 0 99 ; run; Here I would like to obtain all columns which contain the value 99: def, jkl.
... View more
Hi, I would like to ask for your help regarding the issue on subject. I already tried the solution provided in the https://communities.sas.com/t5/SAS-Programming/Read-in-raw-pipe-enclosed-data-separated-by-commas-SAS-9-4/td-p/552481 solved by @Tom but the records exceeding the 257 length are truncated causing for misaligned imported records. I've tried changing the lrecl value from 1 to 32767 and the char1 to char32767 but it still doesn't solved the issue with truncation. Another issue with the raw data is that the empty records are not pipe enclosed. Hope that someone can help me with this. Thanks and advance!
... View more
Hi - First post here and fairly new to SAS. I have found a lot of help on this board and hoping I can get some on this issue. I feel like I should be using first./last. by looking at other examples but my calculations aren't coming out correctly (or at all) I have a transaction file with the payment_amt and adjustment_amt in two different fields. I am using a data step to combine these all into one column as I feel that would be easier to do the calculation. I am also given an EOD balance that I can compare to the balance currently in our system. Obviously, doing these calculation per line cause a large number of "balance exceptions" How can I calculate the total adjustment & payment amount if there are multiple transactions for an account on different lines? This is the dataset that I'm trying to do the calculations on (imported from a csv) - "newtrans_amt" is the amount I've combined PAYMENT_AMT and ADJUSTMENT_AMT into data combinekeys; set re_pay; PAYMENT_AMT = tranwrd(PAYMENT_AMT, ",", ""); ADJUSTMENT_AMT = tranwrd(ADJUSTMENT_AMT, ",", ""); EOD_BALANCE = tranwrd(EOD_BALANCE, ",", ""); PAYMENT_AMT = compress(PAYMENT_AMT); ADJUSTMENT_AMT = compress(ADJUSTMENT_AMT); EOD_BALANCE = compress(EOD_BALANCE); format newkey $10.; if ADJUSTMENT_KEY ne "" then newkey = ADJUSTMENT_KEY; IF PAYMENT_KEY ne "" then newkey = PAYMENT_KEY; if ADJUSTMENT_AMT ne "" then newtrans_amt = ADJUSTMENT_AMT; if PAYMENT_AMT ne "" then newtrans_amt = PAYMENT_AMT*-1; run; proc sort data=combinekeys; by CONSUMERNO; run; From this point I'm kind of lost on how to: -total the total transaction amount using "newtrans_amt" by CONSUMERNO -If I can get a valid amount on in newtrans_amt, I should be able to take care of comparing that amount with what our system balance will be. to match with EOD_BALANCE. Any help is greatly appreciated.
... View more