Desktop productivity for business analysts and programmers

Starting EG automatically (via Win Scheduler) and supplying a project name

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 79
Accepted Solution

Starting EG automatically (via Win Scheduler) and supplying a project name

Hi, I've been trying to understand how to automatically start EG61 with a project as input parameter. I can get EG61 started OK, but how to supply the project file? I did not yet find any post/google hits on it. Help appreciated.

 

Regards

Poul R S


Accepted Solutions
Solution
‎05-22-2017 07:39 AM
Esteemed Advisor
Posts: 6,706

Re: Starting EG automatically (via Win Scheduler) and supplying a project name

If your SAS is located on a server, I'd still go for doing the scheduling there; every solution you solve along the way will be handy on the day when you have a real scheduling need.

So I recommend saving your code to a single .sas file and run that in batch mode on the server.

Only if you have a single-machine install of SAS on your desktop will scheduling a project via EG make any sense, IMO.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Contributor
Posts: 50

Re: Starting EG automatically (via Win Scheduler) and supplying a project name

Hello,

 

If you open the VBScript you will notice that there's a "prjName" variable with the path and the name of your project.

So probably you can use VBS arguments to the variable (just supposing never tried before)

 

Something like this:

prjName = Wscript.Arguments(0)  'Project Name

And then when you call you VBS you pass the parameter.

Have a try Smiley Happy

 

Best regards,

Bruno Silva

 

Frequent Contributor
Posts: 79

Re: Starting EG automatically (via Win Scheduler) and supplying a project name

I am sorry, but you missed me there.

I set EG up to start in the Scheduler in Win 7. I did not launch it via a VBS script, - that I know of. But perhaps the Scheduler creates a VBS anyway? Is that what you mean?

 

Regards

Poul

Contributor
Posts: 50

Re: Starting EG automatically (via Win Scheduler) and supplying a project name

Hello,

 

When you schedule through the Enterprise Guide he creates a VBS file somewhere. I was referring to change that VBS file but if you schedule directly like this:

.../../SASGuide.exe <projectfile.egp>  

 

If so maybe you can create a .sh or .bat file that accepts parameters and then make the call.

 

Best Regards,

Bruno Silva

Esteemed Advisor
Posts: 6,706

Re: Starting EG automatically (via Win Scheduler) and supplying a project name

If that scheduling is more than just a pet project of yours, I strongly recommend creating a .sas code file from your project and schedule that on the SAS server directly, using your organization's standard scheduler. Desktops are not suited to do business-critical jobs.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Frequent Contributor
Posts: 79

Re: Starting EG automatically (via Win Scheduler) and supplying a project name

It's kind of in between 'business critical' and pet. I want to update 2 dashboards, that show running data from production. I am updating them manually now, but want it to be automatic.
Kind regards Poul
Solution
‎05-22-2017 07:39 AM
Esteemed Advisor
Posts: 6,706

Re: Starting EG automatically (via Win Scheduler) and supplying a project name

If your SAS is located on a server, I'd still go for doing the scheduling there; every solution you solve along the way will be handy on the day when you have a real scheduling need.

So I recommend saving your code to a single .sas file and run that in batch mode on the server.

Only if you have a single-machine install of SAS on your desktop will scheduling a project via EG make any sense, IMO.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 154 views
  • 1 like
  • 3 in conversation