Recently in the SAS Community Library: SAS' @StuartRogers provides a close look at the new Microsoft Entra Gallery application and details how it can be used.
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
I want to create a master detail subdetail report within SAS BASE (proc report).
You woud have a master row with colums. The master has detail rows with different columns and detail row also subdetail rows with comments.
I don't want all the columns master,detail, subdetail on one row and master, detail, subdetail should be on the same page.
The result will be converted to pdf.
The output would look something like the below example:
Procesname Start date end date Detail info
-----------------------------------------------------------------------------------------
Walking 01-01-2024 10-04-2024 I walk very slow
Subproces start date end data Start place end place
-----------------------------------------------------------------------------------------------------
Part 1 01-1-2024 10-01-2024 New York Amsterdam
Comments
--------------------------------------------------------------------------------------------
I started very well
The walk was nice
Subproces start date end data Start place end place
-----------------------------------------------------------------------------------------------------
Part 2 10-1-2024 24-01-2024 Amsterdam Berlin
Comments
--------------------------------------------------------------------------------------------
Was perfect
swimming 10-06-2024 10-07-2024 I love swimming
detail
subdetail
... View more
Hello! I have a question. Soon I will work with some data that are located on a shared fold in the google drive. This dataset is a STATA dataset. How can I import a STATA dataset that is located in google drive? Thank you very much for your help!
... View more
data have;
input Name $ Gender $ City $12.;
datalines;
Srilakshmi Female Hyderabad
Vamika Female Bangalore
Prajwal Male Mumbai
;
run;
data want;
set have;
City = substr(City, 1, 1);
Gender = substr(Gender, 1, 1);
Name = substr(scan(Name, 1), 1, 1);
drop Name Gender City;
left_to_right=catx(' ',name,gender,city);
right_to_left=catx(' ',city,gender,name);
run;
Hi Guys ,
Here i want to extract first letter from each variable left to right and right to left
is it correct way or any other method to achieve could you please give solution
... View more
Hello everybody, fairly new in the world of SAS, a curious person,say, learning in his own time. I am trying to riddle out how to make a successful POST/GET request to REST API using %macro and JSON as the primary payload and then set up a table that tracks a history of past requests and responses. Set this task to myself as it's one of the more common things people aim to do in other languages. Working with APIs. While, it takes me about 10 minutes to write such logic in JS or Python without any headaches, though I cannot string up a working logic in SAS using %macro (a term function could also be used as a synonym I guess?). A non-macro approach clicked using datalines and a hard-coded value as a prompt. I am now well aware that datalines will not budge when using macro logic so I went with put, but still not a single budge. Here's the code that I have managed to jot down so far. The API is crudcrud.com allowing up to 100 free requests. %macro api_post_request(prompt=);
%let api_url=url;
filename json_in temp;
data _null_;
file in;
put "{
""username"":""&prompt""
}"
;
run;
filename resp temp;
proc http method="POST"
url="&api_url
ct="application/json"
in=json_in
out=resp;
headers
"Content-Type"="application/json";
run;
%mend;
%api_post_request(prompt=Player1); Fierce thanks!
... View more