What does the code Count (distinct usubjid || aedecod). why concatenation operator (II) given in between usubjid and aedecod? what does concatenation operator mean and when do we write in that way.
see part of the code below:
*******
proc sql;
create table table1 as select distinct COHORTN, count (distinct USUBJID || AEDECOD) as num, 2 as cat from adae;
group by COHORTN;
quit;
*******
Thank you!
Why? Ask the person that wrote the code.
Must have wanted to count the number of combinations of those two variables.
If you don't know what "concatenation" means it basically means stick things together.
Example:
data example; thisvar = "Some text"; thatvar = "yet more text"; combined = thisvar||thatvar; put combined=; run;
When? When it does what you want.
probably i got the answer:
"count (distinct USUBJID || AEDECOD)" this counts the distinct number of records for both USUBJID and AEDECOD. If any USUBID has two same AEDECOD (i.e if any subject has two records for Hypotension) it counts One.
Thanks!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.