DATA Step, Macro, Functions and more

how to select

Accepted Solution Solved
Reply
Occasional Contributor lg2
Occasional Contributor
Posts: 6
Accepted Solution

how to select

i have a Healthfacts databse(Hf_f).I need to write a code to select hf_f diagnosis for the key visits.


Accepted Solutions
Solution
2 weeks ago
Frequent Contributor
Posts: 109

Re: how to select

proc sql;
    select Diagnosis
    from Hf_f
    where Visit='key';
quit;

Not a well worded question!

View solution in original post


All Replies
Solution
2 weeks ago
Frequent Contributor
Posts: 109

Re: how to select

proc sql;
    select Diagnosis
    from Hf_f
    where Visit='key';
quit;

Not a well worded question!

Occasional Contributor lg2
Occasional Contributor
Posts: 6

Re: how to select

proc sql;
select
distinct DIAGNOSIS_ID
into
:dxids SEPARATED BY ","
from
HFD17A.HF_D_DIAGNOSIS
where
PUT(STRIP(DIAGNOSIS_CODE),$MYDX.) NE "OTHER"
;

 

if i do this my output was 

dxids

1324

4320

23345

6120

 

Now i wanted the output as

diagnosis description

depression

stress

anxiety

 

How do i modify the above code to get indescpritve way

Frequent Contributor
Posts: 109

Re: how to select

Use variable Diagnosis_Description instead of Diagnosis_ID in your SELECT statement.
Occasional Contributor lg2
Occasional Contributor
Posts: 6

Re: how to select

what can i put inplace of dxids.?

Frequent Contributor
Posts: 109

Re: how to select

I don't know the details of your data or what you're trying to accomplish; i.e., why you are writing the diagnoses into a macro...
☑ This topic is solved.

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

Discussion stats
  • 5 replies
  • 105 views
  • 0 likes
  • 2 in conversation