LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (July 2007, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 10 Jul 2007 18:49:02 -0400
Reply-To:   John Birken <zbq5@CDC.GOV>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   John Birken <zbq5@CDC.GOV>
Subject:   Custom Report Grouping

Hi all:

I want to group the following output by FlagIndex

FlagIndex State Anemia Cardiac Cronic Diabetes

Unrevised: Alabama 1 1 1 1 Unrevised: Alaska 1 1 1 1 Unrevised: Virginia 1 1 1 1 Mid-Year RevisVermont 0 0 1 0 Revised: Florida 0 0 1 0 Revised: Washington 0 0 1 0 Possessions Puerto Rico 0 0 1 0 Possessions Virgin Islands 1 1 1 1

APPEARS AS:

FlagIndex State Anemia Cardiac Cronic Diabetes

Unrevised: Alabama 1 1 1 1 Alaska 1 1 1 1 Virginia 1 1 1 1 Mid-Year RevisVermont 0 0 1 0 Revised: Florida 0 0 1 0 Washington 0 0 1 0 Possessions Puerto Rico 0 0 1 0 Virgin Islands 1 1 1 1

The first ungrouped table is generated by the following code.

Testing for the first FlagIndex =1 with If First.FlagIndex = 1 then do; generates the 4 new group rows.

Combining these new group rows with other group row members doesn't work. .... as listed or with a number of other approaches. Only arrays did the trick ..... and became very involved.

Thanks ahead of time for the succinct simple solution.

John

OPTIONS NOCENTER MLOGIC SYMBOLGEN MPRINT NODATE NONUMBER PS=68 LS=210;

DATA _NULL_; SET UnRevised MidYearRevised RevisedOnly Possessions END = EOF; by FlagIndex; FILE PRINT HEADER=HEADNOTE LINESLEFT = CKLINE;

TITLE;

*If First.FlagIndex = 1 then do; put @1 FlagIndex FlagIdName. @15 ST_NAME $21. @38 ANEMIA1 $1. @47 CRONIC1 $1. @55 DIABET1 $1. ; /*ELSE put @15 ST_NAME $21. @38 ANEMIA1 $1. @47 CRONIC1 $1. @55 DIABET1 $1.; */

IF EOF THEN PUT '____________________________________________________________________'/; RETURN;

HEADNOTE: tday=date(); PUT @76 &thisyear ' Natality Flag File Report' @160 tday date7. / @80 'Unrevised Risk Factors ' //

'Revision State Anemia Cardiac Cronic Diabetes '/ '__________________________________________________________________ '/; *end; RUN;


Back to: Top of message | Previous page | Main SAS-L page