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

 

Hello,

 

I have a project sas enterprise guide which I want to run two branchs. I have ten branchs.

Here is my code, but it does not work.

Can somebody help me please 

 

Thanks 

# Launch the application using the registered prog ID
$eguideApp = New-Object -comObject SASEGObjectModel.Application.7.1

$chemin = "C:\Users\Desktop\test.egp"

$project = $eguideApp.Open($chemin,"")

# Show all of the process flows in the project
$pfCollection = $project.ContainerCollection

$pf=$pfCollection.item("Connexion") # Connexion is name of my branch
Write-Host " first branch " $pf.Name
# To RUN a process flow, simply use $pf.Run()
$pf.Run()

$pf=$pfCollection.item("trim1") # trim1 is name of my branch
Write-Host " second branch " $pf.Name
# To RUN a process flow, simply use $pf.Run()
$pf.Run()

$project.Close()

$eguideApp.Quit()

 

1 ACCEPTED SOLUTION

Accepted Solutions
CaseySmith
SAS Employee

Hi @isek,

 

Your PowerShell script works fine for me -- it runs the two desired process flows.  (I used EG 7.15 HF8.)

 

Note: The script as written runs the two flows, but does not save the project, so you won't see any difference in your project.  If you want the results of the running of the process flows to be stored in the project, make sure to save the project in your script (ex. $project.Save()) before closing it.

 

Note 2: If you have 32-bit EG installed, make sure you are running the PowerShell script with the x86 version of PowerShell.  Similarly, if you have 64-bit EG installed, use the x64 version of PowerShell to run the script.

 

Casey


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

View now: on-demand content for SAS users

View solution in original post

3 REPLIES 3
CaseySmith
SAS Employee

Hi @isek,

 

Your PowerShell script works fine for me -- it runs the two desired process flows.  (I used EG 7.15 HF8.)

 

Note: The script as written runs the two flows, but does not save the project, so you won't see any difference in your project.  If you want the results of the running of the process flows to be stored in the project, make sure to save the project in your script (ex. $project.Save()) before closing it.

 

Note 2: If you have 32-bit EG installed, make sure you are running the PowerShell script with the x86 version of PowerShell.  Similarly, if you have 64-bit EG installed, use the x64 version of PowerShell to run the script.

 

Casey


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

View now: on-demand content for SAS users

isek
Obsidian | Level 7
Hello Casey,

Thank you for your answer. the projects are organized so that in a process flow I have several branches that correspond either to a quarterly monthly program ... and I wanted to execute only part of the branches. in digging I found that the execution was fessait either by process flow or project shot I reorganized my projects by process flow.

Isek
CaseySmith
SAS Employee

Hi Isek,

 

Yes, execution (via scripting) is by process flow, project, or individual items.  There isn't an easy way to run just a single branch in a process flow via the scripting interface.  I'm glad organizing by process flow allows you to accomplish your goal.

 

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
  • 3 replies
  • 1502 views
  • 1 like
  • 2 in conversation