- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 03-02-2023 07:13 AM
(652 views)
DATA HAVE
DATA WANT
In the above images the data that i have is on the left side in a table where only few records are having CRITFl populated for the ID.
The image on the right is what i want to achieve populating the value of critfl across all the records of the ID.
Any Suggestions are grateful.
TIA
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
What happens if the ID has both Y and N? What happens if the ID has neither Y nor N?
Please do not type in ALL CAPITALS.
Please provide example data as SAS data step code, which you can type in yourself or you can get by following these instructions (and not via screen captures or via file attachments). We cannot write code to read screen captures.
--
Paige Miller
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Data have; input ID$ PARAMCD$ RESULT BASERSLT CRITFL$; datelines; 004 ALT 0.03 0.03 004 ALT 0.06 0.03 004 AST 0.03 0.03 004 CHOL 0.03 0.03 004 4HCHOL 0.03 0.03 004 ALT 0.12 0.03 Y 004 LIPA 0.09 0.09 005 ALT 0.03 0.03 005 AST 0.06 0.04 005 CHOL 0.03 0.03 005 4HCHOL 0.03 0.03 005 ALT 0.06 0.03 N 005 LIPA 0.12 0.12 ; Data want; input ID$ PARAMCD$ RESULT BASERSLT CRITFL$; datelines; 004 ALT 0.03 0.03 Y 004 ALT 0.06 0.03 Y 004 AST 0.03 0.03 Y 004 CHOL 0.03 0.03 Y 004 4HCHOL 0.03 0.03 Y 004 ALT 0.12 0.03 Y 004 LIPA 0.09 0.09 Y 005 ALT 0.03 0.03 N 005 AST 0.06 0.04 N 005 CHOL 0.03 0.03 N 005 4HCHOL 0.03 0.03 N 005 ALT 0.06 0.03 N 005 LIPA 0.12 0.12 N;
1.CRITFL for the ID will have either "Y" or "N" and not a combination and hence if at least one record of ID has a "Y" or "N" or even "" i want to see that being retained to all the other records of the ID.
Hope this is a bit helpful and apologies for the attachments.
Thanks