Help using Base SAS procedures

output for overall claculation

Accepted Solution Solved
Reply
Contributor
Posts: 27
Accepted Solution

output for overall claculation

**** DUPLICATE THE INCOMING DATASET FOR OVERALL COLUMN CALCULATIONS

**** SO NOW TRT HAS VALUES 0 = PLACEBO, 1 = ACTIVE, AND 2 = OVERALL.;

data adsl;                                                                                                                                  ➊

       set adsl;

       output;

       trtpn = 2;

       output;

run;

Can someone explain the trtpn=2; output ; for overall column calculation..I came across this in the Sas for pharama book.

Thanks.


Accepted Solutions
Solution
‎04-21-2015 03:28 PM
Super User
Posts: 19,792

Re: output for overall claculation

Posted in reply to NoorulIyn

Assuming that there is a variable trtpn in the data set this would create a new row for each observation with a different value of trtpn. A quick way of duplicating data or adding records when required. Note the number of records in each dataset.

Here's an example you can run:

data class;

set sashelp.class;

Class=1;

run;

data class_duplicates;

set class;

output;

Class=2;

output;

run;

proc freq data=class_duplicates;

table class;

run;

View solution in original post


All Replies
Valued Guide
Posts: 860

Re: output for overall claculation

Posted in reply to NoorulIyn

this is creating a variable named trtpn with a value of 2.

Solution
‎04-21-2015 03:28 PM
Super User
Posts: 19,792

Re: output for overall claculation

Posted in reply to NoorulIyn

Assuming that there is a variable trtpn in the data set this would create a new row for each observation with a different value of trtpn. A quick way of duplicating data or adding records when required. Note the number of records in each dataset.

Here's an example you can run:

data class;

set sashelp.class;

Class=1;

run;

data class_duplicates;

set class;

output;

Class=2;

output;

run;

proc freq data=class_duplicates;

table class;

run;

🔒 This topic is solved and locked.

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

Discussion stats
  • 2 replies
  • 212 views
  • 1 like
  • 3 in conversation