BookmarkSubscribeRSS Feed
sunilreddy
Fluorite | Level 6

using stored process, I want to create a popup window with message based on condition  .

i have tried with file _webout, but it didnt work. your help would be much appreciated in this

7 REPLIES 7
NN
Quartz | Level 8 NN
Quartz | Level 8

Hi,

Maybe you could try using Javascript..

I cannot test the below code.. But you could try it out

data _null_ ;

    file _webout ;

val = '<script type="text/JavaScript">alert("MY MESSAGE HERE ")</script>';

    put val;

  run;

Hope it helps

sunilreddy
Fluorite | Level 6

Thanks a lot for your response.

I am getting insufficient authorisation on as below, its routing to /opt/app/SAS/config/Lev1/SASApp/_webout.dat by default

16 data _null_ ;

17 file _webout ;

18 val = '<script type="text/JavaScript">alert("MY MESSAGE HERE ")</script>';

19 put val;

20 run;

ERROR: Insufficient authorization to access /opt/app/SAS/config/Lev1/SASApp/_webout.dat.

sunilreddy
Fluorite | Level 6

Hi I am getting popup message while using below code.

data _null_ ;

  file _webout ;

  val = '<script type="text/JavaScript">alert("MY MESSAGE HERE ")</script>';

  put val;

run;

but getting error while using macro variable in above alert.

%let Trigger_Button = ALL Buttons;

24        +

25        + data _null_ ;

26        +  file _webout ;

27        +  val = "<script type='text/JavaScript'>alert( "&Trigger_Button." )</script>";

28        +  put val;

29        + run;

30        +

31        +

32        +%mend;

33        +%mail1;

                                                                                          The SAS System

NOTE: Line generated by the macro variable "TRIGGER_BUTTON".

33          "<script type='text/JavaScript'>alert( "ALL Buttons

            ___________________________________________

            49                                      388

                                                    76

NOTE 49-169: The meaning of an identifier after a quoted string may change in a future SAS release.  Inserting white space between a quoted string and the succeeding identifier is recommended.

ERROR 388-185: Expecting an arithmetic operator.

ERROR 76-322: Syntax error, statement will be ignored.

Any one help me how to use macro variable along with comment in above

NN
Quartz | Level 8 NN
Quartz | Level 8

Try this..

%let message = test;

data _null_ ;

     file _webout ;

val = cat('<script type="text/JavaScript">alert(" ', "&message",' ")</script>');

     put val;

  run;

milts
Pyrite | Level 9

Hi,

You might want to the code below. Haven't test this one though..

If you want more flexible conditioning on how you want to display your html, you can also use the _webout with put statements although i think it's a bit messy once your code once becomes long.

Hope this helps,

Milton

data _null_;
  format infile $char256.;
  input;
  infile = resolve(_infile_);
  file _webout;
  put infile;
cards4;
<HTML>
<BODY>
<script type="text/javascript">
alert("&MESSAGE.");
</script>
</BODY>
</HTML>
;;;;
run;

sunilreddy
Fluorite | Level 6

Thanks a lot foryour reponse.

I am getting insufficient authorisation access when i am using this code.

15

16 %let MESSAGE =SUNIL;

17 data _null_;

18 format infile $char256.;

19 input;

20 infile = resolve(_infile_);

21 file _webout;

22 put infile;

23 cards4;

ERROR: Insufficient authorization to access /opt/app/SAS/config/Lev1/SASApp/_webout.dat.

NOTE: The SAS System stopped processing this step because of errors.

NOTE: DATA statement used (Total process time):

real time 0.00 seconds

cpu time 0.00 seconds

31 ;;;;

run;

NN
Quartz | Level 8 NN
Quartz | Level 8

Hi

Just check a few things ..

When you modify your stored process ensure you have selected stored process server...

There will two checkboxes one for transient package and the other for Streaming output... Ensure to check only the Streaming output and uncheck the transient package.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 12234 views
  • 1 like
  • 3 in conversation