Hello All,
I am new to SAS. I have created a frame with a push button. When the button is clicked, it opens up a file dialog box as shown below, which then selects the *.sas program to run. However, after selecting the file, nothing happens.
From the SCL code of the Frame
dcl num rc;
CorresAnalysis: /*push button */
rc = filedialog('open', selfie,'','/sas','*.sas');
return;
Could you please advise what I need to do in order to run a sas program to be displayed in the Frame? If the results of the sas program cannot be displayed in the frame, could you please advise how to open an HTML file in the browser when the button is clicked?
Thanks
Sunny
Hi,
So your using SAS AF/SCL. As far as I know (and this is just opinion) nobody uses that or has used it for quite some time. In anything other than PC SAS I don't think its even present anymore.
What is it your trying to do, just run a program as you can use command line for that. For more complicated projects, there is stored process, .net integration, java, virtual platforms etc.
Hi RW9,
You are right - it is only available on PC. I have a frame already and I just need to open an HTM web page when the push button is clicked and was wondering if you have any idea how to do this? I can see an 'onclickcommand' in the properties window for the push button but thats as far as I can get.
Any pointers? I need to have it as a pushbutton.
Thanks
Sunny
Is the "HTML web page" the results of an analysis? A local file? A page on the internet for which you have a URL? Please let us know what kind of file you are trying to display and we can advise you how to accomplish it using modern tools.
Hi Rick_SAS,
Thanks for your post. I have only SAS 9.4 TS Level 1M3 at my disposal. The page I want to display is the result of the analysis from PROC CORRESP. At first, I wanted to point the push button to execute the *.sas file as soon as the button is pressed. However, because I have not been able to figure out how to run the sas program from the Frame window, I have now decided to open the result of the analysis in the browser instead.
Please do advise.
Thanks
Sunny
If you want to run a program from SCL you should just use a SUBMIT block. You can use %INCLUDE statement in the submit block to source in the SAS program file.
Hi Tom,
Have you got an example of the SUBMIT block?
I have inserted the code below in the correspondence analysis method in the SCL, which does not work:
Corresp_Analysis: /* pushbutton */
/* rc=filedialog('open', selfie,'','/sas','*.sas'); */
SUBMIT
%include 'C:\DeckCash\Analysis\menu\Corresp_Analysis_v2.htm';
ENDSUBMIT;
return;
When I use FSEDIT procedure, I can run the sas program using the %INCLUDE statement as below - This is ran from a dialogbox (PMENU)
FILENAME corresp1 '<path to file *.sas>';
menu viz;
item 'Correspondence Analysis' selection=corresp;
selection corresp 'end;pgm;include corresp1;submit';
The above works - however, when I use the same menu linked to the frame, it does not produce any result.
I hope have not confused you with this. let me know if you have any question.
thanks
Sunny
What is the code / statement in SCL that will run a SAS program (*.sas) when a push button is clicked in a SAS frame? thanks
The display manager command for submitting code is GSUBMIT.
GSUBMIT "%include program;"
Hi Tom,
Thanks for your post, after which I used 'GSUBMIT "%include 'Corresp_Analysis.sas';"'; in the Display Manager command window and it would execute the command successfully. I have now been able to insert the code inside a dialogbox in the menubar, but it then closes the frame when the results are displayed. The same thing happens when I use it with an fsedit procedure. However, I want the SCL equivalent so I can use it in frames when the push button is pressed.
I was thinking of using the call execcmd in the SCL program under the pushbutton method 'CorrespAnalysis1' but nothing happens when the push button is pressed and the log does not give any errors.
CorrespAnalysis1:
call execcmd("GSUBMIT %include 'Corresp_Analysis.sas';");
return;
Any pointers?
Thanks
Sunny
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.