Date: Fri, 16 Jan 2004 10:00:04 -0800
Reply-To: "Terjeson, Mark" <TERJEM@DSHS.WA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Terjeson, Mark" <TERJEM@DSHS.WA.GOV>
Subject: Re: One simple question about macro
Content-Type: text/plain; charset=us-ascii
Hi Nancy,
Macro items will get resolved when in a
double-quoted string. They will not get
resolved in a single-quoted string. This
allows you to have macro stuff resolve in
"F:\MCP\SPSS_Portable files\Med&yr..por"
and still be able to have literal strings
inside single quotes such as 'mo&yr'.
Hope this is helpful,
Mark Terjeson
Reporting, Analysis, and Procurement Section
Information Services Division
Department of Social and Health Services
State of Washington
mailto:terjem@dshs.wa.gov
-----Original Message-----
From: Nan Li [mailto:nanl@NLCHI.NF.CA]
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.