Date: Mon, 7 Jun 2010 11:12:29 -0400
Reply-To: Chi Shu <chichi_cn@LIVE.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Chi Shu <chichi_cn@LIVE.COM>
Subject: Question about SAS macro variables and PROC PMENU
Content-Type: text/plain; charset="us-ascii"
Hi, All,
I used the following codes to get user inputs and created a new dataset and
3 new variables (school_name, school_year, assessement_period) in the data
set. I set the 3 variables equal to the values inputted from PMENU
procedure. But when the program is run for the first time, there is an error
saying " the apparent symbolic references of the 3 variables are not
resolved". When the program is run the 2nd time, the 3 new variables would
pick up the inputs from the 1st running. When the program is run the 3rd
time, the 3 variables would pick up the inputted values from the 2nd round
inputs.
Why do my macro variables seem to be lagging one round?
Thanks!
PROC PMENU catalog=menulib.gmdcat;
MENU gminput;
ITEM 'Please make your selections' dialog=Schlprd;
DIALOG Schlprd 'END;%%LET schoolname=%1;%%LET admin=%2;%%LET
year=@1;RUN';
TEXT #1 @1 'Select School Name';
RADIOBOX DEFAULT=1;
RBUTTON #2 @1 'Gill Elemenary';
RBUTTON #3 @1 'Hillcrest School';
RBUTTON #4 @1 'Sheffield Elementary';
TEXT #5 @1 'Select Test Admin Period';
RADIOBOX Default=1;
RBUTTON #6 @1 'Beginning of the School Year';
RBUTTON #7 @1 'Mid of the School Year';
RBUTTON #8 @1 'End of the School Year';
TEXT #9 @1 'What is the School Year?yyyy';
TEXT #9 @35 len=4;
QUIT;
%WINDOW sets MENU=menulib.gmdcat.gminput COLOR = white COLUMNS = 60 ROWS =
20
#2 @8 'Use pmenus to select data set to print' ATTR=highlight COLOR=blue
#4 @8 'OR'
#6 @8 'Press ENTER to continue.' ATTR=highlight COLOR=blue;
DATA transform;
SET GMDIBELS."Sheet1$"n(RENAME = (Last_Name=Stu_Last_Name
First_Name=Stu_First_Name DOE_2_SASID=SASID LNF=LNF_Raw_Score
PSF=PSF_Raw_Score NWF=NWF_Raw_Score ORF=ORF_Raw_Score Advisor=Class));
WHERE (SASID ^=' ') and ((LNF_Raw_SCORE ^= ' ') or (PSF_Raw_SCORE ^= '
') or (NWF_Raw_SCORE ^= ' ') or (ORF_Raw_SCORE ^= ' '));
School_name="&schoolname";
School_year="&year";
Assessment_Period="&admin";
RUN;
%DISPLAY sets;
|