Posts

SAS Display Manager Commands

In my view, Display Manager commands didn’t get much attention of SAS programmers as they should be. It may be because... 1) SAS Documentation has very little information about how to use this facility. 2) Even Google searches aren’t helpful enough. Here is the list of Display Manager Commands I know… dm "log; clear; out; clear;" ; *Clears Output and Log Window; dm " vt work.dsn" ; *Opens the dataset DSN in a View table window; dm "vt &syslast" ; *Opens the dataset recently created; dm 'next viewtable:work.dsn; end; ' ; *Closes the VT window of DSN; dm 'keydef f12 submit' ; *Assigns the submit command to the F12 key ; *Assigns clear log and output commands to F2 Key; dm "keydef F2 'cle log; cle output; submit'" ; *applies detail view to explorer window; dm   "next explorer; detail" ; dm "next log; detail" ; *Opens the Log Window; dm "next output; detail" ; *Open...

Proc SQL for SAS Programmers

Yesterday I came across a website BLINK7. It is a great site to browse and to get help to improve your SAS knowledge in Proc SQL and Base SAS. This website offers a lot of information in the form of sample codes and tutorials on different topics in SAS. SQL for SAS Programmers - Introduction What is SQL? SQL stands for Structured Query Language and was designed for development and maintenance within a Database Management System (DBMS). A DBMS consists of one or more tables of data, typically joined in a hierarchical fashion, and a series of programs for organizing the data. Typical tasks performed with SQL code include the following: Retrieve (or query) data from one or more data tables Manipulate data within existing tables Define new tables and create data within new table Alter existing table definitions Set permissions for different users to access existing tables The first part of this tutorial deals with using the PROC SQL statement to perform basic data extraction. Screenshots ...

Using ODS to Create Customised Output

Using the SAS Output Delivery System (ODS), you can create, customise, and manage HTML output in any operating environment by submitting programming statements. After creating HTML files, you can view them using Internet Explorer, Netscape Navigator, or any Web browser that fully supports HTML 3.2. ODS gives you new formatting options and makes procedure output much more flexible. With ODS, you can easily create HTML, RTF, PCL, PS, XML, Latex and PDF output, an output data set of procedure results and traditional SAS listing output. Also, ODS stores your output in its component parts (data and table definition) so that numerical data retains its full precision. Procedure output is divided into components, or output objects. Depending on the procedure that you run you might have one or several output objects created. For example proc print would create just one output object but proc univariate would produce multiple output objects. ODS stores a link to each output object in the results...

Clinical Trials in INDIA: Overview and Opputunities

SAS Tip_less code: Assigning 1 or 0 to flag variable

*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?

Image
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

Image
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%">