Hi Visitor,

Thank you very much for visiting this Blog frequently. Like you, 20,000 visitors looked into this SAS Blog so far. I will try my level best to post good and useful SAS tips in future also.

Here is the visitors count by Country since Feb2012 (click on the image for better view):
1

2

Happy Learning 🙂

Scenario:
In your programs directory(folder) there are hundreds of SAS programs and you need to replace a specific word or sentence in majority of those programs.
Example of directory path is: ../project/production/programs
Sentence you like to replace: He made it –> She resolved that

Method-1 (Manual): We will open each and every program and replace the word/sentence manually.

Solution:
Method-2 (automation): Below SAS macro program with the help of perl will take care of this task.

Step1: You need to prepare a .txt file with the list of sas programs, in which you would like to replace the word/sentence. Save this txt file in the same directory(folder) where all of your programs located.
The txt file should look like this:
files

Step2: Run this macro program to complete your task.

options nofmterr mlogic symbolgen mprint;

%macro tot_ttl_chg;

filename in1 “../project/production/programs/files.txt”;
data one;
infile in1 missover pad;
length filename $50;
input filename;
run;

proc sql;
select count(distinct filename)
into : numfiles
from one
where filename ne ‘ ‘;
quit;

%do i=1 %to &numfiles;

data _null_;
set one(firstobs=&i obs=&i);
call symput(“totname”,trim(left(filename)));
run;

x perl -pi -e ‘s|He made it|She resolved that|g’ &totname;

%end;

%mend tot_ttl_chg;
%tot_ttl_chg;

Two Types:
1. Regular (Full) Approval
2. Accelerated Approval

Regular (Full) Approval:
Regular approval is based on endpoints that demonstrate that the drug provides a longer life, a better life, or a favorable effect on an established surrogate for a longer life or a better life.

Accelerated Approval:
The FDA instituted its Accelerated Approval Program to allow for earlier approval of drugs that treat serious conditions, and that fill an unmet medical need based on a surrogate endpoint. A surrogate endpoint is a marker, such as a laboratory measurement, radiographic image, physical sign or other measure that is thought to predict clinical benefit, but is not itself a measure of clinical benefit. The use of a surrogate endpoint can considerably shorten the time required prior to receiving FDA approval.
Drug companies are still required to conduct studies to confirm the anticipated clinical benefit. These studies are known as phase 4 confirmatory trials. If the confirmatory trial shows that the drug actually provides a clinical benefit, then the FDA grants traditional approval for the drug. If the confirmatory trial does not show that the drug provides clinical benefit, FDA has regulatory procedures in place that could lead to removing the drug from the market.

Source: http://www.fda.gov/

approval_process

Image  —  Posted: October 15, 2013 in Posts on Clinical Domain

1. Subsetting IF statement without any condition:
(Visitor Contribution:)
data one;
input age;
if age;
cards;
23
12
.
45
0
54
-21
43
;
run;

Output Dataset created:
age
23
12
45
54
-21
43

Conclusion: So, use above IF statement only for FLAG variables which contains values as 0 or 1 (or) . or 1
to have lesser confusion. I mean use it only when you are sure about the data!

2. Extract Nth highest salary from SALARY table using Proc SQL:
data salary;
input sal;
cards;
23
12
.
45
0
54
-21
43
;
run;

%let N=3;
proc sql;
select a.sal from salary a where &N= (select count(distinct sal) from salary b where a.sal<=b.sal);
quit;

Happy Learning 🙂

Many SAS BI Tips & Tricks at:

http://www.bi-notes.com/