Date: Fri, 16 Jan 2004 09:53:49 -0800
Reply-To: Jeff Voeller <c-jeff.voeller@MCI.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jeff Voeller <c-jeff.voeller@MCI.COM>
Subject: Re: One simple question about macro
In-Reply-To: <71F03CBD1456D11199ED00805F858886B93CA7@chi-mail.nlchi.nf.ca>
Content-type: text/plain; charset=us-ascii
Try using double quotes in your filename statement:
filename mcppor "F:\MCP\SPSS_Portable files\Med&yr..por";
SAS won't evaluate macro variables enclosed in single quotes.
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Nan Li
Sent: Friday, January 16, 2004 9:51 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: One simple question about macro
Dear Listers,
I'm a SPSS user and switch to SAS for just couple of weeks. I have a
question about macro, and would like to seek for your help. The question is
as the following:
I'm trying to convert 5 SPSS portable files (from med1996.por to med2000.por
) to SAS files (from Medical1996 to Medical2000), when I run the following
very simple macro, I got some error message in log. But, if I don't use
macro variable in fileref, everything seems fine. I couldn't figure out why.
Could you please give me some help about this? Any input would be highly
appreciated!
In addition, I just register in digest list, could you please reply to my
email address? Thanks in advance!
Nancy
****** Macro ******
libname medsas 'F:\SAS_NDSS files';
%macro Convert(yr=&yr);
%* Convert portable SPSS MCP data to SAS files;
%* Keep variables: pin, dat_serv, famtpd, provnum, specode, diag, feecode,
and hosp;
filename mcppor 'F:\MCP\SPSS_Portable files\Med&yr..por';
proc convert spss=mcppor out=medsas.Medical&yr.(keep=pin dat_serv famtpd
provnum specode diag
feecode hosp where=(famtpd>0 and
(pin<>'0' or pin<>' ')));
run;
proc contents;
run;
%mend Convert;
%Convert(yr=1997);
*** Part of Log ***
ERROR: Physical file does not exist, F:\MCP\SPSS_Portable files\Med&yr..por.
NOTE: The data set MEDSAS.MEDICAL1997 has 0 observations and 0 variables.
WARNING: Data set MEDSAS.MEDICAL1997 was not replaced because new file is
incomplete.
NOTE: PROCEDURE CONVERT used:
real time 0.06 seconds
cpu time 0.03 seconds
ERROR: There is not a default input data set (_LAST_ is _NULL_).
NOTE: Statements not processed because of errors noted above.