BookmarkSubscribeRSS Feed
hina
Calcite | Level 5
Hi,
I have the following code that takes a huge file houtpt073 and deletes all appropriate rows based off certain column headings (serv_type, provider_id) for all non-outpatient claims. I can follow the code until it gets to the merge statement, where I don't understand what is happening. I would like to be able to recreate this in Access. Can someone please explain the "then delete" portion?

DATA H1;
SET HF.HOUTPT073;

IF SERV_TYPE3 IN ('EMERGENCY');
RUN;

DATA H2;
SET HF.HOUTPT073;

IF SERV_TYPE1 IN ('OUTPATIENT');
IF SUBSTR(PROVIDER_ID,1,2) IN ('81','82') THEN DELETE;

RUN;

PROC SORT DATA=H1 NODUPKEY; BY CLAIM_NUMBER; RUN;
PROC SORT DATA=H2; BY CLAIM_NUMBER; RUN;

DATA HF.SMD2224Q;
MERGE H1(IN=A) H2(IN=B);
BY CLAIM_NUMBER;
IF A AND B THEN DELETE;
RUN;
1 REPLY 1
Paige
Quartz | Level 8
It is deleting any record where the claim number exists in both data sets. (Or, it is keeping records for which the claim number exists in one, but not both, data sets)

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

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.

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
  • 1 reply
  • 542 views
  • 0 likes
  • 2 in conversation