Posts
SAS Tip_less code: Assigning 1 or 0 to flag variable
- Get link
- X
- Other Apps
*Creating a flag variable when a test variable meets certain criteria is very common for SAS programmer….
Many SAS programmers use the below code to assign a flag of 1 or 0 depending on of the test variable meets criteria or not.;
*Ex:;
*Create a test dataset;
data test;
input id age sex $;
cards ;
1 25 Male
2 35 Female
3 29 Female
4 37 Male
5 32 Male
;
run ;
*Most programmers use the following code to assign avalue of 1 0r 0 to flag variable;
data test1;
set test;
if sex= 'Male' then flag=1;
else flag=0;
run ;
*Some programmers use the following code to do the same task;
data test;
set test;
flag= ifn (sex= 'Male' ,1,0);
run ;
*You can write ....even simpler code than the above 2 dataset step methods.;
data test2;
set test;
flag= 'Male' =sex;
run ;
*Or;
data test3;
set test;
flag=sex= 'Male' ;
run ;
* Note : The above code does the same thing as the 1st and 2nd method;
Cave...
Dummy Dataset or SAS Options: Which is better to insert a Zero Row?
- Get link
- X
- Other Apps

Always, programmers need to summarize the demographics data and show it in a table and to do so they use Proc Freq procedure. Even though proc Freq calculates the Frequency exactly, it may not be the write procedure in all cases especially when data do not exist. Some times statistician wants to see all the data values on the CRF in the final table, even though there is no combination as such exists in the dataset. In this case we have to insert observations with 0 values. Here I will present you ….the different methods to insert a zero row. 1) Creating a Dummy Dataset and Concatenate the dummy dataset with the input dataset. 2) Proc Freq SPARSE option 3) Proc Means COMPLETETYPES Option 4) Proc Means COMPLETETYPES O ption with PRELOADFMT option. Dummy Dataset: Adv: Simple and doesn’t need any formats Caveat : Programmer has to know all the possible combinations Sparse Option: Lists all possible combinations of variable levels even when a combination does not occur. Syntax: p...
A Sampler of What’s New in Base SAS 9.2
- Get link
- X
- Other Apps

Direct Link: . philasug.org/Presentations/200811/SAS92.ppt Direct Link: http://www.sas.com/offices/NA/canada/downloads/presentations/Calgary2008/SAS9.2.pdf Direct Link: http://rtsug.org/ppt/Secosky_nov07.ppt philasug.org/Presentations/200811/SAS92.ppt" style="height: 45em;" width="100%"> http://rtsug.org/ppt/Secosky_nov07.ppt" style="height: 45em;" width="100%">
Case Report Tabulations for The FDA Submission
- Get link
- X
- Other Apps

The Case Report Tabulation (CRT) is the collection of the annotated case report form (CRF), SAS® datasets, metadata, and source programs that comprise a portion of the NDA package submitted to the FDA. The FDA uses it when reviewing submissions. Review starts with the Define document which contains metadata describing the datasets, variables, and values. It is all tied together using internal and external hyperlinks, bookmarks, and destinations to make it easily navigable 1 . The CRT is essentially a collection of data and documentation for a study. It contains features such as bookmarks and links to allow reviewers to easily navigate the submission. For consistency, there are guidelines from FDA1 and CDISC defining the components though the guidelines are limited in scope. We need to create Define Document ( define.pdf or define.xml ) as a part of CRT. Each dataset is a single SAS transport file and, in general, includes a combination of raw and derived data. Each CRF domain (e.g., d...
DLP (Data LifeCycle Plan)
- Get link
- X
- Other Apps
The DLP (Data LifeCycle Plan) guides an organization and serves as a blueprint for how to create every type of data across all therapeutic areas and functional specialties. Howard describes the DLP as "an overall document that says here are the things you need to think about." In some DLPs, there might be more than 15 chapters, each controlled by a group of domain experts. Standard operating procedures (SOPs) typically cover process. DLPs, in contrast, are technical specifications about what happens to the data. Both SOPs and DLPs should be subject to similar governance. The DLP creates a framework for discussions that do occur on their own, but it forces them to an earlier stage of the process. Source: http://www.clinpage.com/article/cdisc_for_skeptics/C9 Here's a sample chapter of a DLP for demographic data from Kestrel Consultants, Inc.