BookmarkSubscribeRSS Feed
hellohere
Pyrite | Level 9

I try to flash a picture every 5 seconds. The pic info is from readin of a txt file.

However the process does not allow picture output flashed until kill the process(all the pictures dumped-out).

 

How to flash the picture periodically?!

 

 

%macro loopit(dt);
%do i=1 %to 1000;
	%indexin(&dt.);// read in txt file
%let varx=...; title "var=&varx"; proc gplot data=indata; // plot it plot (dlastprice )*ind/legend overlay; plot2 (&varx.)*ind/legend overlay; run;quit; title ""; data _null_; // sleep 5 sec call sleep(5,1); run; %end; %mend; %let dt=0718; %loopit(&dt.);

 

8 REPLIES 8
hellohere
Pyrite | Level 9
    ods trace on;
title "var=&varx"; proc gplot data=indata; // plot it plot (dlastprice )*ind/legend overlay; plot2 (&varx.)*ind/legend overlay; run;quit; title "";
    ods trace off;

I put "ods trace on/off" inside the loop, still the pic is not released/flashed until the process gets killed (all pics get dumped)

Kurt_Bremser
Super User

That's just an auxiliary statement helping in revealing the names of output elements of procedures. You need to insert the statements that open and close the destination.

hellohere
Pyrite | Level 9

I tried and still get lost on how. Could you give out an example, with ODS and Proc GPlot(or alike)?!

Kurt_Bremser
Super User

First of all, you need to replace GPLOT with SGPLOT. The newer SGPLOT is integrated with ODS, which GPLOT is not.

 

This is a simple example creating a graph in the RTF destination:

ods rtf file="~/graph.rtf";

proc sgplot data=sashelp.class;
vbar weight;
run;

ods rtf close;
hellohere
Pyrite | Level 9

The graph file is created. But the picture is not flash(all are dumped out until the process is killed).

SASKiwi
PROC Star

As @andreas_lds has already indicated, I don't think this will work with SAS Enterprise Guide or SAS Studio When you submit a SAS program in these it runs the complete job before displaying results as you have found. Maybe you could create a complete set of graphs in SAS then export them to MS Powerpoint as one graph per slide then use Powerpoint's slideshow functionality.  

andreas_lds
Jade | Level 19

If you are trying this in SAS Enterprise Guide or SAS Studio, it is very unlikely that you will able to solve the problem at all, because those environments aren't made for displaying fancy reports.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 1840 views
  • 0 likes
  • 4 in conversation