BookmarkSubscribeRSS Feed
Akter
Obsidian | Level 7

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!

2 REPLIES 2
ballardw
Super User

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.

Akter
Obsidian | Level 7

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!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1130 views
  • 3 likes
  • 2 in conversation