Could someone please help me to understand how I could convert the following into PROC SORT then PROC RANK?
ROW_NUMBER() OVER (PARTITION BY UNIQUE_ID ORDER BY mem_no desc, drug_id desc, RX_FILL_DT ASC) AS RANK
FYI, formats:
alphanumeric:
UNIQUE_ID
DRUG_ID
date:
RX_FILL_DT
numeric:
MEM_NO
SAS EG v. 7.13
if first.rx_fill_dt_asc ...
I think auto correct deleted the period, there should be a period between.
FIRST. identifies the first in that particular variable group.
PROC SORT data=have;
by mem_no desc descending drug_id RX_FILL_DT ASC;
run;
proc rank data=have;
by < ... >;
VAR ...;
run;
I'm not sure what variable is being ranked here or if it's just creating a count variable per group. I suspect the latter which would be easier in a data step.
data want;
set have;
by < >;
if first rx_fill_dt_asc then count=0;
count+1;
run;
if first.rx_fill_dt_asc ...
I think auto correct deleted the period, there should be a period between.
FIRST. identifies the first in that particular variable group.
Good afternoon!
Have you solved the case? I have the same arithmetic overflow problem.
@OsiasEduardo wrote:
Good afternoon!
Have you solved the case? I have the same arithmetic overflow problem.
This post has nothing to do with arithmetic overflow. Please post your question as a new post.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.