04-24-2018 07:32 AM
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');
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?
04-24-2018 07:44 AM
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.
04-24-2018 07:53 AM
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.
04-24-2018 08:07 AM
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.
04-24-2018 09:30 AM
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.
04-24-2018 10:16 AM
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.
04-24-2018 10:44 AM
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'); */
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>';
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.
04-24-2018 12:07 PM
04-24-2018 03:26 PM
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.
call execcmd("GSUBMIT %include 'Corresp_Analysis.sas';");