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;
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.
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.
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.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.