Date: Fri, 17 Jan 1997 16:20:33 PST
Reply-To: TWB2%Rates%FAR@GO50.COMP.PGE.COM
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: TWB2%Rates%FAR@GO50.COMP.PGE.COM
Subject: Re: filename ref to a variable....
Crack the V6 Language Reference and look at the FILE statement. One of the
optional parms is FILEVAR or FILENAME. Whichever it is, you set it to the name
of a variable whose value is the name of the desired output file. Build
the value of this variable in an assignment statement, so you get code like:
SOMENAME='H:\CLASSES\'||TRIM(TEACH);
FILE DUMMYVAL FILEVAR=SOMENAME;
PUT CLASS;
Tim Berryhill - Contract Programmer and General Wizard
TWB2@PGE.COM or http://www.aartwolf.com/twb.html
Frequently at Pacific Gas & Electric Co., San Francisco
The correlation coefficient between their views and
my postings is slightly less than 0
----------------------[Reply - Original Message]----------------------
Sent by:Undetermined origin c/o LISTSERV maintainer <owner-LISTSERV
Would someone send me an example on how to assign a filename
to the variable in a data step? The purpose of what I want is to
fille the file with the list of classes the teacher is teaching and
have the file contain a list of classes.
ie:
say jones is teaching precalculus, calculus 124 and multivaried calculus
then h:\classes\jones contains:
precalculus
calculus 124
multivaried calculus
something like this seems reasonable but filename doesn't like "||"
ie:
data _null_;
set temp(keep=name class);
by name;
if first.name then do;
filename nfile "h:\classes\"||name;
file nfile lrecl=255;
end;
put class;
run;
thanks for your input!!!
dn
--------------------------------------------------------------
Douglas Nichols dnichols@fhcrc.org
--------------------------------------------------------------
Fred Hutchinson Cancer Research Center
National Wilms Tumor Study Group
Seattle, WA
--------------------------------------------------------------
=====================================================================