The LINKEDIN SAS Professionals group had a question on How to extract year information from three formats of dates in a dataset? (IMPUTED Dates). There were a number of good suggestions submitted. Here is a summary of the suggestions:
**************************************************************;
*Method1: Using scan or substr with length functions;
data temp;
infile datalines;
input date:$10.;
datalines;
1998
2008
01-1998
01-2008
01-01-1998
01-01-2008
;
run;
data temp;
set temp;
if length(date) = 4 then year = input(substr(date,1,4),best32.);
else if length(date) = 7 then year = input(substr(date,4,4),best32.);
else if length(date) = 10 then year = input(substr(date,7,4),best32.);
run;
*(or);
data temp;
set temp;
if length(date) = 4 then year = input(date,best.);
else if length(date) = 7 then year = input(scan(date,2,'-'),best.);
else if length(date) = 10 then year = input(scan(date,3,'-'),best.);
run;
*************************************************************;
*Method2:Starting with Version 8, the SCAN function has the ability to scan from the end backwards;
data temp;
infile datalines ;
length date $10 ;
input @1 date $char10. ;
year = input(scan(date,-1),best.) ;
datalines ;
1998
2008
01-1998
01-2008
01-01-1998
01-01-2008
;
run;
**************************************************************;
*Method3:another option would be the reverse function*/
/* first reverse the date so that the year is always in the first four characters*/
/* substr off the first four characters and reverse again */ ;
data temp;
infile datalines;
input date:$10.;
year =input(reverse(substr(reverse(compress(date)),1,4)),?? 8.);
datalines;
1998
2008
01-1998
01-2008
01-01-1998
01-01-2008
;
run;
**************************************************************;
*Method4: assumed date not an outputted format value. assumed date var is char ;
data temp;
infile datalines;
input date:$10.;
datalines;
1998
2008
01-1998
01-2008
01-01-1998
01-01-2008
;
run;
data temp;
length year $4;
set temp;
lgth =length(date); /*** possible values 1 (when blank), 4,7,10 ***/
start =lgth-3;
if start <1 then /*** when blank ***/
year =' ';
else year =substr(date,start,4);
drop lgth start;
run;
**************************************************************;
*Method 5: This solution is based on the fact that the last four characters are the year.;
data temp;
infile datalines;
input date:$10.;
year = input(substr(date,length(date)-3,4),4.);
datalines;
1998
2008
01-1998
01-2008
01-01-1998
01-01-2008
;
run;
**************************************************************;
('’)
Thursday, February 4, 2010
Check How easy to find ERROR/WARNING/UNINITIALIZED messages in the LOG window
Today I will tell you how easy it is to find ERROR/WARNING/UNINITIALIZED messages inside the LOG window.
What you need to do is….Create a list of shortcut keys inside your SAS Toolbar for the LOG window. This is quick and also saves time.
You can customize toolbar settings using the Customize tools dialog box.
You can open the Customize tools dialog box by
1) Enter TOOLEDIT (one word) in the command bar or
2) Go to, TOOLS ________ CUSTOMIZE or
3) Right click on the Toolbar and select CUSTOMIZE.
Adding a Tool to the Toolbar
What you need to do is….Create a list of shortcut keys inside your SAS Toolbar for the LOG window. This is quick and also saves time.
You can customize toolbar settings using the Customize tools dialog box.
You can open the Customize tools dialog box by
1) Enter TOOLEDIT (one word) in the command bar or
2) Go to, TOOLS ________ CUSTOMIZE or
3) Right click on the Toolbar and select CUSTOMIZE.
Adding a Tool to the Toolbar
To add a tool to the toolbar, just click the Add tool button to add a blank tool to the toolbar list. Enter a SAS command in the Command box as mentioned below. You can also add icon to the SAS command as I did below.
Adding these7 icons means you can look for ERROR/WARNING/UNINITIALIZED messages and the two arrow signs will help to find the next or previous ERROR/WARNING/UNINITIALIZED messages.
Friday, January 15, 2010
Results and Lessons from the CDISC SDTM/ADaM Pilot Project
Results and Lessons from the CDISC SDTM/ADaM Pilot Project
Get registered free… and listen to 1 hour Audio seminar by…
Cathy Barrows, Ph.D
Chris Holland
Edvard D. Helton, Ph.D
Tanyss Mason
Cathy Barrows, Ph.D
Chris Holland
Edvard D. Helton, Ph.D
Tanyss Mason
Program Content:
The CDISC SDTM/ADaM Pilot Project was conducted as a collaborative pilot project with FDA and Industry. The objective of the pilot project was to test how well the submission of CDISC-adherent datasets and associated metadata met the needs and the expectations of both medical and statistical FDA reviewers. In doing this, the project also assessed the data structure, resources and processes needed to transform data from a data source into the SDTM and ADaM formats, and to create the associated metadata. An additional goal was to produce a worked example implementation of the CDISC standards available at that time, including the Define.xml file.
This webcast will review the experiences, results, and learnings of the pilot project core team regarding the creation of a CDISC-adherent submission. Key aspects of the worked example will be highlighted, as will issues to keep in mind while exploring the example package (e.g., improvements or changes made in standards that are not addressed in the package).
Perspectives on the pilot project will be presented from CDISC and from the FDA, with a live question and answer session at the conclusion of the presentation.
Please note: The comments, statements and opinions attributed to regulatory review team members reflect views of those individuals and are conveyed as informal feedback by the pilot project team in the spirit of effective information sharing, and must not be taken to represent guidance, policy, or evaluation from the Food and Drug Administration.
Learning Objectives:
Gain an understanding of the logistics and processes used in the CDISC SDTM/ADaM pilot project
Hear key points deemed worthy of emphasis: the successes, the snags, and the solutions and work around that went into the successful completion of this pilot
Learn from the pilot project experience what things to consider when planning for your own CDISC submissions
Hear from FDA the positive effects of CDISC data standards on the submission and review process.
Implementing CDISC Submission Data Standards (audio seminar)
Presented By:
Rebecca Kush, Wayne Kubrick, Dan Godoy, Ed Helton
www.cdisc.org
Learning Objectives
Understand the current state of the CDISC SDTM and ADaM submission standards and the new define.xml standard
Gain insight on representative ways to effectively implement the SDTM and ADaM in Sponsor organizations
Understand some of the challenges and common questions that arise when implementing these standards
Learn about the experiences of Astra-Zeneca, a global pharmaceutical company in the process of adopting CDISC standards.
Free webinars on CDISC/SDTM/ADaM:
Thursday, January 14, 2010
Importing Excel/DBF Files to SAS Datasets Using DDE
Importing Excel Files Into SAS Using DDE
DATA TRANSFER TO AND FROM EXCEL WITH DYNAMIC DATA EXCHANGE (DDE)
Importing DBF files to SAS Datasets
What in the world is DDE and why use it? Good question... DDE is “Dynamic Data Exchange” and is a method of accessing data from one MS-Windows application by another. As a SAS user, you can use DDE within a DATA step to import data into SAS and export data from SAS. Using DDE involves SAS code and statements that other MS-Windows applications understand. But, why bother with DDE when other methods are available? What about the IMPORT and EXPORT procedures? Or, Open Database Connectivity (ODBC)? How about SAS Enterprise Guide? These alternatives are useful under the right conditions. For example, the PROC IMPORT and PROC EXPORT are simple to use, but are limited in the way you can define your data and these procedures require you license SAS/ACCESS For PC Formats. Bummer. ODBC is also simple to use, but importing data into SAS using ODBC requires you license SAS/ACCESS For ODBC. Bummer again. And, the new Excel LIBNAME engine? Oh, that also requires you license SAS/ACCESS For PC Formats. Bummer times three. SAS Enterprise Guide is very simple, and does not require you license anything other than BASE SAS. Hmm. Oh yes, SAS Enterprise Guide doesn’t offer quite the flexibility as DDE, because when using DDE you have all the features of the SAS DATA step. Also, using DDE in a SAS DATA step makes it easy to adapt the import process for repeatable uses. A SAS DATA step using DDE only requires BASE SAS running under MS-Windows.
DATA TRANSFER TO AND FROM EXCEL WITH DYNAMIC DATA EXCHANGE (DDE)
Importing DBF files to SAS Datasets
Friday, January 8, 2010
Multiple Graphs on One Page Using SAS/GRAPH® V9
I am not sure what other fellow SAS Programmers think about SAS Graphs, but I think they are easy to generate than tables…. I was amazed by how easy it was to get more than 1-2 graphs in single page.
While surfing on the net, I found a nice SUGI paper which deals with the ways of putting multiple graphs in one single page.
This paper provides 3 different methods (PROC GREPLAY, the Data Step Graphics Interface (DSGI), and ODS LAYOUT) to put multiple figures on a one single page.
Multiple Graphs on One Page Using SAS/GRAPH® V9
While surfing on the net, I found a nice SUGI paper which deals with the ways of putting multiple graphs in one single page.
This paper provides 3 different methods (PROC GREPLAY, the Data Step Graphics Interface (DSGI), and ODS LAYOUT) to put multiple figures on a one single page.
Multiple Graphs on One Page Using SAS/GRAPH® V9
Friday, January 1, 2010
Need to convert SDTM data to ADaM data? Here's How
Need to convert SDTM data to ADaM data? Here's (Clinplus Report)
If you have you been wondering how you can effectively meet the clinical data study standards set out by the Clinical Data Interchange Standards Consortium (CDISC) specifically with regards to the Study Data Tabulation Module (SDTM) and the Analysis Data Model (ADaM) our data conversion and reporting tool may be the solution you are looking for to generate all of your safety tables and listings and provide supporting documentation in a validated, standardized ADaM compliant manner.
A Taste of SDTM in Real Time
Do we need to create ADaM dataset for each SDTM dataset?
By Jack Shostak:
You do not need to create an analysis dataset for every SDTM domain. The SDTM files can be used as-is (and probably with support from ADSL for key analysis variables) for statistical analysis if you can get away with that. The idea with analysis datasets and ADaM is that ADaM datasets are value added. ADaM doesn't want to create busywork for you. The top of page 9 of the draft ADaM 2.1 document touches on this question a bit, but not explicitly.
Thanks to Jack Shostak
ADaM Datasets VS SDTM Datasets:
Introduction
If you have you been wondering how you can effectively meet the clinical data study standards set out by the Clinical Data Interchange Standards Consortium (CDISC) specifically with regards to the Study Data Tabulation Module (SDTM) and the Analysis Data Model (ADaM) our data conversion and reporting tool may be the solution you are looking for to generate all of your safety tables and listings and provide supporting documentation in a validated, standardized ADaM compliant manner.
A Taste of SDTM in Real Time
Do we need to create ADaM dataset for each SDTM dataset?
By Jack Shostak:
You do not need to create an analysis dataset for every SDTM domain. The SDTM files can be used as-is (and probably with support from ADSL for key analysis variables) for statistical analysis if you can get away with that. The idea with analysis datasets and ADaM is that ADaM datasets are value added. ADaM doesn't want to create busywork for you. The top of page 9 of the draft ADaM 2.1 document touches on this question a bit, but not explicitly.
Thanks to Jack Shostak
ADaM Datasets VS SDTM Datasets:
Subscribe to:
Posts (Atom)
Learn how to view SAS dataset labels without opening the dataset directly in a SAS session. Easy methods and examples included!
Quick Tip: See SAS Dataset Labels Without Opening the Data Quick Tip: See SAS Dataset Labels With...
-
1) What do you know about CDISC and its standards? CDISC stands for Clinical Data Interchange Standards Consortium and it is developed ke...
-
Comparing Two Approaches to Removing Formats and Informats in SAS Comparing Two Approaches to Removing Formats...
-
USE OF THE “STUDY DAY” VARIABLES The permissible Study Day variables (--DY, --STDY, and --ENDY) describe the relative day of the observ...