LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (January 2006, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 6 Jan 2006 19:06:51 +0000
Reply-To:   Madan Kundu <madan4331@YAHOO.CO.IN>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Madan Kundu <madan4331@YAHOO.CO.IN>
Subject:   problem with SAS macro
Comments:   To: group <statisticians_group@yahoogroups.co.in>
Content-Type:   text/plain; charset=iso-8859-1

Hi,

I have faced following problems with macros. I have defined "window" named as "employee" and a macro named as "empdata_mod1". Then I have invoked macro empdata_mod1(month). But I am not getting result what i do expect. When I invoke macro %empdata_mod1(month) then it will display employee.base and employee.month window. Then if I type in the command line "dept" then it displays employee.dept window. Upto this is ok and no problem. But if i write in the command line other than "dept", say, "division" then it does not show DIVISION is not valid . You may choose: DEPT; but it should be according to what logic i have employed in the macro.

Certainly, I did mistake. I have scratched my head but i could not make necessary correction. if anybody can do this then it will be great help for me.

My sas macro program is as follows:

%window employee group=base #5 @4 "Date of Access: &sysday, &sysdate.." #8 @10 "Employee Data Base" #17 @29 "Press" @35 "Enter" attr=underline @41 "to continue."

group=month #9 @10 "Data for" @19 mon 3 protect=yes #11 @4 "Or select another month (blank to quit):" @45 mon 3 attr=underline

group=dept #12 @10 "Report for all departments" #14 @4"Or Select a department" @27 dept 6 attr=underline;

%macro empdata_mod1(show); %local loop; %let loop=1; %display employee.base noinput; %if &show=month %then %do %until (&loop=0); %display employee.month; %if %upcase(&syscmd)=DEPT %then %do ; %display employee.dept; %let loop=0; %end; %else %if &syscmd ne %then %do; %let sysmsg=%upcase(&syscmd) is not valid . You may choose: DEPT; %display employee.month; %end; %else %let loop=0; %end; %else %if &show=dept %then %display employee.dept; %mend empdata_mod1;

%empdata_mod1(month)

Waiting for a quick reply.

With regards, Madan

--------------

Madan Gopal Kundu Room no 18, Sukhatme Hostel Indian Agricultural Statistics Research Institute Library Avenue, Pusa New Delhi 12 India Web: http://www.freewebs.com/madanstata mobile: 91-9868788406 e-mail: madan4331@yahoo.co.in

Send instant messages to your online friends http://in.messenger.yahoo.com


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