(Author: Roland Rashleigh-Berry
Date: 08 Aug 2011)
To see a demonstration of the main reporting macros %unistats and %npcttab you will need some datasets as input. This section gives you the code to create two datasets in your sasuser area for use in these demonstrations.
If you are using a laptop for these demonstrations or your PC at home then the following code and all the demonstration code will function using SAS® Learning Edition . You will learn more if you actually submit the code and see the results and SAS Learning Edition is an inexpensive and worthwhile alternative to owning a full copy of SAS® software.
Note that at the start of the code, the library containing the macros is added to the sasautos search path. I did this because it calls the macro %age to calculate age as there is no SAS software function to do this (at least not that I know of). What you have to do is to copy and paste the code in an interactive SAS software session or run it from batch so that it creates two datasets, sasuser.demog and sasuser.adv. These will then be the datasets used to demonstrate the functions of the %unistats and %npcttab macro in later sections. You will have to amend the code so that the macros are in the correct location.
Check your SASUSER library before running this code. If you have
datasets named DEMOG or ADV in your sasuser library that were not created
for Spectre testing then BACK THEM UP before running this code as this
code will overwrite them.
/* Makes sasuser.demog and sasuser.adv datasets for testing */
options fmtsearch=(sasuser); proc format lib=sasuser;
data sasuser.demog;
*- assign a random study treatment arm -;
*- set up the gender-derived treatment arm -;
format dob date9. sexcd sexcd. racecd racecd.
proc print data=sasuser.demog;
data adv;
amsoc="Gastrointestinal disorders";
amsoc="General disorders and administration site conditions";
amsoc="Musculoskeletal and connective tissue disorders";
amsoc="Nervous system disorders";
amsoc="Psychiatric disorders";
amsoc="Respiratory, thoracic and mediastinal disorders";
amsoc="Vascular disorders";
data sasuser.adv;
proc print data=sasuser.adv;
|
Use the "Back" button of your browser to return to the previous page.
SAS and all other SAS Institute Inc. product or service names are registered
trademarks or trademarks of SAS Institute Inc. in the USA and other countries.
® indicates USA registration.