*** ICT total= sum(drugB DrugC DrugE)
*** Total=sum(DrugA DrugB DrugC drugE) (which I know I can do using output option in data setp)
*** (xx.x)percentage = xx/N
***N= Bign count for each coulnm(N=XXX)
Can anyone help me to calculate for ‘ICT Total column’ counts. (5th column)
I need to calculate 5th column count for header which is (N=XXX) and table count which is xx(xx.x).
I am currently doing as follow. But is there any other way to do this instead of doing two proc sql and data set statement.
data dataB;
set dataA;
output;
trtp='Total';
output;
run;
proc sql;
create table bign as
select count(distinct subjid) as nsize, trtp
from dataB
WHERE TRTP NE ''
GROUP BY TRTP;
quit;
proc sql;
create table aa as
select sum(nsize) as nsize, 'ICT' as trtp
from bign
where trtp not in ('Total','DrugA');
quit;
data bign1;
set bign aa;
run;
PROC SORT DATA=BIGN1;BY TRTP;RUN;
Can you please provide sample code for this table.
Provide sample data and your current code for reporting please. You haven't provided data to work with.
@unnati wrote:
Can you please provide sample code for this table.
I have attached one excel file. please help me with code example.
Example 8 in this paper is what you want:
https://support.sas.com/resources/papers/proceedings/pdfs/sgf2008/173-2008.pdf
The code is in this file:
https://support.sas.com/rnd/papers/sgf2008/complex_reports.zip
I cannot download attachments.
@unnati wrote:
I have attached one excel file. please help me with code example.
Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.
@ChrisHemedinger I reckon that this line about MS Office attachments, along with those in @Kurt_Bremser's signature, should be added as part of a list of checkbox prerequisites that must be validated before the Post button is ungrayed, when asking a new question.
@ChrisNZ wrote:
@ChrisHemedinger I reckon that this line about MS Office attachments, along with those in @Kurt_Bremser's signature, should be added as part of a list of checkbox prerequisites that must be validated before the Post button is ungrayed, when asking a new question.
I would like to go one step further: prevent uploading of ms office files at all.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.