BookmarkSubscribeRSS Feed
sunny_nar2018
Obsidian | Level 7

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

10 REPLIES 10
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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. 

sunny_nar2018
Obsidian | Level 7

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

Rick_SAS
SAS Super FREQ

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.

sunny_nar2018
Obsidian | Level 7

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

Tom
Super User Tom
Super User

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.

sunny_nar2018
Obsidian | Level 7

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

 

Tom
Super User Tom
Super User
You are talking about two different things. The PMENU entry is issuing commands that can be issue from the display manager command line.
Check the documentation on-line for the syntax and examples of how to submit SAS code from within an SCL program.
sunny_nar2018
Obsidian | Level 7

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

Tom
Super User Tom
Super User

The display manager command for submitting code is GSUBMIT.

 

GSUBMIT "%include program;"
sunny_nar2018
Obsidian | Level 7

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

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
  • 10 replies
  • 1052 views
  • 0 likes
  • 4 in conversation