If then Delete OR if then output;

sas

    Sponsored Links

    Next

  • 1. TIP: RTF codes in PROC REPORT LINE statements
    To get additional layout control you can embed raw RTF codes. For example, the following produces LINE statements with bullet points at the start, followed by a TAB (neither of these are possible with style attributes), and selectively bolds the text (which a style attribute can do outside the LINE statement but cannot switch off). Note the \~ RTF code to force a blank line. The use of PROTECTSPECIALCHARS=OFF is absolutely necessary. compute after / style={protectspecialchars=off just=l font_size=10pt font_weight=light background=white}; line '\~' ; line '\bullet\tab Percentages Under The \b APPROVE/DECLINE \b0 Headings Use APPROVE/DECLINE TOTAL As Denominator' ; line '\bullet\tab Percentages Under the \b "Overall Total" \b0 Heading Uses The Row Total For That Column As Denominator'; line '\bullet\tab Other Percentages Use \b Overall Total \b0 As Denominator' ; line '\~' ; endcomp ; Don
  • 2. Ref: Help with data..
    My thanks to all of you for your help. I did use the substr function and it worked out well. Regards Kumar
  • 3. OT: Using ibm 122-type keyboards with terminal emulation software going to a mainframe
    Does anyone have any experience with using 122 key keyboards with an emulator and connecting to a mainframe and actually using pf13-24 plus the other keys such as erase eof? I have found several 122 keyboards out there but I have not found one that uses all of the extra keys. At the moment, I have both Netmanage and Hummingbird Exceed available but no keyboard that will work with them. Or, does anyone know of a discussion group where I could take the question? Many thanks, Nat Wooding
  • 4. Help with data..
    Hi Folks: Here's the dataset that I'm working with. The question is below the data step. data abc; input trtmnt $15.; datalines; ABC12375mg ABC123150mg ABC12325mg ; What I need to do is to put a space between the ABC and the 123 and again between the 123 and dosage (75mg,150mg,25mg etc.). Any help would be much appreciated. Regards Kumar
  • 5. Can you make a SAS dataset READ ONLY?
    Platform would be Unix. I've never seen it mentioned but there are times when read-only would be a good thing. Thanks.

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 13 guest