Tag Archives: sas programming

Clinical Programmer Available for Consultancy projects.

Clinical Programmer Available for consultancy projects – Medidata Rave Certified.

Rate: Negotiable

Hours: part time or full time

Contracts: 1099 or Corp-2-corps only.

Advertisements

Count the number of discrepancies per procedure – OracleClinical (OC)

Let’s now write a quick program to count the number of discrepancies per procedure in OC/OCRDC:

Remember to comment /**/ or ***comment here*; what the program does. It is a good clinical practice to document everything so anyone can read your program and make the necessary updates, if necessary.

proc sql;
connect to oracle(path=ocpath);
create table discr as select * from connection to oracle
(Select  p.name, pd.test_order_sn detail, count(pd.test_order_sn) count, p.procedure_id procid
from discrepancy_management dm,
procedures p,
procedure_details pd
where dm.clinical_study_id=9999
and dm.procedure_id = p.procedure_id
and dm.procedure_detail_id=pd.procedure_detail_id
and p.PROCEDURE_VER_SN=pd.PROCEDURE_DETAIL_PROC_VER_SN
and dm.PROCEDURE_VER_SN=p.PROCEDURE_VER_SN
and dm.de_sub_TYPE_CODE=’MULTIVARIATE’
group by p.name, pd.test_order_sn, p.procedure_id
order by count(p.name)desc
);
/*document your code*/
proc sql;
connect to oracle(path=ocpath);
create table name as select * from connection to oracle
(select distinct p.procedure_id procid, p.name, pd.TEST_ORDER_SN detail
from  procedures p,
procedure_details pd
where p.clinical_study_id= 9999 *replace with your studyid;
and p.procedure_status_code !=’R’
and p.procedure_id=pd.procedure_id
order by procid
);
quit;

/* merge # of discrepancies with name */
proc sort data=discr;
by procid;
run;

proc sort data=name;
by procid;
run;

data discname;
merge discr (in=d) name (in=n);
by procid;
if n;
run;

proc sort data=discname ;
by descending count ;
run;

/* print out  */
proc print data=discname label;
var name numdisc percent numdcf;
label numdisc = ‘Number of discrepancies’
numdcf = ‘Number of DCFs’;
title “Number of discrepancies per Procedure”;
title2 “RA eClnica”;
run;

You could also export the report to Excel xls and have your DM / data manager review it.

Good luck and let me know if it was helpful.

To hire me for services, you may contact me via Contact Me OR Join me on LinkedIn

The Only Three (3) [Programming] Languages You Should Learn Right Now (eClinical Speaking)

On a previous article that I wrote in 2012, I mentioned 4 programming languages that you should be learning when it comes to the development of clinical trials. Why is this important, you may ask? Clinical Trials is a method to determine if a new drug or treatment will work on disease or will it be beneficial to patients. Anayansi Gamboa - Clinical Data Management Process If you have never written a line of code in your life, you are in the right place. If you have some programming experience, but interesting in learning clinical programming, this information can be helpful.

But shouldn’t I be Learning ________?

Here are the latest eClinical programming languages you should learn:

1. SAS®: Data analysis and result reporting are two major tasks to SAS® programers. Currently, SAS is offering certifications as a Clinical Trials Programmer. Some of the skills you should learned are:

  • clinical trials process
  • accessing, managing, and transforming clinical trials data
  • statistical procedures and macro programming
  • reporting clinical trials results
  • validating clinical trial data reporting

2. ODM/XML: Operational Data Modeling or ODM uses XML to build the standard data exchange models that are being developed to support the data acquisition, exchange and archiving of operational data.

3. CDISC Language: Yes. This is not just any code. This is the standard language on clinical trials and you should be learning it right now. The future is here now. The EDC code as we know it will eventually go away as more and more vendors try to adapt their systems and technologies to meet rules and regulations. Some of the skills you should learn:

  • Annotation of variables and variable values – SDTM aCRF
  • Define XML – CDISC SDTM datasets
  • ADaM datasets – CDISC ADaM datasets

CDISC has established data standards to speed-up data review and FDA is now suggesting that soon this will become the norm. Pharmaceuticals, bio-technologies companies and many sponsors within clinical research are now better equipped to improve CDISC implementation.

Everyone should learn to code

Therefore, SAS® and XML are now cooperating. XML Engine in SAS® v9.0 is built up so one can import a wide variety of XML documentation. SAS® does what is does best – statistics, and XML does what it does best – creating reportquality tables by taking advantage of the full feature set of the publishing software. This conversation can produce report-quality tables in an automated hands-off/light out process.

Standards are more than just CDISC

If you are looking for your next career in Clinical Data Management, then SAS and CDISC SDTM should land you into the right path of career development and job security.

Conclusion: Learn the basics and advanced SAS clinical programming concepts such as reading and manipulating clinical data. Using the clinical features and basic SAS programming concepts of clinical trials, you will be able to import ADAM, CDISC or other standards for domain structure and contents into the metadata, build clinical domain target table metadata from those standards, create jobs to load clinical domains, validate the structure and content of the clinical domains based on the standards, and to generate CDISC standard define.xml files that describes the domain tables for clinical submissions.

Anayansi Gamboa has an extensive background in clinical data management as well as experience with different EDC systems including Oracle InForm, InForm Architect, Central Designer, CIS, Clintrial, Medidata Rave, Central Coding, OpenClinica – Open Source and Oracle Clinical.

Disclaimer: The legal entity on this blog is registered as Doing Business As (DBA) – Trade Name – Fictitious Name – Assumed Name as “GAMBOA”.

Source:

SAS Institute
CDISC

SAS Proficiency Test

Here are some common SAS questions:

1- What happens if no VAR statement is used in PROC PRINT?

2- Understand how SAS processes a data step

3- Explain what a (data step) SELECT statement does

4- What is the default length of a numeric variable?

5-What is the difference between DO WHILE and DO UNTIL?

6-What does BY after SET A; do?

7-What does BY after SET A B; do?

8-What is a sub-setting IF statement?

If you pass it doesn’t mean you’re good; but if you’re good, you should pass

9- What’s the difference between INFILE and INPUT?

10-What information is given by a Proc Contents?

11-How do you modify the header?

12-Which elements can you change? (in reference to question 10-11)

13-Which elements can you NOT change without re-creating the dataset?(in reference to question 10-11)

14-What is the purpose of the single trailing @ sign?

15-What statements are used to include or exclude specific variables in a data step?

16-How can you generate a 2-dimensional cross-tabulation?

17-In the macro language, all macro commands begin with?

18-What occurs if multiple datasets are included in a SET statement?

19-What symbol is used to concatenate two character values?

20-Explain the substr function

21-What are the differences among these functions? Round(), Ceil(), Floor()

22-What happens if you use the same in= variable for 2 datasets?

23-How do you begin a data step if you do not want to create a SAS dataset?

24-What are the automatic variables first. and last. ?

25-What does a 2 level input dataset name such as MydataSet.Mydata indicate ?

26-What is the default libname, where one-level dataset names go?

27-What statement allows you to keep track of previous values of variables or keep a running total?

28-What happens if you retain the value of a variable in the incoming dataset?

29-When an invalid data field is encountered when inputting a numeric variable, what happens?

30-What’s the difference between $w. and $CHARw. informats?

31-Explain the _type_ variable generated by proc summary

32-What is the purpose of a %GLOBAL statement?

33-What do CALL SYMPUT and CALL SYMGET do?

34-What date is the reference date for calculating the value of a SAS date variable?

35-What is _n_?

There are 10 kinds of people in the world: those who understand binary, and those who don’t.

Those are SAS most common questions you will be asked during a SAS programming job interview or if you plan in taking the SAS based certification.

In future blogs, I will try to cover each of those questions individually with some demonstrations.

Good luck!

Your comments and questions are valued and encouraged.
Anayansi Gamboa has an extensive background in clinical data management as well as experience with different EDC systems including Oracle InForm, InForm Architect, Central Designer, CIS, Clintrial, Medidata Rave, Central Coding, OpenClinica, Open Source and Oracle Clinical.

 

anayansi gamboa

A neat new trick to trim your macro variables in 9.3

SAS macro variables are a great way to store a calculated value, so you can use it later in your code. They are not just limited to the data step — you can also use macro variables in title statements, axis statements, etc.

By default, the macro variable will be padded with blanks (per the width of the format). Here’s a simple example. Notice how the ‘avg’ (62.3) has extra spaces padded on the left in the title and in the label for the reference line:

goptions xpixels=600 ypixels=500 gunit=pct htitle=5 htext=3;

proc sql;
select avg(height) format=comma12.1 into :avg from sashelp.class;
quit; run;

axis1 label=(‘Inches’) reflabel=(c=red “&avg”);
axis2 label=none offset=(3,6);

pattern1 v=solid c=pink;
pattern2 v=solid c=cx67C8FF;

title “The average class height is &avg inches”;
proc gchart data=sashelp.class;
hbar name / type=sum sumvar=height descending
subgroup=sex nostats nolegend coutline=gray
ref=&avg cref=red raxis=axis1 maxis=axis2 noframe;
run;

One way to have sql trim the blanks when creating the macro variable is to use the the ‘separated by’ option, and tell it the values are separated by blanks. This was more intended for the scenario where you’re outputting multiple values into multiple macro variables… but is also a clever way to trim the blanks when creating a single macro variable. See how much nicer the title and reference line label look with the blanks trimmed!

proc sql;
select avg(height) format=comma12.1 into :avg separated by ‘ ‘ from sashelp.class;
quit; run;

And in SAS 9.3, we’ve added an even more elegant solution – the ‘trimmed’ option!

proc sql;
select avg(height) format=comma12.1 into :avg trimmed from sashelp.class;
quit; run;

You can learn lots of ‘tricks’ like this, that will make your graphs look better (and make your life simpler) in the SAS/GRAPH training course!

Source: Robert Ellison – http://blogs.sas.com/content/sastraining/2013/01/17/a-neat-new-trick-to-trim-your-macro-variables-in-9-3/
FAIR USE-“Copyright

Disclaimer Under Section 107 of the Copyright Act 1976, allowance is
made for “fair use” for purposes such as criticism, comment, news
reporting, teaching, scholarship, and research. Fair use is a use
permitted by copyright statute that might otherwise be infringing.
Non-profit, educational or personal use tips the balance in favor of
fair use.”

4 Programming Languages You Should Learn Right Now (eClinical Speaking)

I am a strong believer that learning a new language makes you better at the others, but I am not a “learn to code” advocate since a foreign language (I know 3 languages and currently learning my 4th and I have a “to learn” language including Italian and Arabic, if I ever find some free time) or even music (I love to play drums) are equally beneficial. But if you want to obtain a job in the pharmaceutical industry, here are the list of programming languages you should learn:

  1. C#:

What it is: A general-purpose, compiled, object-oriented programming language developed by Microsoft as part of its .NET initiative.

Why you should learn it: If you are looking to become a Medidata Custom Function programmer or Oracle InForm EDC Developer then you should.

2. Python:

What it is: An interpreted, dynamically object-oriented, open-source programming language that utilizes automatic memory management.

Why you should learn it: If you are like me always looking to learn new technology, love Google platforms and perhaps want to become a Timaeus Trial Builder, you should learn it. It is used on a lot open-source technologies.

Everyone should learn to code

3. PL/SQL or SQL:

What it is: PL/SQL stands for Procedural Language/SQL.

Why you should learn it: If you are like me additive to databases then Oracle should be your choice. If you want to become an Oracle Clinical programmer or Database administrator, you should learn Oracle PL/SQL.

4- SAS

What it is: SAS stands for “Statistical Analysis System” (software). It is the most powerful and comprehensive statistics software available.

Why you should learn it: SAS skills are in high demand nowadays. If you are able to obtain the SAS Certification and a few years of experience in the Pharmaceutical industry, you will be in good shape. If you are new and looking for training there are several options available from SAS Institute to private vendors such as Clinovo to even learning on your own. I most warn you as it will be difficult to obtain a job without experience. Nevertheless, once you are in, it can only get better.

Remember that your job is not just to code but to solve real problems. Your ability to code covers a lot of range of skills: from critical thinking, problem analysis & solving, logic, etc.

So which one are you going to give a try?

Let me know what is your preference. Happy Programming!

The best thing about a boolean is even if you are wrong, you are only off by a bit.(Anonymous)

Anayansi Gamboa has an extensive background in clinical data management as well as experience with different EDC systems including Oracle InForm, InForm Architect, Central Designer, CIS, Clintrial, Medidata Rave, Central Coding, OpenClinica Open Source and Oracle Clinical.

Disclaimer: The legal entity on this blog is registered as Doing Business As (DBA) – Trade Name – Fictitious Name – Assumed Name as “GAMBOA”.

Source:
SAS Institute
Learn PL/SQL

How to Use SAS – Lesson 3 – Importing External Data

This video series is intended to help you learn how to program using SAS for your statistical needs. Lesson 3 introduces the concept of permanent or external data sets and how to import them into SAS. I provide basic methods of importing permanent data sets using the INFILE ;statement and the IMPORT procedure (PROC ;IMPORT) for non-SAS based data files. I also discuss libraries and the LIBNAME ;statement to import SAS data directly using the SET statement. Finally, I show how one can save a SAS data set from the data step using LIBNAMEs in the DATA step.

Helpful Notes:

1. The LIBNAME statement is used to point SAS towards a specific folder on your computer.
2. The INFILE statement “reads” data into SAS if it is of a certain format (usually comma, space, or tab delimited).
3. PROC IMPORT – imports data of any of several different file formats into SAS.
4. The SET statement imports data from a library into SAS at the DATA STEP.
5. The library name in a data step’s data name “writes” data from SAS into your library folder using SAS’s own file format system.

Today’s Code:
data main;
input x y z;
cards;
1 2 3
7 8 9
;
run;

proc contents data=main;
run;

proc print data=main;
run;

/* TEMPLATED CODE: .txt file type, with or without delimiters */
data [appropriate data set name here]; infile ;”[your file location here, including .txt extension]” LRECL=[a logical length of your data to emcompass ;ENTIRE data] DLM=’,’;
input
[variable names here]
;
run;

data infile_main;
infile “C:\My SAS Files\main.txt”;
input x y z;
run;

proc print data=infile_main;
run;

/* TEMPLATED CODE: Microsoft Excel (.xls) file type */
proc import out=[your data set name here]
datafile='[your file location here, including .xls extension]’
dbms=excel replace;
*Optional statements are below; sheet='[specify sheet to obtain]’; getnames=[yes/no – first row = variable names]; mixed=[yes/no – refers to data types, if num AND char varibles, use yes]; usedate=[yes/no – read date formatted data as date formatted SAS data]; scantime=[yes/no – read in time formatted data as long as variable is not date format];
run;

proc import out=imported_excel
datafile=’C:\My SAS Files\main.xls’
dbms=excel replace;
*Optional statements are below; sheet=’Sheet1′; getnames=yes;
run;

proc print data=imported_excel;
run;

libname home “C:\My SAS Files\”;

data sas_format; set home.main;
run;

data home.sas_format; set infile_main;
run;

-FAIR ;USE-
“Copyright Disclaimer Under Section 107 of the Copyright Act 1976, allowance is made for “fair use” for purposes such as criticism, comment, news reporting, teaching, scholarship, and research. Fair use is a use permitted by copyright statute that might otherwise be infringing. Non-profit, educational or personal use tips the balance in favor of fair use.”

Anayansi Gamboa has an extensive background in clinical data management as well as experience with different EDC systems including Oracle InForm, InForm Architect, Central Designer, CIS, Clintrial, Medidata Rave, Central Coding, OpenClinica Open Source and Oracle Clinical.

How to Use SAS – Lesson 1 – The SAS Interface

This video series is intended to help you learn how to program using SAS for your statistical needs. Lesson 1 introduces the SAS window, it’s various environments ;and what each environment does. I also provide some basic code to create a data set, make a new variable & assign it a value, and then run the print procedure (PROC PRINT) to see what the values are of each variable in the specified data set.

Helpful Notes:

Here are the five primary “environments” that SAS uses:

1. RESULTS: where output is shown in tree structure
2. EXPLORER: the interfacing environment between SAS and your computer
3. OUTPUT: the output of your code
4. LOG: the “middle-man” between you and the SAS system
5. EDITOR: where you type your code

Today’s Code:

data main;
x = 1;
y = 2;
run;

proc print data=main;
run;


-FAIR USE-
“Copyright Disclaimer Under Section 107 of the Copyright Act 1976, allowance is made for “fair use” for purposes such as criticism, comment, news reporting, teaching, scholarship, and research. Fair use is a use permitted by copyright statute that might otherwise be infringing. Non-profit, educational or personal use tips the balance in favor of fair use.”

Anayansi Gamboa has an extensive background in clinical data management as well as experience with different EDC systems including Oracle InForm, InForm Architect, Central Designer, CIS, Clintrial, Medidata Rave, Central Coding, OpenClinica Open Source and Oracle Clinical.

SAS Programming Tip: Formatted Input

This material is related to the type of content covered in the following courses:

SAS Programming Introduction: Basic Concepts
https://support.sas.com/edu/schedules.html?ctry=us&id=106

SAS Programming 1: Essentials
https://support.sas.com/edu/schedules.html?ctry=us&id=277

SAS Programming 2: Data Manipulation Techniques course
https://support.sas.com/edu/schedules.html?ctry=us&id=278

For more information about SAS programming, visit: https://support.sas.com/edu/courses.html?ctry=us

-FAIR USE-
“Copyright Disclaimer Under Section 107 of the Copyright Act 1976, allowance is made for “fair use” for purposes such as criticism, comment, news reporting, teaching, scholarship, and research. Fair use is a use permitted by copyright statute that might otherwise be infringing. Non-profit, educational or personal use tips the balance in favor of fair use.”