BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Sajid01
Meteorite | Level 14
 

Base SAS code  (say somefile.sas) can be run in batch mode on base SAS .

Can we similarly run the SASEGP project on base sas  (with SAS EG installed) on a  desktop using power shell (not vbscript). My idea is to us code something like this

$my_object=SASEGApplication.Model.Application7.1

$my_egp =new-object -cpmObject $ob

$EGP.open ("D:\my_egp_projec.egp", "")

---------

I know Chris Hemedinger has written a number of blogs on similar topic, but I could not find the answer to my question.

Has anybody used a similar approach

1 ACCEPTED SOLUTION

Accepted Solutions
Sajid01
Meteorite | Level 14

Thanks everybody for your time and efforts in answering my question. 
I agree that it is possible to schedule SAS EGP using vbscript . Thanks for the answer.
However as mentioned in my question and reproduced below :

$my_object=SASEGApplication.Model.Application7.1

$my_egp =new-object -cpmObject $ob

$EGP.open ("D:\my_egp_projec.egp", "")

This is creating an EG object .   As I understand  now this involve the IOM object module.
This requires access to metadata server/Object spawner/workspace server.

So this approach is not possible on PC SAS with no access SAS Server.

Thanks once again everybody for their time.

 

View solution in original post

7 REPLIES 7
CaseySmith
SAS Employee

Yes, you can drive the EG automation interface via Powershell.  Here are a couple examples (in same thread):

https://communities.sas.com/t5/SAS-Enterprise-Guide/Auto-Purge-Project-Log-in-EG/m-p/439805/highligh...

https://communities.sas.com/t5/SAS-Enterprise-Guide/Auto-Purge-Project-Log-in-EG/m-p/440554/highligh...

 

Casey


Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF

View now: on-demand content for SAS users

Sajid01
Meteorite | Level 14

Thanks SASKiwi and Casey Smith for inviting my attention to examples of the capabilities of Powershell - SAS automation.

My question is about the requirement to carry out such tasks and not capabilities.

My question is can I run a SAS EG project in a batch mode  with Base SAS and SAS EG installed locally  say a laptop or a desktop (and more specifically not a server installation so no metadata server available - either locally or remote)

 

SASKiwi
PROC Star

While I've never tried it myself, I would say the answer to running an EGP with local SAS from Powershell would be yes. I suggest you try scheduling via the EG scheduling option first. The resultant VBscript should then give you clues to what Powershell equivalent should be.

CaseySmith
SAS Employee

That is correct.  The answer is yes.  You can run an EG project with local SAS via Powershell, similar to the way you can with VBScript.

 

Casey


Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF

View now: on-demand content for SAS users

Sajid01
Meteorite | Level 14

Thanks everybody for your time and efforts in answering my question. 
I agree that it is possible to schedule SAS EGP using vbscript . Thanks for the answer.
However as mentioned in my question and reproduced below :

$my_object=SASEGApplication.Model.Application7.1

$my_egp =new-object -cpmObject $ob

$EGP.open ("D:\my_egp_projec.egp", "")

This is creating an EG object .   As I understand  now this involve the IOM object module.
This requires access to metadata server/Object spawner/workspace server.

So this approach is not possible on PC SAS with no access SAS Server.

Thanks once again everybody for their time.

 

CaseySmith
SAS Employee

Hi @Sajid01,

 

These statements are not quite correct:

This requires access to metadata server/Object spawner/workspace server.

So this approach is not possible on PC SAS with no access SAS Server.

If your EG project has programs or tasks that were defined to run on a remote workspace server, then yes, running it via the automation interface will attempt to connect to the same remote workspace server (and metadata server and object spawner) to run it.  (It runs the same way as if you ran it in an interactive EG session.)

 

However, if you have PC SAS and your EG project has programs and tasks that were defined to run on your Local SAS server, then they will run on your Local Server without attempting a remote connection.  So, this approach *is* possible on PC SAS (which is a local SAS server).

 

Things to check to make sure your EG project runs on your local PC SAS...

  1. In EG's Tools->Connections, on the Servers tab, make sure you have Automatically add local SAS server (if installed) to server list.  If you have a local server installed (ex. PC SAS), then it will appear in EG as a server named "Local" in your Servers list.
  2. Make sure the runnable items (ex. programs and tasks) defined in your EG project are set to run on the Local server.  In other words, if you run your project in an interactive EG session, only the Local server (no other remote workspace servers) should be connected to after the project finishes running.

Btw, anything you can do with the EG automation/scripting model from VBScript, you can also do from a Windows Powershell script.

 

Casey


Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF

View now: on-demand content for SAS users

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 7 replies
  • 4527 views
  • 0 likes
  • 3 in conversation