BookmarkSubscribeRSS Feed
iksawffej
Fluorite | Level 6

HI, 

I'm currently bothered by a task. 

For the following dataset containing ID and birthday to confirm unique information for each subject. I have to check the actually first bleeding date for each patient, which was defined by

1) bleedingday-14<= gastroscopyday <=bleedingday+14 and

2) bleedingday<=gidrugday<=bleedingday+30.

For instance, the first bleeding date of ID 7000XXXXX should be recognized as Day 15292. 

Can anyone give me some hints to work on or any codes to fix it?

thanks!

DATA CASE ;
INPUT ID $ birthday1 $ gi_bleedingday gastroscopyday gidrugday ;
CARDS;
7000082662380a 196202 . . 15327
7000082662380a 196202 . 18673 .
7000082662380a 196202 . 18674 .
7000082662380a 196202 15068 . .
7000082662380a 196202 15069 . .
7000082662380a 196202 15069 15069 .
7000082662380a 196202 15076 . .
7000082662380a 196202 15110 . .
7000082662380a 196202 15124 . .
7000082662380a 196202 15292 . .
7000082662380a 196202 15299 . .
7000082662380a 196202 15305 . .
7000082662380a 196202 15305 15305 .
7000082662380a 196202 15313 . .
7000082662380a 196202 15313 . 15313
7000082662380a 196202 15347 . .
7000082662380a 196202 16007 . .
7000082662380a 196202 16007 16007 .
;
run;
iksawffej_0-1632314714865.png

 

4 REPLIES 4
maguiremq
SAS Super FREQ

Please post your data in reusable form. The following link contains a macro that will do it for you: https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/

 

Also, please ensure that any identifying information is not posted. If you need to create a pseudo ID, please do so beforehand. Someone recently posted identifying information on another post, so double-check before you post. Thanks.

iksawffej
Fluorite | Level 6
Hi, thanks for your remind, the reusable example has been posted.
PaigeMiller
Diamond | Level 26

I don't understand the desired output, can you explain further and actually show us a small portion of the desired output?

 

Also, we can't write code to work on data in screen captures. Please provide the code according to these instructions https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/ and not as a file attachment or screen capture.

--
Paige Miller
iksawffej
Fluorite | Level 6

Thanks for your remind, the reusable example has been posted.
The final output contains  ID birthday and the correct bleeding date matched the criteria above will be good.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 4 replies
  • 487 views
  • 0 likes
  • 3 in conversation