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"
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"
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
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.
Users browsing this forum: No registered users and 35 guest