LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (August 2000, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sun, 27 Aug 2000 08:46:47 -0000
Reply-To:     Anna Henson <anna_henson@YAHOO.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Anna Henson <anna_henson@YAHOO.COM>
Organization: Aracnet Internet
Subject:      Please Help Me with SAS Macro!

Dear SAS users:

I am learning how to write macro, and this is my first one. I am trying to import these 7 files (allcli1.txt allcli2.txt ...allcli7.txt) then combine into 1 SAS dataset called acs2000.cli_0800. But it does not recognize my macro vriable &I, which is the number from 1 to 7 in the data step.

My Codes: %Let f_name=CLI_0800;

%MACRO IMPORTD (obsv);

%DO I = 1 %to &obsv; DATA work.cli&I; INFILE 'C:\anna\July2000\allcli&I.txt' dsd truncover; LENGTH priceSt $4 logo $4 acctno $16; INPUT acscu pricestr $ prefixcd logo $ acctno $; RUN; %END;

%MEND IMPORTD;

%MACRO combined (set1,set2,set3,set4,set5,set6,set7 ); DATA acs2000.&f_name (index=(actionid acscu)); SET cli&set1 cli&set2 cli&set3 cli&set4 cli&set5 cli&set6 cli&set7; RUN; %MEND combined ;

%importD (7); %combined (1,2,3,4,5,6,7); ------------------------- ERRORS: 6056 %Let f_name=CLI_0800; 6057 6058 %MACRO IMPORTD (obsv); 6059 6060 %DO I = 1 %to &obsv; 6061 DATA work.cli&I; 6062 INFILE 'C:\anna\July2000\allcli&I.txt' dsd truncover; 6063 LENGTH priceSt $4 logo $4 acctno $16; 6064 INPUT acscu pricestr $ prefixcd logo $ acctno $; 6065 RUN; WARNING: The current word or quoted string has become more than 200 characters long. You may have unbalanced quotation marks. NOTE: A single quote (') will terminate this quoted string.

I really appreciate your helps.

Anna Henson


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