BookmarkSubscribeRSS Feed
Elle
Quartz | Level 8

Hello,

 

I'm using SAS Model Implementation Platform and need to integrate some Base SAS code in order to do some calculations.

I would like to know if there's a function equivalent for this:

 

proc sql;
   select SUM(subaccount_EAD) as account_EAD
   from table
   group by account_number;
quit;

My variables are: account_number, subaccount_number and subaccount_EAD.

I'm looking for a function like: sumby.account_number(subaccount_EAD) if such a thing even exists.

I cannot use data steps or proc sql in MIP.

So, ... help?

2 REPLIES 2
Rick_SAS
SAS Super FREQ

if you sort the data by the grouping variable, you can use BY group processing in the DATA step:

 

proc sort data=sashelp.class out=Class;
by sex;
run;

data Want;
set Class;
by Sex;
if first.Sex then sum=0;
sum + height;
if last.Sex then output;
keep Sex Sum;
run;

proc print;run;
Elle
Quartz | Level 8

Thank you for your post, but I cannot use any form of data steps, procedures or statements in MIP. ONLY functions.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 659 views
  • 0 likes
  • 2 in conversation