--TESTCD XXALL for NOT DONE records in Findings SDTM dataset

Accepted Solution Solved
Reply
New Contributor
Posts: 4
Accepted Solution

--TESTCD XXALL for NOT DONE records in Findings SDTM dataset

Hi,

 

How to populate --TESTCD for the NOT DONE records in an SDTM dataset. eg.

in VS dataset per subject if there are 5 parameters out of which if one is not done then the TESTCD should be of that parameter and VSSTAT=NOT DONE. However for this visit if all parameters are NOT DONE then the entire panerfor that visit per subject should be collapsed to 1record with VSTESTCD=VSALL. How can this be done using SAS? Please help.

 

Thanks,

 


Accepted Solutions
Solution
‎10-11-2016 11:03 PM
Super User
Super User
Posts: 7,736

Re: --TESTCD XXALL for NOT DONE records in Findings SDTM dataset

Well, if you can code its pretty simple:

data have;
  length usubjid vstestcd vsstatus $20;
  usubjid="001"; vstestcd="PULSE"; vsstatus=""; output;
  usubjid="001"; vstestcd="HEIGHT"; vsstatus=""; output;
  usubjid="002"; vstestcd="PULSE"; vsstatus="NOT DONE"; output;
  usubjid="002"; vstestcd="HEIGHT"; vsstatus="NOT DONE"; output;
run;

proc sql;
  create table WANT as
  select  *
  from    HAVE
  where   USUBJID not in (select distinct USUBJID from (select * from HAVE where VSSTATUS="NOT DONE") group by USUBJID having count(*)=2)
  union all
  select  distinct
          USUBJID,
          "VSALL" as VSTESTCD,
          VSSTATUS
  from    HAVE
  where   USUBJID in (select distinct USUBJID from (select * from HAVE where VSSTATUS="NOT DONE") group by USUBJID having count(*)=2);
quit;

Obviously change it to match your data.

View solution in original post


All Replies
Super User
Posts: 5,391

Re: --TESTCD XXALL for NOT DONE records in Findings SDTM dataset

Sorry, but what are you talking about?
Data never sleeps
Super User
Posts: 19,194

Re: --TESTCD XXALL for NOT DONE records in Findings SDTM dataset

Is this in SAS Clinical?

New Contributor
Posts: 4

Re: --TESTCD XXALL for NOT DONE records in Findings SDTM dataset

Yes in SDTM clinical SAS.

Super User
Posts: 19,194

Re: --TESTCD XXALL for NOT DONE records in Findings SDTM dataset

I've moved your post to the Healthcare forum. That said there aren't a lot of people who use this particular application on here. 

 

I would highly recommend contacting SAS Tech Support. That's what you pay them for after all Smiley Happy

New Contributor
Posts: 4

Re: --TESTCD XXALL for NOT DONE records in Findings SDTM dataset

ok thank you.

Solution
‎10-11-2016 11:03 PM
Super User
Super User
Posts: 7,736

Re: --TESTCD XXALL for NOT DONE records in Findings SDTM dataset

Well, if you can code its pretty simple:

data have;
  length usubjid vstestcd vsstatus $20;
  usubjid="001"; vstestcd="PULSE"; vsstatus=""; output;
  usubjid="001"; vstestcd="HEIGHT"; vsstatus=""; output;
  usubjid="002"; vstestcd="PULSE"; vsstatus="NOT DONE"; output;
  usubjid="002"; vstestcd="HEIGHT"; vsstatus="NOT DONE"; output;
run;

proc sql;
  create table WANT as
  select  *
  from    HAVE
  where   USUBJID not in (select distinct USUBJID from (select * from HAVE where VSSTATUS="NOT DONE") group by USUBJID having count(*)=2)
  union all
  select  distinct
          USUBJID,
          "VSALL" as VSTESTCD,
          VSSTATUS
  from    HAVE
  where   USUBJID in (select distinct USUBJID from (select * from HAVE where VSSTATUS="NOT DONE") group by USUBJID having count(*)=2);
quit;

Obviously change it to match your data.

New Contributor
Posts: 4

Re: --TESTCD XXALL for NOT DONE records in Findings SDTM dataset

Thank you.

☑ This topic is solved.

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

Discussion stats
  • 7 replies
  • 672 views
  • 1 like
  • 4 in conversation