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
We are excited to announce the winners of the 2024 Customer Recognition Awards. We want to give a big “thank you” and round of applause to all our SAS customers around the globe who help us change the world through analytics. Below we recognize the winners in each category for their stand-out contributions over the past year. Click here to check out the winner's eBook.
Awards from customer-submitted entries
Community Uplift Award
Awarded to a SAS customer who made an impact in their community at large using SAS products.
1 st Place Winner: CPESN, United States.
2 nd Place Winner: Istanbul Airport, Turkey.
3 rd Place Winner: Johns Hopkins, United States.
Curious Thinker
Awarded to a SAS customer who embodies curiosity, one of SAS’ guiding principles.
1 st Place Winner: Pegasus Airlines, Turkey
2 nd Place Winner: QNB Finansbank, Turkey.
3 rd Place Winner: EY, Germany.
Innovative Problem Solver
Awarded to a SAS customer who uses SAS in innovative ways to solve a business problem.
1 st Place Winner: Shionogi, Japan.
2 nd Place Winner: Istanbul Airport, Turkey.
3 rd Place Winner: University of Nevada, United States.
ROI Rock Star
Awarded to a SAS customer demonstrating the greatest business benefit and return on investment (ROI) using SAS products.
1 st Place Winner: American Electric Power, United States.
2 nd Place Winner: Enpara Bank, Turkey.
3 rd Place Winner: UC AB, Sweden.
SAS Analytics Explorers Advocate
Awarded to a SAS customer who is using the SAS Analytics Explorers program to grow their skills, career and/or network..
1 st Place Winner: DEG, Daniel Frank, Germany.
2 nd Place Winner: Alira Health, Davide Marinucci, Italy.
3 rd Place Winner: EY, Markus Weick, Germany.
Awards selected by SAS
SAS Customer Impact Award – Public Sector
Awarded to a public sector customer who has had the most impact through a willingness to share their analytics journey, successes and lessons learned with others.
Winner: AGEA, Italy.
AGEA has been greatly involved and committed to share their project and their partnership with SAS spending great words of appreciation for us, both in terms of solutions and people. They have participated at events, talks, and released interviews highlighting how SAS is a critical player for their success. In addition, AGEA is part of a wide ecosystem made of several stakeholders and the key pillar sustaining Italian agriculture, which is a significant part of the Italian Gross Domestic Product and a crucial asset for environmental safety.
SAS Customer Impact Award – Private Sector
Awarded to a private sector customer who has had the most impact through a willingness to share their analytics journey, successes and lessons learned with others.
Winner: Georgia Pacific, United States.
Georgia-Pacific has been a SAS advocate since March 2020 when they first partnered with SAS to share their experience at SAS Global Forum that year. They have shared their voice consistently since then and were the first recipient of the Customer Impact Award in 2022. Just since last summer (2023), they have partnered with SAS on multiple video testimonials on topics ranging from Data Strategy, Computer Vision and Resiliency Rules which all supplement their original story on Optimizing the Supply Chain and equipment efficiency with analytics and IoT. They have done interviews with analysts and spoken at SAS and third-party events to showcase their innovative use of analytics. They have worked with SAS to publish multiple blog posts and articles on sas.com, provided quotes for press releases and supported the publication of their SAS story on the AWS website. The number of individuals from Georgia-Pacific who participate as SAS advocates continues to grow. In particular, we recognize Roshan Shah, who is accepting the award on their behalf and also Steve Bakalar, Sam Coyne, Chalamayya Batchu and Ron Oudenaarden. We appreciate them and their teams who are making a difference every day using SAS and are willing to share their experience to benefit others.
SAS Support Community Hero
Awarded to a customer that goes above and beyond helping other users on the SAS Support Community.
Winner: Mark Keintz, United States.
Mark has been a member since 2012. He has solved nearly 700 topics and posted more than 4,000 messages, mostly in the popular SAS Programming Community. He recently achieved PROC Star status, which celebrates active community members whose interactions on SAS Communities (the largest digital gathering of SAS practitioners) are exceptionally frequent and helpful. His years of wisdom from using SAS on the business side of academia enables him to dispense prompt, incisive assistance in the New SAS User Community.
Users Group MVP
Awarded to a Regional Users Group leader demonstrating a dedicated passion for the success of user group members.
Winner: Nancy Brucken, IQVIA, United States.
Nancy has been involved in planning and executing users group meetings since 1999. She is the webmaster for the Michigan SAS Users Group and a member of the Executive Committee for PharmaSUG. She is an integral member of both conferences, ensuring attendees get the educational experience they’ve come to expect from a user’s group. Her planning and attention detail led to one of the most successful local users group meetings, MSUG, in 2023. SAS thanks Nancy for helping to educate her peers for more than 20 years.
User Feedback Award
Awarded to a customer who provides valuable feedback on SAS products and has been an essential reference for product improvements.
Winner: Nick Tornabene, USAA, United States.
Nick has provided insight into the performance statistics achieved at USAA and worked with SAS R&D to identify areas that could be tuned or optimized based on the customer-specific scenarios. Nick’s feedback has been instrumental not only in the context of USAA but also in more general scenarios that other banks face. He offered valuable information, which helped SAS improve the SAS Risk Solutions and offer a more complete set of capabilities.
Check out some of our winner videos below!
Customer Impact Award - Public Sector Winner
User Feedback Award Winner
Innovative Problem Solver Winner
Curious Thinker Winner
... View more
Hello everyone: I'm writing a task and one of the objects (daterange) returns a couple of dates to two macro variables. I can read these two variables properly to a table with the following code: options locale=English_UnitedStates;
%let d1 = February 24, 2003;
data test;
dd = input("&d1", nldate200.);
run; But I can't read read the date in the macro variable and save it in another one with the format I need (date9. would ideal). I have tried the following, but it doesn't work. options locale=English_UnitedStates;
%let d1 = February 24, 2003;
%let d2 = %sysfunc(inputn("&d1", nldate200.), date9.);
%put &d2; Any help is appreciated.
... View more
Hi,
I need some help with writing a SAS code to handle the following scenario.
I have a data set that has multiple sites; each site has multiple patients; and each patient can have data of up to 7 days (one row represents one day). The data set has form start and save time. Data set is also setup to have no duplicates. First day data of each patient should always have the previous save and open time (both are user defined variables) as NULL. e.g., sr.1, 8, and 9 will have previous open and save time variables as NULL. And using these variables, I want to calculate the the following for each patient at a site:
number of hours a patient took between today's and yesterday's start times (i.e., from today's start to previous start) and
number of hours a patient took between today's open and yesterday's start times (i.e., from today's start to previous day save)
Sr.
PT
SITE
START_TIME
SAVE_TIME
1
001
01
4/9/2024 16:44
4/9/2024 16:46
2
001
01
4/10/2024 16:39
4/10/2024 16:40
3
001
01
4/11/2024 16:07
4/11/2024 16:08
4
001
01
4/12/2024 16:05
4/12/2024 16:06
5
001
01
4/13/2024 20:05
4/13/2024 20:06
6
001
01
4/14/2024 19:31
4/14/2024 19:52
7
001
01
4/15/2024 16:25
4/15/2024 16:25
8
002
01
4/15/2024 16:19
4/15/2024 16:20
9
003
01
4/15/2024 16:21
4/15/2024 16:22
10
002
02
4/3/2024 18:34
4/3/2024 18:41
11
002
02
4/4/2024 18:03
4/4/2024 18:09
12
002
02
4/6/2024 21:11
4/6/2024 21:14
13
002
02
4/6/2024 21:14
4/6/2024 21:16
14
002
02
4/7/2024 18:17
4/7/2024 18:20
15
002
02
4/8/2024 18:12
4/8/2024 18:14
16
002
02
4/9/2024 18:06
4/9/2024 18:08
17
004
02
4/5/2024 18:03
4/5/2024 18:10
18
004
02
4/6/2024 16:27
4/6/2024 16:32
19
004
02
4/7/2024 19:18
4/7/2024 19:22
20
004
02
4/8/2024 18:01
4/8/2024 18:07
21
004
02
4/9/2024 18:06
4/9/2024 18:16
22
004
02
4/10/2024 18:08
4/10/2024 18:10
23
004
02
4/11/2024 19:22
4/11/2024 19:26
24
005
02
4/8/2024 18:05
4/8/2024 18:07
25
005
02
4/9/2024 19:32
4/9/2024 19:34
26
005
02
4/10/2024 18:45
4/10/2024 18:47
27
005
02
4/11/2024 18:02
4/11/2024 18:04
28
005
02
4/12/2024 18:04
4/12/2024 18:07
29
005
02
4/13/2024 18:01
4/13/2024 18:03
30
005
02
4/14/2024 18:06
4/14/2024 18:08
Thanks so much in advance for all the help.
... 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