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 (March 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 26 Mar 2008 09:58:02 -0500
Reply-To:     "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Subject:      Re: need help with Proc PMENU and getting values
Comments: To: FPAStatman <brentvtimothy@gmail.com>
Content-Type: text/plain; charset="iso-8859-15"

FPAStatman wrote: > I have this simple program, in which I want to be able to choose an > option and pass it into a macro variable for future use. the problem > is, the Call Symput portion of the program doesn't run until the end, > which makes the whole thing rather useless. Can anyone please tell me > what I am doing wrong? > Thank you

Code a %let as your dialog action. Submitting a macro invocation that generates a data step to assign a macro variable value via symput is way too roundabout.

--------------- LIBNAME menu "%sysfunc(pathname(WORK))";

PROC PMENU CATALOG=menu.menus; MENU try1; ITEM 'Group1' MENU=pull_down_menu; MENU pull_down_menu; ITEM 'Group1 A' DIALOG=a1; ITEM 'Group1 B' DIALOG=a2; DIALOG a1 '%%let Option=%1;end;'; TEXT #1 @2 'Select your option:'; RADIOBOX DEFAULT=1; RBUTTON #3 @5 'Option #1' SUBSTITUTE='opt_a1_1'; RBUTTON #4 @5 'Option #2' SUBSTITUTE='opt_a1_2'; RBUTTON #5 @5 'Option #3' SUBSTITUTE='opt_a1_3'; DIALOG a2 '%%let Option=%1;end;'; TEXT #1 @2 'Select your Option:'; RADIOBOX DEFAULT=1; RBUTTON #3 @5 'Option #1' SUBSTITUTE='opt_a2_1'; RBUTTON #4 @5 'Option #2' SUBSTITUTE='opt_a2_2'; RBUTTON #5 @5 'Option #3' SUBSTITUTE='opt_a2_3'; run; %MACRO slct(optn); DATA null; CALL SYMPUT('selopt',&optn); RUN; %MEND;

%WINDOW showmenu menu=menu.menus.try1 rows=40 columns=80 #1 @1 'Right click to make a selection' #5 @10 'Welcome to this trial SAS program' ATTR=highlight COLOR=blue #15 @20 'Select option to continue' COLOR=blue ; %DISPLAY showmenu;

%put Option=&Option; ---------------

Richard A. DeVenezia http://www.devenezia.com


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