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 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 28 Jul 2008 16:50:35 -0400
Reply-To:     "Howard Schreier <hs AT dc-sug DOT org>"
              <schreier.junk.mail@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Howard Schreier <hs AT dc-sug DOT org>"
              <schreier.junk.mail@GMAIL.COM>
Subject:      Re: How to put variable name ?

On Mon, 28 Jul 2008 16:36:00 -0400, Fehd, Ronald J. (CDC/CCHIS/NCPHI) <rjf2@CDC.GOV> wrote:

>> From: Adriano Rodrigues >> Checking some data with: >> data errors; >> set all; >> array vars(*) p17a p17b p17c p17d p17e p17f p17g p17h >> p17i p17j >> p17k p17l p17m p17n p17o p17p p17q p17r p17s p17t >> p17u p17v >> p17x p17w p17y p17z; >> >> do i=1 to dim(vars); >> if vars(i) notin (1,2) then put 'quest=' quest 'error='vars(i) ; >> end ; >> run; > >> I appreciate better way for this case to check errors without >> array too :-) > >This solution is non-trivial >as it requires building formats for each variable you want to check.

In general, yes. But here it seems the same validation rule (=1 or =2) pertains to all of the questions.

The need for loops and arrays is a consequence of the wide data structure. If each response were a separate observation, the array would not be needed.

> >INVALID: A Data Review Macro > >http://www.nesug.info/proceedings/nesug01/at/at1008.pdf > >http://www.lexjansen.com/pharmasug/2004/datamanagement/dm06.pdf > >Ron Fehd he-wishes-he-were-retired-from-data-review > or the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov


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