Posts

Showing posts from August, 2009

MedDRA and WHODrug Coding

Image
Though there are other Coding dictionaries available along with MedDRA (ex: COSTART and WHOART ), MedDRA dictionary is typically used in the US for Adverse Events coding. AE\ MedDRA coding is not the SAS programmers work; it is usually done by medical coder or database programmer. Coding basically involves a process of finding a dictionary term that matches the verbatim term reported on the CRF , and getting the other related dictionary derived variables useful for the analysis like System Organ Class ( SOC ), Preferred Term ( PT ) and Lowest Level Term ( LLT ), etc. Some times this process may take more time than expected, because Misspellings and other differences would delay the process of coding. In that case, person responsible for coding has to look for the dictionary term that which is the best possible match from the MedDRA dictionary. So the question here comes is what SAS programmer can do in this process. Here is the Answer…. SAS programmer has to work hard to make...

Making Code Review Painless

ABSTRACT: Code review is an essential step in the development of concise and accurate SAS® programs. It is a required verification step in performing validation in a regulated environment. This paper will present techniques and a macro that can be freely downloaded to automate this task. The %coderev macro will perform many of the common tasks during a code review including: 1. Spell checking headers and comments 2. Reviewing all input and output datasets of the program 3. Comparing defined macro variables versus macro variable usage 4. Checking for multiple macro calls that are not in a macro library 5. Evaluating hard code logic 6. Evaluating sort order of all datasets These tasks are normally performed by an independent reviewer instead of the original programmer. By automating the tasks, the code review process will ensure that the smallest mistake can be captured through reports to ensure the highest quality and integrity. What normally is a dreaded task can now be done with ease....

SAS Instructor Tips: Programming

Image
SAS Instructor Tip: Programming Featured Instructor: Cynthia Johnson How do I combine my SAS data sets and eliminate duplicate rows at the same time? SAS Instructor Cynthia Johnson responds ... SAS Instructor Tip: Programming Featured Instructor: Kent Reeve What happens when you forget the period on an informat when using formatted input? SAS Programming Tips[1] SAS/GRAPH Tip: Controlling the Graph Axis SAS Instructor Cynthia Zender shows you how to control the graph axis through a feature of using the AXIS statement. SAS ODS Tip: Creating Page X of Y Page Numbers SAS Instructor Cynthia Zender shows you how to use the SAS ODS ESCAPECHAR to create a "Page X of Y Page Numbers" SAS ODS Tip: Creating a Table of Contents SAS Instructor Cynthia Zender shows you how to create a table of contents using the CONTENTS= Option with ODS RTF and ODS PDF destinations. SAS ODS Tip: Controlling the Width of Cells SAS Instructor Cynthia Zender sh...

What's new in SAS V 9.2 for Base SAS

Image
Listen to the SAS lecture series by http://www.sas.com/ to find out whats new in SAS 9.2 version..... SAS Lecture series for SAS 9.2 changes and enhancements for Base SAS has 3 sessions: Session 1: New and enhanced Procedures and Statements Overview of Changes and Enhancements DATA step Changes and Enhancements Base Engine Changes and Enhancements New Base Procedures Base Procedures Changes and Enhancements Session 2: The SAS Macro Facility Session 3: SAS XML LIBNAME Engine and ODS Listen to e-Lecture ---Then Note: e-lecture is on Session 1 only.. SAS Documenatation: What's New in SAS 9.2

Macro IN Operator

Have you ever come across a situation where you have to write a macro program where a macro variable has more than one value? Writing a macro program in this case involves so many different conditions and to connect each condition you generally use OR operator as below… %macro test ; %if &dsn= ae or %if &dsn= ds or %if &dsn= co or %if &dsn= cm %then %do ; Some---SAS—Statements; %end ; %test ; You can use a simple IN operator inside the datastep and make the code very simple… like as follows… data dsn; set old; if &dsn in (" ae" ," ds" ," co" ," cm" ) then do ; Some---SAS—Statements; end ; run ; Can we use the same IN operator inside the macro… If you are using any SAS version prior to 9.2 … the answer is.. You cannot use IN operator inside the macro. But….. In SAS 9.1.3 version: You can use character # (new binary comparison operator) as an alternate operator to mnemonic IN operator. ...

Macro Debugging Options:MPRINT, MLOGIC, SYMBOLGEN, MACROGEN, MFILE

Macro Debugging Options: Debugging a macro code isn’t easy process. It is difficult to identify the problem in the SAS code just by seeing the ERROR message in the LOG file. It is lot easier to debug a macro if we use the following SAS options. There are four system options that are helpful in debugging SAS Macros: SYMBOLGEN, MPRINT, MLOGIC, and MFILE. Each option adds different information to the SAS LOG File. Like any other SYSTEM OPTIONS, you turn these on using the OPTIONS statement: Options macrogen symbolgen mlogic mprint mfile; You can turn them off by specifying the following OPTIONS statement: Options nomacrogen NoSymbolgen nomlogic nomprint nomfile; Both statements are needed in side SAS. Once you set any option and it will remain in effect throught the SAS session. So if you want to debug the macro use first OPTIONs Statemnt else use 2nd one. Let’s look at each option, and the output they produce in more detail… MPRINT: As we know that when we execute...

CALL SYMPUT vs CALL SYMPUTX

Call Symput: Use CALL SYMPUT is you need to assign a data step value to a macro variable. Syntax: Call Symput (“Macro variable”, character value) The first argument to the Symput routine is the name of the macro variable to be assigned to the value from the second argument. The second argument is the character value that will be assigned to the macro variable. The second argument need to be always a character value or if a numeric value is to be used it should convert first into character variable before assigning it to macro variable. It may lead to problems, if you don’t do the conversion from numeric to character. In this case, SAS automatically converts numeric value of the variable to character value before assigning it to macro variable and prints a message in the LOG saying that conversion happened. See the example: data _null_; count= 1978 ; call symput('count',count); run; %put &count; 19 data _null_; 20 count=1978; 21 call symput('count',count); 22 run; ...