SAS Notes Master File
SAS Notes Master File
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.
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 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?
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.
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 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 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.
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.
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 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 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 ·
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.
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)
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.
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
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).
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;
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 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 would you code a merge that will keep only the observations that have matches from both data
sets?
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;
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.
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 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.
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 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.
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.
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.
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]
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.
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.
You know that your key strategy is to first uncover your interviewer's greatest wants and needs
before you answer questions.
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:
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.
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 ?
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.
“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.
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.
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.
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.
data a ; set a;
ID=compress(test||family||rep||tree); *Combine factors using ||,
remove any trailing blank using COMPRESS;
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;
* or ;
data a;
input part1 $ 1-10 part2 $ 11-20;
hasblank=part1||part2;
noblank=trim(part1)||part2;
put hasblank;
put noblank;
datalines;
x=" ";
y=">"||trim(x)||"<";
put y;
Result: > <
dep=input(translate(depcomma,'.',','),8.3);
The Translate statement converts trait depcomma from 12.45 to 12,45. Input statement converts
it to numeric.
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;
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;
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 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
* 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;
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;
data c; set b;
meanstd=input(compress(mean||'±'||std), $12.) ;
run;
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:
15. Using * or ? WILDCARDS to read many external files into one file
Example1:
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;
data a;
input x @@;
cards;
5 3 4 2 4 ;
data b;
if _n_=1 then set sumdata;
set a;