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 2004, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 15 Jul 2004 10:25:37 -0400
Reply-To:     Bob_Abelson@HGSI.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Bob Abelson <Bob_Abelson@HGSI.COM>
Subject:      Re: How to make this fast?
Content-Type: text/plain; charset="us-ascii"

Absolutely. You can use an array for this.

data yourdata; set yourdata; array _p[*] p1-p40; do i=1 to hbound(_p); if _p[i]=0 then _p[i]=.; end; drop i; run;

Bob Abelson HGSI 240 314 4400 x1374 bob_abelson@hgsi.com

Adriano Rodrigues - Instituto GPP <adriano@GPP.COM.BR> Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> 07/15/2004 11:24 AM Please respond to Adriano Rodrigues - Instituto GPP

To: SAS-L@LISTSERV.UGA.EDU cc: Subject: How to make this fast?

Hi all,

I have 40 variables, p1-p40.

i want to make if p1=0 then p1=.; to all 40 variables (if p2=0 then p2=., if p3=0 then p3=. etc)

can i make this in 1 loop?

thx, Adriano


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