Desktop productivity for business analysts and programmers

Why did this data step run??

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 104
Accepted Solution

Why did this data step run??

Hi,

 

Here's the data step:

 

/*Excludes benes without Long-Acting Injections dispensed*/

DATA HEDIS.ANTIPSYCH (KEEP=EDIPN);

SET HEDIS.DENOM2A;/*CHANGED FROM HEDIS.CLMS_NDC3 TO HEDIS.DENOM2A*/

WHERE CPT4CODE IN &LAINJ OR 'Medication List'n IN ('Antipsychotic Medications',

'Antipsychotic Combination Medications');

RUN;

 

Originally, the SET HEDIS.DENOM2A was HEDIS.CLMS_NDC3 but it still gave me 15 obs.  I'm baffled as to why that happened because HEDIS.CLMS_NDC3 was not created anywhere in the program but was able to generate observations.  Why would the program be able to read from a data set that does not exist? This is why I changed it to what it is now after realizing this.  Thank you


Accepted Solutions
Solution
3 weeks ago
Regular Contributor
Posts: 181

Re: Why did this data step run??

[ Edited ]

Because it already existed in whatever folder HEDIS is pointing to.

View solution in original post


All Replies
Solution
3 weeks ago
Regular Contributor
Posts: 181

Re: Why did this data step run??

[ Edited ]

Because it already existed in whatever folder HEDIS is pointing to.

Esteemed Advisor
Posts: 5,482

Re: Why did this data step run??

If the datastep didn't work (as would be reflected in the log) the original version of HEDIS.ANTIPSYCH was not replaced. So you might simply be looking at the previous version of HEDIS.ANTIPSYCH.

PG
Super User
Posts: 13,338

Re: Why did this data step run??

It is a good idea to include the LOG with the code and any notes or messages.

 

I suspect that you saw something like:

 

NOTE: There were 15 observations read from the data set HEDIS.CLMS_NDC3.

            Where ...

 

Which would tell you that 1) the data set existed 2) how many records met your Where condition.

or if the data set did not actually exist there would have been an error and a note that the data set HEDIS.ANTIPSYCH was not replaced due to the errors.

Frequent Contributor
Posts: 104

Re: Why did this data step run??

Somehow someone else's data set ended up in my folder, so it should have been NDC2 not NDC3 since it was nowhere in  my program. 

 

Thank you!

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 145 views
  • 0 likes
  • 4 in conversation