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 (November 2006, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 1 Nov 2006 17:17:37 -0500
Reply-To:   "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Subject:   Re: shorthand for list of variables
Comments:   To: sas-l@uga.edu

"Choate, Paul@DDS" wrote: > Heidi - > > You'll need to test each variable a1-a17 (possibly with an array) or > concatenate them and test the concatenation. This concatenates, > removes all the a, b, and c's and compares: > > data test; > input a1 $ a2 $ ...snip...... a17 $; > > if length(cats(of a1-a17))> length(compress(cats(of a1-a17),'abc')) > then delete;

Due to the length of the variables being $8, you will run into false deletions.

E.g. a1='abc'; a2='aa';

This is more robust.

_all_ = '00'x || catx('00'x, of a1-a17) || '00'x;

array block[3] $1 ('a', 'b', 'c'); do _i_ = 1 to dim(block); if index (_all_, cats('00'x,block[_i_],'00x') ) then delete; end;

-- Richard A. DeVenezia http://www.devenezia.com/


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