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 (March 1998, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 19 Mar 1998 16:02:21 -0800
Reply-To:     nmurray@qldnet.com.au
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         Nya Alison Murray <nmurray@QLDNET.COM.AU>
Subject:      Re: Urgent! Parse certain values in an SCL variable
Content-Type: text/plain; charset=us-ascii

Hi Ramesh

This code puts the values of the states in an scl list.

init: listid=makelist(); test='and state in("CA" "PA" "NC" "NE")'; test=tranwrd(test,'and state in(',''); test=tranwrd(test,')',''); test=translate(test,'','"'); do until(test=''); test=trim(left(test)); item=substr(test,1,2); rc=insertc(listid,item,-1); test=tranwrd(test,item,''); end; call putlist(listid); return;

Ramesh Krishnamurthy wrote:

> Hi SAS-lr's > > I have and SCL variable that I pull out of a list and it looks like this: > test=and state in("CA" "PA" "NC" "NE"....) > > Here's what I want out of this SCL variable: > I want to be able to parse this variable and extract CA PA NC NE. > > Any help suggestions would be appreciated. > > Thanks > Ramesh


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