If then Delete OR if then output;

sas

    Sponsored Links

    Next

  • 1. weighted regression?
    Hi everyone. I maybe asking a very easy question here but I have a dataset with vary numbers of repeated A measurements for each individuals. During each measuring round, each individuals would do more than one task for a certain time. What would be the most appropriate way to analyze it if my interest is to find out what task contributes to higher A exposure and at the same time taking into account the correlation of the repeated A measurements? I've been told to use weights but i don't understand. Your help is greatly appreciated. Many thanks. Have a great day.
  • 2. Rename some variables in a table
    Hello, My table have many fields.. I only want to rename the variables which start from 'COL. These variables are such as COL1 , COL2, COL3, COL4...COL100 etc.. I want to rename them so that they all become bad_col1, bad_col2... bad_col100 etc.. Is it possible to do this in proc dataset combined with if statement... Please help.. Much appreciated in advance Thanks Wendy.
  • 3. remove double
    Hello Sas-Users, Is there an option to the PROC SORT so that it become case sensitive please. so that it remove the first ou the second line. DATA TABLE_BIDON; INPUT X1 X2 X3 X4 X5 $; CARDS; 2 5 5 1161 ABELIEN 2 5 5 1161 abelien 82 1 5 1499 ANIEL ; RUN; PROC SORT DATA = TABLE_BIDON NODUPKEYS; BY _ALL_; RUN; Thanks. ash_rmy.
  • 4. Week function
    According to the on-line documentation, the week function has two arguements - WEEK(<sas_date>, <descriptor>). The descriptor can be U, V, or W. However when I include the second arguement I get errors in my log that "V" is uninitialized. Any help in using the week function with descriptor=V would be appreciated. My data is: data week; input group $ date; informat date mmddyy6.; datalines; A 030804 B 031004 C 031604 ; run; My code is: data AGid; set week; weekofyear=week(date, v); Thanks, Eric Bush Epidemiologist
  • 5. suppress date from ODS
    Hi, I've this rather complex code (for me!) that uses GREPLAY and ODS to output a .PDF dashboard with a series of tables and charts. We have recently moved from SAS 9.1.3 to SAS 9.2 and when I run the code on SAS 9.2 it adds a date in the format "08:40 Wednesday, November 4, 2009 4" on the top right hand side of all pages. This did not happen with 9.1.3. Anyone knows if there is an option to suppress that date? Thanks, G

Re: If then Delete OR if then output;

Postby nishant.dholakia » Tue, 25 Oct 2005 23:22:13 GMT

I would recommend a where statement instead of an IF because the data would
be subset before going to the PDV in case of a where as opposed to an IF
statement.
 -Nishant



ng a



"its your attitude not your aptitude that determines your altitude"

Re: If then Delete OR if then output;

Postby HERMANS1 » Wed, 26 Oct 2005 00:12:26 GMT

Easwara:
In more extreme cases (>1 million rows of data), I would recommend a SAS
SQL WHERE clause. The SELECT clause will also subset (project) columns.
For 300+K rows of data, assuming that you have relatively short rows, it
won't make much difference whether you use IF or WHERE, or DELETE or
OUTPUT.
Sig

-----Original Message-----
From:  XXXX@XXXXX.COM  [mailto: XXXX@XXXXX.COM ]
On Behalf Of Easwara Moorthy
Sent: Sunday, October 23, 2005 11:18 PM
To:  XXXX@XXXXX.COM 
Subject: If then Delete OR if then output;


Hi All,

I have a situation here with 300+K records I need to filter based on a
rule..for eg if mail=email=phone='Y' then kep it..! any one is having a
'Y', then keep the record.

my question is which will make my computer to breathe at ease when it
filters the records!!

If mail=Y or email=Y or phone=Y then OUTPUT;

(OR)

If mail=N and email=N and phone=N then delete;

i'm not sure which IF statement will give more stress to the PDV/Input
buffer/etc..etc..!!

Thanks
Moorthy

Similar Threads:

1.Deleting the First Row in Text Output

I have the following data located in work.xyz where 'permno' and
'date' are the column headers.

permno  date
10104	20001201
10107	20010321
11081	20010709
11308	20011027
12060	20020214
12490	20020604
13856	20020922

I use the following code to export the data to a text file:

proc export data=xyz
   outfile='C:\xyz.txt'
   replace;
run;

The saved xyz.txt file looks like this:

permno  date
10104	20001201
10107	20010321
11081	20010709
11308	20011027
12060	20020214
12490	20020604
13856	20020922

I need it so the headers permno and date are removed.  I have
attempted to use the if _N_ = 1; then delete command but it does not
work.

Regards,

B.A.

2.to delete or not to delete outliers for extremly skewed variables

hello
i have some extremly skewed variables, if i have to build a predictive
model, should i remove these outliers and made a specific scorecard or
recode them and put them as category or do something else?

3.to delete or not to delete outliers for extremly skewed

Why delete good, meaningful data when you can easily Winsorize?

On 10/21/08, sofiane < XXXX@XXXXX.COM > wrote:
>
> hello
> i have some extremly skewed variables, if i have to build a predictive
> model, should i remove these outliers and made a specific scorecard or
> recode them and put them as category or do something else?
>

4.Suppressing output window but still putting output in a file

Using ODS, I know how to direct the output of proc means to a file,
but I don't know how to prevent that same output from appearing in the
output window.

What I have is something like this:

proc means;
 var x; class y;
 ods output Summary=mean_x_by_y;
run;

There are many values of y, so my output overflows the output window.
I don't need it in the output window, but I do want it in the output
file mean_x_by_y.

Any advice most appreciated....

Thanks!
Paul

5.trouble with GCHART screen output vs file output for transfer to MS Word - with example

Tomislav:

You want to take advantage of the targetdevice= option.  With this
option, you can view the output on the sas screen in whatever alternate
output you like.

If you change the goptions statement as shown below, you can test to the
sas screen and see what you would get in png.  Once it's ready, remove
the targetdevice=png and change the device= back to png.



goptions

device=win
targetdevice=png


gsfname=output

gsfmode=replace

xmax=5in ymax=4in

xpixels=3600 ypixels=2400;


-----Original Message-----
From: SAS(r) Discussion [mailto: XXXX@XXXXX.COM ] On Behalf Of
Tomislav Svoboda
Sent: 10 October, 2004 11:59
To:  XXXX@XXXXX.COM 
Subject: trouble with GCHART screen output vs file output for transfer
to MS Word - with example


Hi,

I am running into problems with the size and proportions of elements in
GCHART outputs using two methods of getting GCHARTs into MS Word (SAS
8.02 ,Windows 2000 and MS Word 2000):

method a) cutting a chart from the SAS output screen and special pasting
it as a device independent bitmap into my Word document.

method b) sending the GCHART output to a PNG file and inserting this
picture file into my Word document.

Here are the problems:
Problem #1) method a) which is the faster method I prefer, is unreliable
- what I see on the output screen is different from what I paste into my
document (y axis label moved and cut off - try example
below)

Problem #2) method b) is more reliable, however, what appears on the
output screen is very different from what appears in the outputted .png
file. Therefore I can only evaluate SAS code changes by opening and
closing insertted .png files.


Can someone please help me either
1) make method a) work, (preferably) or
2) make method b) work such the output I get on the output screen is the
same as what is in my outputted file for faster programming

Here are two samples of code demonstrating the two problems:

Problem #1) what I cut and paste into Word from the following output is
different from the output screen (e.g. y axis label disappears)

data foo;
        input grp $ 18. rate period;
        cards;
Annex,               134.801       1
Annex,               160.158       2
Hostel,              148.788       1
Hostel,              165.126       2
Low Income,Housed    146.350       1
Low Income,Housed    176.528       2
run;

goptions reset=all;

/*I like the SAS output but it doesn't cut and paste as bitmap into Word
well*/

goptions vsize=5 hsize=10;
*goptions ftitle='times new roman/bold' ftext='times new roman' htitle=4
pct hby=4 pct; goptions ftitle='times new roman/bold';
/* Assign pattern characteristics */
pattern v=s c=grey;
/* Assign axis definitions */
axis1 label=none value=(h=12pt f='times new roman' );
axis2 label=(a=90 f='times new roman' h=12pt "Mean Annual Days Under
Community Supervision") value=(h=12pt f='times new roman'); axis3
label=none split="," value=(a=0 h=12pt f='times new roman' );

proc format;
value midform 1='Pre-Annex' 2='Annex';

/* Produce the chart */
proc gchart data = FOO;
vbar Period / sumvar=rate midpoints = 1 2
            maxis=axis1 raxis=axis2 gaxis = axis3 group = grp space =
0.5 gspace = 2 patternid = midpoint width=8 ; format period midform.;
footnote1 ' '; run; quit;



Problem # 2) What appears on the output screen (I don't lke) is
different from the file I insert into Word which is what I want it to
look like:


data foo;
        input grp $ 18. rate period;
        cards;
Annex,               134.801       1
Annex,               160.158       2
Hostel,              148.788       1
Hostel,              165.126       2
Low Income,Housed    146.350       1
Low Income,Housed    176.528       2
run;

goptions reset=all;


*add and subtract this code to send output to screen or file; goptions
device=png gsfname=output gsfmode=replace xmax=5in ymax=4in xpixels=3600
ypixels=2400; filename output 'c:\temp\test.png';

/*good png output, bad SAS screen output*/

goptions vsize=4 hsize=5;
*goptions ftitle='times new roman/bold' ftext='times new roman' htitle=4
pct hby=4 pct; goptions ftitle='times new roman/bold';
/* Assign pattern characteristics */
pattern v=s c=grey;
/* Assign axis definitions */
axis1 label=none value=(h=12pt f='times new roman' );
axis2 label=(a=90 f='times new roman' h=12pt "Mean Annual Days Under
Community Supervision") value=(h=12pt f='times new roman'); axis3
label=none split="," value=(a=0 h=12pt f='times new roman' );

proc format;
value midform 1='Pre-Annex' 2='Annex';


/* Produce the chart */
proc gchart data = FOO;
vbar Period / sumvar=rate midpoints = 1 2
            maxis=axis1 raxis=axis2 gaxis = axis3 group = grp space = 2
gspace = 4 patternid = midpoint width=60 ; format period midform.;
footnote1 ' '; run; quit;




thanks for your help!! And happy Canadian Thanksgiving weekend!

Tomislav

tomislav.svoboda 'at' utoronto.ca

6. OUTPUT option may be preferred over ODS OUTPUT.

7. proc mean output window output in a dataset

8. Output controls output



Return to sas

 

Who is online

Users browsing this forum: No registered users and 34 guest