Date: Tue, 16 Mar 2004 08:57:12 -0500
Reply-To: diskin.dennis@KENDLE.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Dennis Diskin <diskin.dennis@KENDLE.COM>
Subject: Re: RE : Data from library on a temporary SAS data set
Content-Type: text/plain; charset="iso-8859-1"
Christine,
1. When you use a macro variable witihin quotes, you must use double
quotes " instead of single ' for the macro variable to resolve.
2. If you have a period after the macro variable, it needs to be doubled
because the period is used to signal the end of the macro variable, so the
first one is ignored.
Thus your statement would be something like:
file abc "u:\wieck\coest\data\c2files\&R.._c2_dout.csv";
HTH,
Dennis Diskin
Christine Wieck <wieck@AGP.UNI-BONN.DE>
Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
03/16/2004 08:44 AM
Please respond to Christine Wieck
To: SAS-L@LISTSERV.UGA.EDU
cc:
Subject: Re: RE : Data from library on a temporary SAS data set
Dear Jim and Stéphane,
it seems, that this macro variable doesn't work at all with file
references because I always get the error message:
ERROR: Physical file does not exist,
u:\wieck\coest\data\c2files\&R._c2_dout.csv.
I have SAS version 8.2
Whereas, with the put statement, it works fine.
Regards, Christine
*********** REPLY SEPARATOR ***********
On 16/03/2004 at 14:34 Groeneveld, Jim wrote:
>Hi Stéphane,
>
>Be careful, I think your code
>
>file in u:\est\&R_data.csv
>file out u:\est\&R_est.gms
>file out1 u:\est\&R_tval.gms
>
>should read, including a period:
>
>file in u:\est\&R._data.csv
>file out u:\est\&R._est.gms
>file out1 u:\est\&R._tval.gms
>
>because otherwise it would look for the macro variables R_data etc. The
>underline is a valid character in macro variable names as well.
>
>Regards - Jim.
>--
>. . . . . . . . . . . . . . . .
>
>Jim Groeneveld, MSc.
>Biostatistician
>Science Team
>Vitatron B.V.
>Meander 1051
>6825 MJ Arnhem
>Tel: +31/0 26 376 7365
>Fax: +31/0 26 376 7305
>Jim.Groeneveld@Vitatron.com
>www.vitatron.com
>
>My computer remains home, but I will attend SUGI 2004.
>
>[common disclaimer]
>
>
>-----Original Message-----
>From: Datametric [mailto:datametric@CLUB-INTERNET.FR]
>Sent: Tuesday, March 16, 2004 13:58
>To: SAS-L@LISTSERV.UGA.EDU
>Subject: RE : Data from library on a temporary SAS data set
>
>
>Hi,
>
>In order to resolve your problem, you have to create a macro variable :
>
>%let R = 360nc;
>
>file in u:\est\&R_data.csv
>file out u:\est\&R_est.gms
>file out1 u:\est\&R_tval.gms
>
>Be careful with the step :
>
>DATA _NULL_;
>set estimates;
>file out1;
>put "EST_360nc.C10" C10;
>put "EST_360nc.C11" C11;
>
>With the macro variable, you must use 2 dots with the object1.object2
form
>name :
>
>DATA _NULL_;
>set estimates;
>file out1;
>put "EST_&R..C10" C10;
>put "EST_&R..C11" C11;
>
>
>Stéphane.
>
>
>-----Message d'origine-----
>De : SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] De la part de
>Christine Wieck
>Envoyé : mardi 16 mars 2004 13:47
>À : SAS-L@LISTSERV.UGA.EDU
>Objet : Re: Data from library on a temporary SAS data set
>
>
>Dear SAS-Experts,
>
>thanks for the hints to solve my problem.
>
>Regarding your proposals with the macro variable, I have a second
question:
>
>I do my estimations for several regions, therefore I have several data
>files. I have to address these regions at several places in my SAS
program
>for in-and outputting and I try (since several days) to do this over some
>string variable or so which is just defined once and then used at several
>places (as I know it from Eviews and GAMS).
>
>I have the feeling that this could be done by this macro variable but
>couldn't find any reference to this in the user guides.
>
>My program looks like the following:
>
>------------------------------------
>
>file in u:\est\360nc_data.csv
>file out u:\est\360nc_est.gms
>file out1 u:\est\360nc_tval.gms
>
>data ...
>
>proc means...
>
>proc model....
>title '360nc'
>
>proc print....
>
>DATA _NULL_;
>set estimates;
>file out1;
>put "EST_360nc.C10" C10;
>put "EST_360nc.C11" C11;
>.....
>----------------------------------------
>
>I would like to replace this '360nc' by some variable.
>
>e.g.
>%R% = 360nc;
>
>file in u:\est\%R%_data.csv
>file out u:\est\%R%_est.gms
>file out1 u:\est\%R%_tval.gms
>
>Any advice?
>
>Thanks in advance,
>
>regards, Christine
>__________________________________________
>
>Dipl.- Ing. agr. Christine Wieck
>Institute for Agricultural Policy,
>Market Research and Economic Sociology
>Bonn University
>
>Nussallee 21
>D - 53115 Bonn
>Germany
>
>Phone: +49-228-73 23 26
>Fax: +49-228-73 46 93
>e-mail: wieck@agp.uni-bonn.de
>Internet: http://www.agp.uni-bonn.de/agpo/staff/wieck/wieck_e.htm
>___________________________________________
__________________________________________
Dipl.- Ing. agr. Christine Wieck
Institute for Agricultural Policy,
Market Research and Economic Sociology
Bonn University
Nussallee 21
D - 53115 Bonn
Germany
Phone: +49-228-73 23 26
Fax: +49-228-73 46 93
e-mail: wieck@agp.uni-bonn.de
Internet: http://www.agp.uni-bonn.de/agpo/staff/wieck/wieck_e.htm
___________________________________________
|