0% found this document useful (0 votes)
2 views29 pages

SAS Notes Master File

The document discusses various SAS programming concepts, including the use of SELECT statements, the OPTIONS statement, and the implications of numeric to character conversions. It also covers debugging techniques, handling missing values, and differences between functions and procedures in SAS. Additionally, it outlines best practices for processing large datasets and the features of different SAS versions.

Uploaded by

ramu146
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views29 pages

SAS Notes Master File

The document discusses various SAS programming concepts, including the use of SELECT statements, the OPTIONS statement, and the implications of numeric to character conversions. It also covers debugging techniques, handling missing values, and differences between functions and procedures in SAS. Additionally, it outlines best practices for processing large datasets and the features of different SAS versions.

Uploaded by

ramu146
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Under what circumstances would you code a SELECT construct instead of IF statements?

A: I think Select statement is used when you are using one condition to compare with several conditions
like…….

Data exam;
Set exam;
select (pass);
when Physics gt 60;
when math gt 100;
when English eq 50;
otherwise fail;
run;

What is the one statement to set the criteria of data that can be coded in any step?
A) Options statement.

What is the effect of the OPTIONS statement ERRORS=1?

A) The –ERROR- variable ha a value of 1 if there is an error in the data for that observation and 0 if it is
not.

What's the difference between VAR A1 - A4 and VAR A1 -- A4?

A) Refer the following link:


[Link]

What do the SAS log messages "numeric values have been converted to character" mean? What are
the implications?

A) It implies that automatic conversion took place to make character functions possible.

Why is a STOP statement needed for the POINT= option on a SET statement?
A) Because POINT= reads only the specified observations, SAS cannot detect an end-of-file condition as
it would if the file were being read sequentially.

How do you control the number of observations and/or variables read or written?

A) FIRSTOBS and OBS option

Approximately what date is represented by the SAS date value of 730?


A) 31st December 1961

Identify statements whose placement in the DATA step is critical.


A) INPUT, DATA and RUN…

Does SAS 'Translate' (compile) or does it 'Interpret'? Explain.


A) Compile

What does the RUN statement do?


A) When SAS editor looks at Run it starts compiling the data or proc step, if you have more than one
data step or proc step or if you have a proc step. Following the data step then you can avoid the usage
of the run statement.

Why is SAS considered self-documenting?


A) SAS is considered self documenting because during the compilation time it creates and stores all the
information about the data set like the time and date of the data set creation later No. of the variables
later labels all that kind of info inside the dataset and you can look at that info using proc contents
procedure.

What are some good SAS programming practices for processing very large data sets?
A) Sort them once, can use firstobs = and obs = ,

What is the different between functions and PROCs that calculate thesame simple descriptive
statistics?
A) Functions can used inside the data step and on the same data set but with proc's you can create a
new data sets to output the results. May be more ...........

If you were told to create many records from one record, show how you would do this using arrays
and with PROC TRANSPOSE?
A) I would use TRANSPOSE if the variables are less use arrays if the var are more ................. depends

What is a method for assigning [Link] and [Link] to the BY groupvariable on unsorted data?
A) In unsorted data you can't use First. or Last.

How do you debug and test your SAS programs?


A) First thing is look into Log for errors or warning or NOTE in some cases or use the debugger in SAS
data step.

What other SAS features do you use for error trapping and datavalidation?
A) Check the Log and for data validation things like Proc Freq, Proc means or some times proc print to
look how the data looks like ........
How would you combine 3 or more tables with different structures?
A) I think sort them with common variables and use merge statement. I am not sure what you mean
different structures.

Other questions:

What areas of SAS are you most interested in?


A) BASE, STAT, GRAPH, ETSBriefly

Describe 5 ways to do a "table lookup" in SAS.


A) Match Merging, Direct Access, Format Tables, Arrays, PROC SQL

What versions of SAS have you used (on which platforms)?


A) SAS 9.1.3,9.0, 8.2 in Windows and UNIX, SAS 7 and 6.12

What are some good SAS programming practices for processing very large data sets?
A) Sampling method using OBS option or subsetting, commenting the Lines, Use Data Null

What are some problems you might encounter in processing missing values? In Data steps?
Arithmetic? Comparisons? Functions? Classifying data?
A) The result of any operation with missing value will result in missing value. Most SAS statistical
procedures exclude observations with any missing variable values from an analysis.

How would you create a data set with 1 observation and 30 variables from a data set with 30
observations and 1 variable?
A) Using PROC TRANSPOSE

What is the different between functions and PROCs that calculate the same simple descriptive
statistics?
A) Proc can be used with wider scope and the results can be sent to a different dataset. Functions
usually affect the existing datasets.

If you were told to create many records from one record, show how you would do this using array and
with PROC TRANSPOSE?

A) Declare array for number of variables in the record and then used Do loop Proc Transpose with VAR
statement

What are _numeric_ and _character_ and what do they do?


A) Will either read or writes all numeric and character variables in dataset.
How would you create multiple observations from a single observation?
A) Using double Trailing @@

For what purpose would you use the RETAIN statement?


A) The retain statement is used to hold the values of variables across iterations of the data step.
Normally, all variables in the data step are set to missing at the start of each iteration of the data
[Link] is the order of evaluation of the comparison operators: + - * / ** ()?A) (), **, *, /, +, -

How could you generate test data with no input data?


A) Using Data Null and put statement

How do you debug and test your SAS programs?


A) Using Obs=0 and systems options to trace the program execution in log.

What can you learn from the SAS log when debugging?
A) It will display the execution of whole program and the logic. It will also display the error with line
number so that you can and edit the program.

What is the purpose of _error_?


A) It has only to values, which are 1 for error and 0 for no error.

How can you put a "trace" in your program?


A) By using ODS TRACE ON

How does SAS handle missing values in: assignment statements, functions, a merge, an update, sort
order, formats, PROCs?
A) Missing values will be assigned as missing in Assignment statement. Sort order treats missing as
second smallest followed by underscore.

How do you test for missing values?


A) Using Subset functions like IF then Else, Where and Select.

How are numeric and character missing values represented internally?


A) Character as Blank or “ and Numeric as.

Which date functions advances a date time or date/time value by a given interval?
A) INTNX.

In the flow of DATA step processing, what is the first action in a typical DATA Step?
A) When you submit a DATA step, SAS processes the DATA step and then creates a new SAS data set.
( creation of input buffer and PDV)
Compilation Phase
Execution Phase

What are SAS/ACCESS and SAS/CONNECT?


A) SAS/Access only process through the databases like Oracle, SQL-server, Ms-Access etc. SAS/Connect
only use Server connection.

What is the one statement to set the criteria of data that can be coded in any step?
A) OPTIONS Statement, Label statement, Keep / Drop statements.

What is the purpose of using the N=PS option?


A) The N=PS option creates a buffer in memory which is large enough to store PAGESIZE (PS) lines and
enables a page to be formatted randomly prior to it being printed.

What are the scrubbing procedures in SAS?


A) Proc Sort with nodupkey option, because it will eliminate the duplicate values.

What are the new features included in the new version of SAS i.e., SAS9.1.3?
A) The main advantage of version 9 is faster execution of applications and centralized access of data and
support.

There are lots of changes has been made in the version 9 when we compared with the version 8. The
following are the few:SAS version 9 supports Formats longer than 8 bytes & is not possible with version
8.
Length for Numeric format allowed in version 9 is 32 where as 8 in version 8.
Length for Character names in version 9 is 31 where as in version 8 is 32.
Length for numeric informat in version 9 is 31, 8 in version 8.
Length for character names is 30, 32 in version 8.3 new informats are available in version 9 to convert
various date, time and datetime forms of data into a SAS date or SAS time.

·ANYDTDTEW. - Converts to a SAS date value ·ANYDTTMEW. - Converts to a SAS time value.
·ANYDTDTMW. -Converts to a SAS datetime [Link] SYMPUTX Macro statement is added in the
version 9 which creates a macro variable at execution time in the data step by ·

Trimming trailing blanks · Automatically converting numeric value to character.


New ODS option (COLUMN OPTION) is included to create a multiple columns in the output.

WHAT DIFFERRENCE DID YOU FIND AMONG VERSION 6 8 AND 9 OF SAS.


The SAS 9
A) Architecture is fundamentally different from any prior version of SAS. In the SAS 9 architecture, SAS
relies on a new component, the Metadata Server, to provide an information layer between the
programs and the data they access. Metadata, such as security permissions for SAS libraries and where
the various SAS servers are running, are maintained in a common repository.
What has been your most common programming mistake?
A) Missing semicolon and not checking log after submitting program,
Not using debugging techniques and not using Fsview option vigorously.

Name several ways to achieve efficiency in your program.


Efficiency and performance strategies can be classified into 5 different areas.
·CPU time
·Data Storage
· Elapsed time
· Input/Output
· Memory CPU Time and Elapsed Time- Base line measurements

Few Examples for efficiency violations:


Retaining unwanted datasets Not sub setting early to eliminate unwanted records.
Efficiency improving techniques:
A)
Using KEEP and DROP statements to retain necessary variables. Use macros for reducing the code.
Using IF-THEN/ELSE statements to process data programming.
Use SQL procedure to reduce number of programming steps.
Using of length statements to reduce the variable size for reducing the Data storage.
Use of Data _NULL_ steps for processing null data sets for Data storage.

What other SAS products have you used and consider yourself proficient in using?
B) A) Data _NULL_ statement, Proc Means, Proc Report, Proc tabulate, Proc freq and Proc print, Proc
Univariate etc.

What is the significance of the 'OF' in X=SUM (OF a1-a4, a6, a9);
A) If don’t use the OF function it might not be interpreted as we expect. For example the function above
calculates the sum of a1 minus a4 plus a6 and a9 and not the whole sum of a1 to a4 & a6 and a9. It is
true for mean option also.

What do the PUT and INPUT functions do?


A) INPUT function converts character data values to numeric values.
PUT function converts numeric values to character [Link]: for INPUT: INPUT (source, informat)
For PUT: PUT (source, format)
Note that INPUT function requires INFORMAT and PUT function requires FORMAT.
If we omit the INPUT or the PUT function during the data conversion, SAS will detect the mismatched
variables and will try an automatic character-to-numeric or numeric-to-character conversion. But
sometimes this doesn’t work because $ sign prevents such conversion. Therefore it is always advisable
to include INPUT and PUT functions in your programs when conversions occur.
Introduction to SAS Informats and Formats

Which date function advances a date, time or datetime value by a given interval?
INTNX:
INTNX function advances a date, time, or datetime value by a given interval, and returns a date, time, or
datetime value. Ex: INTNX(interval,start-from,number-of-increments,alignment)

INTCK: INTCK(interval,start-of-period,end-of-period) is an interval functioncounts the number of


intervals between two give SAS dates, Time and/or datetime.

DATETIME () returns the current date and time of day.

DATDIF (sdate,edate,basis): returns the number of days between two dates.

What do the MOD and INT function do? What do the PAD and DIM functions do? MOD:
A) Modulo is a constant or numeric variable, the function returns the reminder after numeric value
divided by modulo.

INT: It returns the integer portion of a numeric value truncating the decimal portion.

PAD: it pads each record with blanks so that all data lines have the same length. It is used in the INFILE
statement. It is useful only when missing data occurs at the end of the record.

CATX: concatenate character strings, removes leading and trailing blanks and inserts separators.

SCAN: it returns a specified word from a character value. Scan function assigns a length of 200 to each
target variable.

SUBSTR: extracts a sub string and replaces character [Link] of a substring:


Middleinitial=substr(middlename,1,1); Replacing character values: substr (phone,1,3)=’433’; If SUBSTR
function is on the left side of a statement, the function replaces the contents of the character variable.

TRIM: trims the trailing blanks from the character values.

SCAN vs. SUBSTR: SCAN extracts words within a value that is marked by delimiters. SUBSTR extracts a
portion of the value by stating the specific location. It is best used when we know the exact position of
the sub string to extract from a character value.

How might you use MOD and INT on numeric to mimic SUBSTR on character Strings?
A) The first argument to the MOD function is a numeric, the second is a non-zero numeric; the result is
the remainder when the integer quotient of argument-1 is divided by argument-2. The INT function
takes only one argument and returns the integer portion of an argument, truncating the decimal
portion. Note that the argument can be an expression.

DATA NEW ;
A = 123456 ;
X = INT( A/1000 ) ;
Y = MOD( A, 1000 ) ;
Z = MOD( INT( A/100 ), 100 ) ;
PUT A= X= Y= Z= ;
RUN ;

Result:

A=123456
X=123
Y=456
Z=34

In ARRAY processing, what does the DIM function do?


A) DIM: It is used to return the number of elements in the array. When we use Dim function we would
have to re –specify the stop value of an iterative DO statement if u change the dimension of the array.

How would you determine the number of missing or nonmissing values in computations?
A) To determine the number of missing values that are excluded in a computation, use the NMISS
function.

data _null_;
m = . ;
y = 4 ;
z = 0 ;
N = N(m , y, z);
NMISS = NMISS (m , y, z);
run;

The above program results in N = 2 (Number of non missing values) and NMISS = 1 (number of missing
values).

Do you need to know if there are any missing values?


A) Just use: missing_values=MISSING(field1,field2,field3);
This function simply returns 0 if there aren't any or 1 if there are missing [Link] you need to know how
many missing values you have then use num_missing=NMISS(field1,field2,field3);
You can also find the number of non-missing values with non_missing=N (field1,field2,field3);

What is the difference between: x=a+b+c+d; and x=SUM (of a, b, c ,d);?


A) Is anyone wondering why you wouldn’t just use total=field1+field2+field3;

First, how do you want missing values handled?


The SUM function returns the sum of non-missing values. If you choose addition, you will get a missing
value for the result if any of the fields are missing. Which one is appropriate depends upon your
[Link], there is an advantage to use the SUM function even if you want the results to be
missing. If you have more than a couple fields, you can often use shortcuts in writing the field names If
your fields are not numbered sequentially but are stored in the program data vector together then you
can use: total=SUM(of fielda--zfield); Just make sure you remember the “of” and the double dashes or
your code will run but you won’t get your intended results. Mean is another function where the function
will calculate differently than the writing out the formula if you have missing [Link] is a field
containing a date. It needs to be displayed in the format "ddmonyy" if it's before 1975, "dd mon ccyy" if
it's after 1985, and as 'Disco Years' if it's between 1975 and 1985.

How would you accomplish this in data step code?


Using only PROC FORMAT.

data new ;
input date ddmmyy10.;
cards;
01/05/1955
01/09/1970
01/12/1975
19/10/1979
25/10/1982
10/10/1988
27/12/1991
;
run;

proc format ;
value dat low-'01jan1975'd=ddmmyy10.'01jan1975'd-'01JAN1985'd="Disco Years"'
01JAN1985'd-high=date9.;
run;

proc print;
format date dat. ;
run;
In the following DATA step, what is needed for 'fraction' to print to the log?
data _null_;
x=1/3;
if x=.3333 then put 'fraction';
run;

What is the difference between calculating the 'mean' using the mean function and PROC MEANS?
A) By default Proc Means calculate the summary statistics like N, Mean, Std deviation, Minimum and
maximum, Where as Mean function compute only the mean values.

What are some differences between PROC SUMMARY and PROC MEANS?
Proc means by default give you the output in the output window and you can stop this by the option
NOPRINT and can take the output in the separate file by the statement OUTPUTOUT= , But, proc
summary doesn't give the default output, we have to explicitly give the output statement and then print
the data by giving PRINT option to see the result.

What is a problem with merging two data sets that have variables with the same name but different
data?
A) Understanding the basic algorithm of MERGE will help you understand how the stepProcesses. There
are still a few common scenarios whose results sometimes catch users off guard. Here are a few of the
most frequent 'gotchas':

1- BY variables has different lengthsIt is possible to perform a MERGE when the lengths of the BY
variables are different,But if the data set with the shorter version is listed first on the MERGE statement,
theShorter length will be used for the length of the BY variable during the merge. Due to this shorter
length, truncation occurs and unintended combinations could [Link] Version 8, a warning is issued to
point out this data integrity risk. The warning will be issued regardless of which data set is listed
first:WARNING: Multiple lengths were specified for the BY variable name by input data [Link] may
cause unexpected results. Truncation can be avoided by naming the data set with the longest length for
the BY variable first on the MERGE statement, but the warning message is still issued. To prevent the
warning, ensure the BY variables have the same length prior to combining them in the MERGE step with
PROC CONTENTS. You can change the variable length with either a LENGTH statement in the merge
DATA step prior to the MERGE statement, or by recreating the data sets to have identical lengths for the
BY [Link]: When doing MERGE we should not have MERGE and IF-THEN statement in one data
step if the IF-THEN statement involves two variables that come from two different merging data sets. If
it is not completely clear when MERGE and IF-THEN can be used in one data step and when it should not
be, then it is best to simply always separate them in different data step. By following the above
recommendation, it will ensure an error-free merge result.

Which data set is the controlling data set in the MERGE statement?
A) Dataset having the less number of observations control the data set in the merge statement.
How do the IN= variables improve the capability of a MERGE?
A) The IN=variablesWhat if you want to keep in the output data set of a merge only the matches (only
those observations to which both input data sets contribute)? SAS will set up for you special temporary
variables, called the "IN=" variables, so that you can do this and more. Here's what you have to do:
signal to SAS on the MERGE statement that you need the IN= variables for the input data set(s) use the
IN= variables in the data step appropriately, So to keep only the matches in the match-merge above, ask
for the IN= variables and use them:data three;merge one(in=x) two(in=y); /* x & y are your choices of
names */by id; /* for the IN= variables for data */if x=1 and y=1; /* sets one and two respectively */run;

What techniques and/or PROCs do you use for tables?


A) Proc Freq, Proc univariate, Proc Tabulate & Proc Report.

Do you prefer PROC REPORT or PROC TABULATE? Why?


A) I prefer to use Proc report until I have to create cross tabulation tables, because, It gives me so many
options to modify the look up of my table, (ex: Width option, by this we can change the width of each
column in the table) Where as Proc tabulate unable to produce some of the things in my table. Ex:
tabulate doesn’t produce n (%) in the desirable format.

How experienced are you with customized reporting and use of DATA _NULL_ features?
A) I have very good experience in creating customized reports as well as with Data _NULL_ step. It’s a
Data step that generates a report without creating the dataset there by development time can be saved.
The other advantages of Data NULL is when we submit, if there is any compilation error is there in the
statement which can be detected and written to the log there by error can be detected by checking the
log after submitting it. It is also used to create the macro variables in the data set.

What is the difference between nodup and nodupkey options?


A) NODUP compares all the variables in our dataset while NODUPKEY compares just the BY variables.

What is the difference between compiler and interpreter?


Give any one example (software product) that act as an interpreter?
A) Both are similar as they achieve similar purposes, but inherently different as to how they achieve that
purpose. The interpreter translates instructions one at a time, and then executes those instructions
immediately. Compiled code takes programs (source) written in SAS programming language, and then
ultimately translates it into object code or machine language. Compiled code does the work much more
efficiently, because it produces a complete machine language program, which can then be executed.

Code the table’s statement for a single level frequency?


A) Proc freq data=[Link];
table var;*here you can mention single variable of multiple variables seperated by space to get single
frequency;
run;
What is the main difference between rename and label?
A) 1. Label is global and rename is local i.e., label statement can be used either in proc or data step
where as rename should be used only in data step. 2. If we rename a variable, old name will be lost but
if we label a variable its short name (old name) exists along with its descriptive name.

What is Enterprise Guide? What is the use of it?


A) It is an approach to import text files with SAS (It comes free with Base SAS version 9.0)

What other SAS features do you use for error trapping and data validation?
What are the validation tools in SAS?
A) For dataset: Data set name/debugData set: name/stmtchk
For macros: Options:mprint mlogic symbolgen.

How can you put a "trace" in your program?


A) ODS Trace ON, ODS Trace OFF the trace records.

How would you code a merge that will keep only the observations that have matches from both data
sets?

Using "IN" variable option. Look at the following example.

data three;
merge one(in=x) two(in=y);
by id;
if x=1 and y=1;
run;

*or;

data three;
merge one(in=x) two(in=y);
by id;
if x and y;
run;

What are input dataset and output dataset options?


A) Input data set options are obs, firstobs, where, in output data set options compress, [Link]
input and output dataset options include keep, drop, rename, obs, first obs.
How can u create zero observation dataset?
A) Creating a data set by using the like [Link]: proc sql;create table [Link] like
[Link];quit;In this the like clause triggers the existing table structure to be copied to the new
table. using this method result in the creation of an empty table.

Have you ever-linked SAS code, If so, describe the link and any required statements used to either
process the code or the step itself?

A) In the editor window we write%include 'path of the sas file';run;if it is with non-windowing
environment no need to give run statement.

How can u import .CSV file in to SAS? tell Syntax?


A) To create CSV file, we have to open notepad, then, declare the variables.

proc import datafile='E:\[Link]'


out=sarath dbms=csv replace;
getnames=yes;
run;

What is the use of Proc SQl?


A) PROC SQL is a powerful tool in SAS, which combines the functionality of data and proc steps. PROC
SQL can sort, summarize, subset, join (merge), and concatenate datasets, create new variables, and
print the results or create a new dataset all in one step! PROC SQL uses fewer resources when
compard to that of data and proc steps. To join files in PROC SQL it does not require to sort the data
prior to merging, which is must, is data merge.

What is SAS GRAPH?


A) SAS/GRAPH software creates and delivers accurate, high-impact visuals that enable decision
makers to gain a quick understanding of critical business issues.

Why is a STOP statement needed for the point=option on a SET statement?


A) When you use the POINT= option, you must include a STOP statement to stop DATA step
processing, programming logic that checks for an invalid value of the POINT= variable, or Both.
Because POINT= reads only those observations that are specified in the DO statement, SAScannot
read an end-of-file indicator as it would if the file were being read sequentially. Because reading an
end-of-file indicator ends a DATA step automatically, failure to substitute another means of ending
the DATA step when you use POINT= can cause the DATA step to go into a continuous loop.
Behavioral Interview questions:

[Link] me about yourself?

sample answer:
I have been working in the Pharmaceutical industry for the past 4.5 years.
My most recent experience has been with CRO, where I’ve worked for the last 2 years.
I enjoy my job because it’s challenging and I like interacting with a variety of people.
In my most recent assignment I was on a project called “Trial of everolimus in combination with
Erlotinib in patients with metastatic cancer”.
I made a significant contribution to the project because of my expertise in SAS Programming.
One of my strengths is my attention to detail.
I am known for being extremely thorough and meeting or exceeding deadlines and goals.
My boss knows that I work well under minimal supervision, that I am very conscientious and
that the job will be done right the first time.
I’m looking for a new opportunity where I can contribute to the growth of the company by
helping educate customers on the benefits of using our consulting services.

sample answer 2:

I have been working in the pharmaceutical industry as a SAS professional for more than 5 years.

I have used Base SAS, SAS Macros and Proc SQL to analyze datasets and then generated
Tables, Listings, and Graph’s.

I have generated reports using ODS into formats such as RTF, PDF, and HTML.

I have worked with senior Bio-statisticians and clinical data managers to provide SAS
programming in analyzing the clinical trial data according to the SAP.

I have developed programs in SAS for converting the Oracle Data into SAS datasets using SQL
Pass through facility and Libname facility.

I have also used SAS macros for frequently used programs and developed programs for
generating efficacy and safety tables.

I also involved in validation of my fellow programmer code.I have developed Edit check
programs to clean invalid data from the database.

I worked in both WINDOWS and UNIX environments.

I have worked on Case Report Tabulation section of NDA submission as well.

I was also involved in creating annotated case report form (eCRF) using CDISC-SDTM
mapping.
I was involved in creating CRT’s for an NDA electronic submission to the FDA.

I also got Involved in mapping, pooling and analysis of clinical study data for safety and
validating and QC of the efficacy and safety tables.

Sample Answer 3: My answer....

I've been a SAS programmer for 6 years. I'm especially skilled with CDISC guidelines including
SDTM and ADaM.

My recent experience is with XXX company , a CRO in state where I worked as Statistical
Programmer on a number of projects in a variety of drug and medical device areas.
I made a significant contribution to the project recently I have worked on because of my
expertise in SAS Programming and CDISC skills.

I work well even under minimal supervision also I am a team player.

I had an excellent experience in Base SAS/SAS Graph/Proc SQL including the SAS MACRO
language.

I also have great deal of experience in creating CRT’s as a part of electronic submission of NDA
application to the FDA.

Now I’m looking for a new opportunity where I can contribute to the growth of the company and
have a positive impact on the programming team.

[Link] you bring your resume?


Yes.
Be prepared with two or three extra copies. Do not offer them unless you’re asked for one.

[Link] is your long-range objective?

The key is to focus on your achievable objectives and what you are doing to reach those
objectives.

For example: “Within five years, I would like to become one of the best SAS Programmer in the
Pharmaceutical Industry.

I want to work toward becoming the expert that others rely upon. And in doing so, I feel I’ll be
fully prepared to take on any greater responsibilities which might be presented in the long
[Link] example, here is what I’m presently doing to prepare myself . . .

”Then go on to show by your examples what you are doing to reach your goals and objectives.
[Link] you a team player?

Teamwork is the [Link] everyone says yes to this question. But it is not just a yes/no
question. You need to provide behavioral examples to back up your answer.

A sample answer:

“Yes, I’m very much a team player. In fact, I’ve had opportunities in my work, school and
athletics to develop my skills as a team player. For example, on a recent project . . .”Emphasize
teamwork behavioral examples and focus on your openness to diversity of backgrounds. Talk
about the strength of the team above the individual. And note that this question may be used as a
lead in to questions around how you handle conflict within a team, so be prepared You are, of
course, a team player.

Be sure to have examples ready. Specifics that show you often perform for the good of the team
rather than for yourself are good evidence of your team attitude. Do not brag, just say it in a
matter-of-fact tone. This is a key point.

[Link] is your greatest weakness?

Most career books tell you to select strength and present it as a weakness. Such as: “I work too
much. I just work and work and work.” Wrong.

First of all, using strength and presenting it as a weakness is deceiving.


Second, it misses the point of the [Link] should select a weakness that you have been
actively working to overcome.

For example: “I have had trouble in the past with planning and prioritization. However, I’m now
taking steps to correct this. I just started using a pocket planner . . .” then show them your
planner and how you are using [Link] about a true weakness and show what you are doing to
overcome it.

I would say my greatest weakness has been my lack of proper planning in the past. I would over
commit myself with too many variant tasks, then not be able to fully accomplish each, as I would
like. However, since I've come to recognize that weakness, I've taken steps to correct it. For
example, I now carry a planning calendar in my pocket so that I can plan all of my appointments
and "to do" items. Here, let me show you how I have this week planned out...

courtesy: [Link]

Tell me about yourself?

Start with the present and tell why you are well qualified for the position. Remember that the
key to all successful interviewing is to match your qualifications to what the interviewer is
looking for. In other words you must sell what the buyer is buying. This is the single most
important strategy in job hunting.

So, before you answer this or any question it's imperative that you try to uncover your
interviewer's greatest need, want, problem or goal.

To do so, make you take these two steps:

Do all the homework you can before the hr interview to uncover this person's wants and needs
(not the generalized needs of the industry or company)

As early as you can in the interview, ask for a more complete description of what the position
entails. You might say: “I have a number of accomplishments I'd like to tell you about, but I
want to make the best use of our time together and talk directly to your needs. To help me do,
that, could you tell me more about the most important priorities of this position? All I know is
what I (heard from the recruiter, read in the classified ad, etc .

Then, ALWAYS follow-up with a second and possibly, third question, to draw out his needs
even more. Surprisingly, it's usually this second or third question that unearths what the
interviewer is most looking for.

You might ask simply, "And in addition to that?..." or, "Is there anything else you see as essential
to success in this position?:

This process will not feel easy or natural at first, because it is easier simply to answer questions,
but only if you uncover the employer's wants and needs will your answers make the most sense.
Practice asking these key questions before giving your answers, the process will feel more
natural and you will be light years ahead of the other job candidates you're competing with.

After uncovering what the employer is looking for, describe why the needs of this job bear
striking parallels to tasks you've succeeded at before. Be sure to illustrate with specific examples
of your responsibilities and especially your achievements, all of which are geared to present
yourself as a perfect match for the needs he has just described.

What are your greatest strengths?

You know that your key strategy is to first uncover your interviewer's greatest wants and needs
before you answer questions.

And from Question 1, you know how to do this.

Prior to any interview, you should have a list mentally prepared of your greatest strengths. You
should also have, a specific example or two, which illustrates each strength, an example chosen
from your most recent and most impressive achievements.

You should, have this list of your greatest strengths and corresponding examples from your
achievements so well committed to memory that you can recite them cold after being shaken
awake at 2:30AM.

Then, once you uncover your interviewer's greatest wants and needs, you can choose those
achievements from your list that best match up.

As a general guideline, the 10 most desirable traits that all employers love to see in their
employees are:

A proven track record as an achiever...especially if your achievements match up with the


employer's greatest wants and needs.

Intelligence...management "savvy".
Honesty...integrity...a decent human being.
Good fit with corporate culture...someone to feel comfortable with...a team player who meshes
well with interviewer's team.
Likeability...positive attitude...sense of humor.
Good communication skills.
Dedication...willingness to walk the extra mile to achieve excellence.
Definiteness of purpose...clear goals.
Enthusiasm...high level of motivation.
Confident...healthy... a leader.

What are your greatest weaknesses?

Disguise strength as a weakness.

Example: “I sometimes push my people too hard. I like to work with a sense of urgency and
everyone is not always on the same wavelength.”

Drawback: This strategy is better than admitting a flaw, but it's so widely used, it is transparent
to any experienced interviewer.

BEST ANSWER: (and another reason it's so important to get a thorough description of your
interviewer's needs before you answer questions): Assure the interviewer that you can think of
nothing that would stand in the way of your performing in this position with excellence. Then,
quickly review you strongest qualifications.

Example: “Nobody's perfect, but based on what you've told me about this position, I believe I' d
make an outstanding match. I know that when I hire people, I look for two things most of all. Do
they have the qualifications to do the job well, and the motivation to do it well? Everything in
my background shows I have both the qualifications and a strong desire to achieve excellence in
whatever I take on. So I can say in all honesty that I see nothing that would cause you even a
small concern about my ability or my strong desire to perform this job with excellence.”
Alternate strategy (if you don't yet know enough about the position to talk about such a perfect
fit):

Instead of confessing a weakness, describe what you like most and like least, making sure that
what you like most matches up with the most important qualification for success in the position,
and what you like least is not essential.

Why are you leaving (or did you leave) this position ?

(If you have a job presently tell the hr)


If you’re not yet 100% committed to leaving your present post, don’t be afraid to say so. Since
you have a job, you are in a stronger position than someone who does not. But don’t be coy
either. State honestly what you’d be hoping to find in a new spot. Of course, as stated often
before, you answer will all the stronger if you have already uncovered what this position is all
about and you match your desires to it.

(If you do not presently have a job tell the hr.)


Never lie about having been fired. It’s unethical – and too easily checked. But do try to deflect
the reason from you personally. If your firing was the result of a takeover, merger, division wide
layoff, etc., so much the better.

But you should also do something totally unnatural that will demonstrate consummate
professionalism. Even if it hurts , describe your own firing – candidly, succinctly and without a
trace of bitterness – from the company’s point-of-view, indicating that you could understand
why it happened and you might have made the same decision yourself.

Your stature will rise immensely and, most important of all, you will show you are healed from
the wounds inflicted by the firing. You will enhance your image as first-class management
material and stand head and shoulders above the legions of firing victims who, at the slightest
provocation, zip open their shirts to expose their battle scars and decry the unfairness of it all.

For all prior positions:


Make sure you’ve prepared a brief reason for leaving. Best reasons: more money, opportunity,
responsibility or growth.

Why should I hire you?


By now you can see how critical it is to apply the overall strategy of uncovering the employer’s
needs before you answer questions. If you know the employer’s greatest needs and desires, this
question will give you a big leg up over other candidates because you will give him better
reasons for hiring you than anyone else is likely to…reasons tied directly to his needs.
Whether your interviewer asks you this question explicitly or not, this is the most important
question of your interview because he must answer this question favorably in is own mind
before you will be hired. So help him out! Walk through each of the position’s requirements as
you understand them, and follow each with a reason why you meet that requirement so well.
Example: “As I understand your needs, you are first and foremost looking for someone who can
manage the sales and marketing of your book publishing division. As you’ve said you need
someone with a strong background in trade book sales. This is where I’ve spent almost all of my
career, so I’ve chalked up 18 years of experience exactly in this area. I believe that I know the
right contacts, methods, principles, and successful management techniques as well as any
person can in our industry.”

“You also need someone who can expand your book distribution channels. In my prior post, my
innovative promotional ideas doubled, then tripled, the number of outlets selling our books. I’m
confident I can do the same for you.”

“You need someone to give a new shot in the arm to your mail order sales, someone who knows
how to sell in space and direct mail media. Here, too, I believe I have exactly the experience you
need. In the last five years, I’ve increased our mail order book sales from $600,000 to
$2,800,000, and now we’re the country’s second leading marketer of scientific and medical
books by mail.” Etc., etc., etc.,

Every one of these selling “couplets” (his need matched by your qualifications) is a touchdown
that runs up your score. IT is your best opportunity to outsell your competition.

Aren’t you overqualified for this position?


As with any objection, don’t view this as a sign of imminent defeat. It’s an invitation to teach the
interviewer a new way to think about this situation, seeing advantages instead of drawbacks.

Example: “I recognize the job market for what it is – a marketplace. Like any marketplace, it’s
subject to the laws of supply and demand. So ‘overqualified’ can be a relative term, depending
on how tight the job market is. And right now, it’s very tight. I understand and accept that.”

“I also believe that there could be very positive benefits for both of us in this match.”
“Because of my unusually strong experience in ________________ , I could start to contribute
right away, perhaps much faster than someone who’d have to be brought along more slowly.”

“There’s also the value of all the training and years of experience that other companies have
invested tens of thousands of dollars to give me. You’d be getting all the value of that without
having to pay an extra dime for it. With someone who has yet to acquire that experience, he’d
have to gain it on your nickel.”

“I could also help you in many things they don’t teach at the Harvard Business School. For
example…(how to hire, train, motivate, etc.) When it comes to knowing how to work well with
people and getting the most out of them, there’s just no substitute for what you learn over
many years of front-line experience. You company would gain all this, too.”

“From my side, there are strong benefits, as well. Right now, I am unemployed. I want to work,
very much, and the position you have here is exactly what I love to do and am best at. I’ll be
happy doing this work and that’s what matters most to me, a lot more that money or title.”

“Most important, I’m looking to make a long term commitment in my career now. I’ve had
enough of job-hunting and want a permanent spot at this point in my career. I also know that if I
perform this job with excellence, other opportunities cannot help but open up for me right here.
In time, I’ll find many other ways to help this company and in so doing, help myself. I really am
looking to make a long-term commitment.”

NOTE: The main concern behind the “overqualified” question is that you will leave your new
employer as soon as something better comes your way. Anything you can say to demonstrate
the sincerity of your commitment to the employer and reassure him that you’re looking to stay
for the long-term will help you overcome this objection.

SAS Tips for data handling

Most of the examples, particularly the ones about the analysis are for users who has some
experience with SAS, but as well as familiar with statistics and quantitative genetics. If you are a
beginner for SAS, I recommend you to start with some other publications. 'The Little SAS Book,
a primer' by Lora D. Delwiche and Susan J. Slaughter is an excellent book for the SAS
beginners.

Data Modification Tips

There are many data tips in SAS. Here, I put some of them that
I frequently use.

1. Importing external data files (Excel, Access and delimited). See PROC IMPORT for details.

Importing an excel file


Proc import datafile='d:\myfiles\Excel [Link]'
out=mydata replace ;
sheet='sheet1';
run;

Importing Access table


proc import table="test1"
out=mydata dbms=access;
database="c:\myfiles\[Link]";
run;

Importing an external delimited file


Region,State,Month,Expenses,Revenue
Southern,GA,JAN97,2000,8000
Southern,GA,FEB97,1200,6000
Northern,NY,MAR97,6000,5000

proc import datafile="\myfiles\mydata"


out=mydata dbms=dlm replace;
delimiter=',';
getnames=yes;
run;

2. Converting a numeric variable to a character or vice versa

Var_cha=put(test, $2.); * to convert to character;


Var_num=input(test,4.1); * to convert to numeric;

3. Creating a new variable by compressing several variables

test family rep female male tree


1 A 1 F43 M28 1
1 B 1 F22 M02 2
1 B 2 F22 M02 4

data a ; set a;
ID=compress(test||family||rep||tree); *Combine factors using ||,
remove any trailing blank using COMPRESS;

CROSSno=trim(female||male); *Combine FEMALE and MALE variables


with ||, remove any trialing blank using TRIM;
CROSSblank=female||male ; * Trim or Compress is not used. New
variable may contain blanks;
Proc print data=a ; run;
Result:

tes fami re fema mal tre CROSS CROSSbl


ID
t ly p le e e no ank
1A1 F43M2
1 A 1 F43 M28 1 F43 M28
1 8
1B1 F22M0
1 B 1 F22 M02 2 F22 M02
2 2
1B2 F22M0
1 B 2 F22 M02 4 F22 M02
4 2

4. Creating new variables by partitioning a variable using the SUBSTR


* Let tree ID is combination of test#=1, family=A, rep#=2,
tree#=3;

ID vol dbh ht
1A23 12.1 4.5 2.5
1A24 14.5 5.2 2.7
1B15 11.8 3.9 2.1

data a ;
set a;
tree=substr(ID,4,1); *Use ID, take 4th character to create TREE
number;
family=substr(ID,2,1); * create family code ;
reptree=substr(ID,3,2); *Start from 3rd column, pick 3rd and the
next;
Result:
proc print data=a; run;

treeID vol dbh ht tree family reptree


1A23 12.1 4.5 2.5 3 A 23
1A24 14.5 5.2 2.7 4 A 24
1B15 11.8 3.9 2.1 5 B 15

5. Using the TRIM to remove trailing blank


*TRIM copies a character argument, removes all trailing blanks, and returns the trimmed
argument as a result;
p1=trim(left(p1)); *trim romeves blank, left aligns to left;
p2=trim(left(p2));

* or ;
data a;
input part1 $ 1-10 part2 $ 11-20;
hasblank=part1||part2;
noblank=trim(part1)||part2;
put hasblank;
put noblank;
datalines;

* SAS Statements Results;


x="A"||trim(" ")||"B";
put x;
Result: A B

x=" ";
y=">"||trim(x)||"<";
put y;
Result: > <

6. Removing the blank and aligning LEFT


a=' DUE DATE';
b=left(a);
put a;
Result: a='DUE DATE'

7. Converting a period separated value to a comma separated value (TRANSLATE)

dep=input(translate(depcomma,'.',','),8.3);

The Translate statement converts trait depcomma from 12.45 to 12,45. Input statement converts
it to numeric.

8. Using the AND and OR operators,


You can combine two or more conditions. AND combines two conditions by selecting values
that satisfy both conditions, and OR combines two conditions by selecting values that satisfy
either or both conditions.

Data a ;
set b (keep=ID distance dens ringno type);
*where ID='4N14' | ID ='4N15' | ID ='4N21' ;
where ID in ('4N14', '4N15', '4N21');
* where type=E & experience=4 ; *&=AND ;
run;

9. Using DIF and LAG functions

DIF function creates a new variable (D) by taking the difference of observations of another
variable (X) (See SAS manual). Syntax, DIF<n>(argument); *<-- n specifies number of LAGS

data two;
input X @@;
Z=lag(x);
D=dif(x);
datalines;
2 6 4 7;
proc print data=two;
run;

Results of the PROC PRINT step follow:


X Z D
1 . .
2 1 1
6 2 4
4 6 - 2

10. Converting a variable into Lowcase or Uppercase

data a; set a;
x='INTRODUCTION';
y=lowcase(x);
put y;
run;

11. How to put 3 variables of a genotype given in different columns into one column

fam tree ht dbh vol


1 1 12 4.5 125
1 2 10 3.9 109
data a;
set b(rename=(ht=y))
b(rename=(dbh=y))
b(rename=(vol=y));
run;
Result:

fam tree y
1 1 12
1 1 4.5
1 1 125
1 2 10
1 2 3.9
1 2 109

12. Creating an OUTPUT Text data file (ASCII) from SAS file

* The first part creates a file putting Column HEADINGS only;


data _null_ ;
file 'c:\myfolder\[Link]' ;
put 'factor var1 var2 var3' ; run;

* 2nd part puts data in columns, appends this file to the first;
data _null_ ;
set mydata;
file 'c:\myfolder\[Link]' mod ;
put factor 1-8 (var1-var2) (7.1) ; run;

* PC: the 'mod' statement appends the second file to the first.
Delete the output file ([Link]) before running the code again;

13. Transposing statistics

data a ;
input chain $ stat $ g1 g2 g3 ;
datalines;
378oneI1 MEAN 0.5130 0.1976 0.7106
378oneI1 MEDIAN 0.4675 0.1703 0.6712
378oneI1 STD 0.3235 0.1339 0.3634
378oneI2 MEAN 0.5257 0.1977 0.7233
378oneI2 MEDIAN 0.4810 0.1707 0.6818
378oneI2 STD 0.3267 0.1309 0.3699
;
proc sort data=a ; by chain ; run;

* If you have Gruoping (here Chain) use BY statement. It is not


transposed.
the ID statement names the variable whose values become new
variable names
VAR variables are the transposed values;
proc transpose data=a out=b;
by chain;
var g1 g2 g3;
id stat;
run;

data c; set b;
meanstd=input(compress(mean||'±'||std), $12.) ;
run;

proc print data=c noobs; run;

chain _NAME_ MEAN MEDIAN STD meanstd

378oneI1 g1 0.5130 0.4675 0.3235 0.513±0.3235

378oneI1 g2 0.1976 0.1703 0.1339 0.1976±0.133

378oneI1 g3 0.7106 0.6712 0.3634 0.7106±0.363

378oneI2 g1 0.5257 0.4810 0.3267 0.5257±0.326

378oneI2 g2 0.1977 0.1707 0.1309 0.1977±0.130

378oneI2 g3 0.7233 0.6818 0.3699 0.7233±0.369

14. Grouping observations with IF/THEN ELSE statements

* grouping variables or creating a new variable using


IF/THEN ELSE statement;

data a;
input dens percent @@;
datalines;
0.453 0.42..0.470 0.46..0.396 0.39 .0.430 0.46
;
run;
data a; set a ;
if dens>=0.450 and percent>=0.40 then type='T';
else type='J' ;
run;

Result:

dens . percent type


0.453... 0.42... T
0.470... 0.46... T
0.396... 0.39 ...J
0.430... 0.46... J

15. Using * or ? WILDCARDS to read many external files into one file

The * and ? wildcards can be used in either the external file


name or file extension for matching input file names. Use ? to
match a single character and the * to match one or more
characters. The below code combines all the data sets starting
with 'wild' in the 'myfolder'.

Example1:

filename wild 'd:\myfolder\wild*.dat';


data a;
infile wild;
input var1 var2 var3;
run;

'wild2?[Link]' links all the data sets '[Link]',


'[Link]', '[Link]', but not '[Link]'

Example2: This code combines all the data sets in the 'myfolder' subdirectory regardles of their
extention.

data a;
infile 'myfolder/*.*' dlm='09'x dsd missover firstobs=2;
input station week time tmax tmin prec snow;
run;

Example3: This code combines all the data sets having .txt extention in the 'myfolder'
subdirectory

data a;
infile 'myfolder/*.txt' dlm='09'x dsd missover firstobs=2;
input station week time tmax tmin prec snow;
run;

16. Adding overall mean to a data set

data a;
input x @@;
cards;
5 3 4 2 4 ;

proc means data=a noprint;


output out=sumdata(keep=xmean) mean=xmean;

data b;
if _n_=1 then set sumdata;
set a;

You might also like