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 2009, 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 Mar 2009 14:23:16 -0700
Reply-To:     "Nordlund, Dan (DSHS/RDA)" <NordlDJ@DSHS.WA.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Nordlund, Dan (DSHS/RDA)" <NordlDJ@DSHS.WA.GOV>
Subject:      Re: select into with quotes
In-Reply-To:  <200903102056.n2AKkZCe032609@malibu.cc.uga.edu>
Content-Type: text/plain; charset=windows-1252

> -----Original Message----- > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of > Dianne Rhodes > Sent: Tuesday, March 10, 2009 1:57 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: select into with quotes > > Does anyone have an example of putting quotes around the values of > variables going into select into : myvar > > The variable is character and I am trying to feed it into an IN > (&macro_var) statement. > > Dianne R

Dianne,

Here is a hack I sometimes use. I have seen other approaches (using quote, or something) but I can't remember them right off the bat.

Select your_var into : myvar separated by '","'

That is a single quote, double quote, comma, double quote, single quote. Then in your in statement youruse

IN("&myvar")

Hope this is helpful,

Dan

Daniel J. Nordlund Washington State Department of Social and Health Services Planning, Performance, and Accountability Research and Data Analysis Division Olympia, WA 98504-5204


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