- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello experts,
Please, I want to send a popup boxe message, if the length of macro-variable more than a fixed lengths.
%let use_name=Bob; /* Max length of user_name must be 15 */
%let user_id=8562; /* Max length of user_id must be 4 */
%macro check ;
%if (%length(&use_name)<16 & %length(&use_id)<5) %then %do;
%treatment;
%end;
%else %do;
/*send a popup boxe message to the user */
%end;
%mend check;
%check;
%mend check;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
You could investigate %WINDOW and %DISPLAY, but they might have limited use depending on your configuration and how you are using SAS.
If you are using the BI Platform and stored processes, then you could use the prompting framework to prompt and validate input from users.
As you can see from the documentation example, http://support.sas.com/documentation/cdl/en/mcrolref/69726/HTML/default/viewer.htm#n0ojc9rtfrzvbdn16... the %WINDOW and %DISPLAY don't work in EG or SAS Studio.
EG and SAS Studio both have other ways to collect input from users. (EG has the prompting framework and SAS Studio allows you to generate custom tasks.)
cynthia
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@Cynthia_sas : Thank you for your answer.
As you said, I have tried before %WINDOW and %DISPLAY, but It does not work, because I work in EG and SAS 9.2.
So, please I need more information about the "prompting framework for EG and SAS 9.2" ? or any simple idea without framework ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
http://support.sas.com/resources/papers/proceedings10/036-2010.pdf
http://support.sas.com/resources/papers/proceedings10/041-2010.pdf
If you do NOT have the capability to create Stored Processes, then you won't be able to do everything, but the basic prompting framework is there in EG 4.2 to use.
cynthia
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@Cynthia_sas : Thank you, that's very kind from you .
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi cynthia,
I am trying to use your code in SAS 9.4, I am getting the following error in the log. Can you please help how to generate pop msg box.
thank you.
1128 %window welcome color=white 1129 #5 @28 'Welcome to SAS.' attr=highlight 1130 Color=green 1131 #7 @15 1132 'You are executing release &sysver on &sysday, &sysdate...' 1133 #12 @29'Press Enter to Continue' 1134 %display welcome; ERROR: Open code statement recursion detected. ERROR: Open code statement recursion detected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You are missing a semi-colon to end the %WINDOW statement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
When I try the code in SAS 9.4, it works for me.
Pay close attention to the code I originally posted. In resolving macro variable references like &sysver or &sysdate, single quotes and double quotes make a HUGH difference. So do semi-colons to end statements.
If you continue to have issues with your %WINDOW attempts, your best resource is to work with SAS Tech Support.
Cynthia