BookmarkSubscribeRSS Feed
Ejaz
Calcite | Level 5

In my process flow in SAS EG, I am importing a CSV --> Filter the data through Query Builder --> Output in SAS Data Set

 

My agenda is to run it through .vbs as per mentioned in the post

https://communities.sas.com/t5/SAS-Communities-Library/Doing-More-with-SAS-Enterprise-Guide-Automati...

 

After running it, I want to export data in SAS Data Set to my destination folder (without using a program)

 

The example in above post do not execute/run the process flow and export the output in the folder.

Any helps please?

 

One more thing, can I run SAS EG process flow through CLI in Windows?

2 REPLIES 2
ChrisHemedinger
Community Manager

Adapting the BatchProject.vbs example, you should be able to do something like:

 

For n=0 to (sasProgram.OutputDatasets.Count -1)
  Dim dataName
  dataName = sasProgram.OutputDatasets.Item(n).Name
  sasProgram.OutputDatasets.Item(n).SaveAs _
    getCurrentDirectory & "\" & dataName & ".sas7bdat"
Next

And using script, you can also run individual process flows -- by name.  See how to address Flows in the ExtractCode.vbs example.

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
Ejaz
Calcite | Level 5

Thanks for your kind reply,

 

I don't know how to open my existing sasProgram as per your code. How can I load my .egp file and than set the variable sasProgram?

For n=0 to (sasProgram.OutputDatasets.Count -1)

Let me provide some details about my requirement in steps

Requirement: To execute an existing process flow and save its output through automation script

Steps to follow

1- Open .egp file

2- Click on Run Process Flow

    a) Loads data from CSV (Import Data) and create DataSet

    b) Perform one or more transformation on DataSet and generate result/final DataSet

3- Save the output tables data result/final (Sas Dataset) via export (or anything) on the disc

 

The program you are referring to, I have reviewed them. The BatchProject.vbs example does not open a project/sasProject

And, ExtractCode.vbs example does not execute the processflow and does not save the output of executed process flow.

 

Kindly help

 

 

 

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1528 views
  • 0 likes
  • 2 in conversation