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!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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