Date: Fri, 24 Sep 2010 12:09:59 -0500
Reply-To: "Data _null_;" <iebupdte@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Data _null_;" <iebupdte@GMAIL.COM>
Subject: Re: PROC REPORT: Across - remove cols of all missing values
In-Reply-To: <4698336393F47347A088FB9F99FF1EBACF8999@TLRUSMNEAGMBX26.ERF.THOMSON.COM>
Content-Type: text/plain; charset=ISO-8859-1
PROC statement option NOCOMPLETECOLS
On Fri, Sep 24, 2010 at 12:01 PM, Matthew Pettis
<matt.pettis@thomsonreuters.com> wrote:
> Hi,
>
> I am making a report that is simulated in the code below, and I'd like
> to eliminate columns that have no data. In the case below, I have the
> following situation:
>
> 1. When level_1 = 'I', then level_2 is either 'A' or 'B'.
> 2. When level_1 = 'II', then level_2 is either 'C' or 'D'.
>
> When I make my report as shown below, I get columns for when level_1 =
> 'I' and level_2 = 'C' or 'D' and for level_1 = 'II' and level_2 = 'A' or
> 'B'. These don't have data, and have a column of all missing values.
>
> Is there a way to elimitate columns that are all missing that arise in
> situations like this?
>
> Thanks,
> Matt
>
>
>
> === Begin SAS ===
> data have;
> infile datalines;
> input level_1:$8. level_2:$8.;
>
> do i=1 to 3;
> metric_1 = ranuni(0);
> metric_2 = ranuni(1);
> output;
> end;
> datalines;
> I A
> I B
> II C
> II D
> ;
> run;
>
>
> proc report data=have nowd headline headskip ls=192 ps=330;
> columns
> i
> level_1,level_2,(metric_1 metric_2)
> ;
> define i / group;
> define level_1 / across;
> define level_2 / across;
> define metric_1 / analysis format=8.3;
> define metric_2 / analysis format=8.3;
> run;
> === End SAS ===
>
|