Desktop productivity for business analysts and programmers

chain process flows ; loop

Reply
Regular Contributor
Posts: 163

chain process flows ; loop

Hi:
I am trying to automate something in EG. I have a process flow that starts up with a macro variable. I repeat this manually. I was wandering if I could create another process flow that will trigger another one and do some kind of a loop. any ideas?
Respected Advisor
Posts: 3,841

Re: chain process flows ; loop

Hi

One way would be to add a code node at the very beginning of your existing flow containing something like:

%macro LoopOverFlow(macrovar);

And then at the very end of your flow you add a second code node containing:

%mend;
data _null_;
input var $;
call execute('%LoopOverFlow('||var||')');
datalines;
abc
def
;
run;

And then just run the whole flow. Never tried it but that should let it loop.

HTH
Patrick
Community Manager
Posts: 2,712

Re: chain process flows ; loop

There isn't a way to chain process flows or represent a loop construct within SAS Enterprise Guide, at the moment.

Chris
Respected Advisor
Posts: 3,841

Re: chain process flows ; loop

Hi Chris

When I first read your answer I thought you're talking about some wizard generated loop construct.

I would have bet that my proposition works (just pack the whole flow in a macro and then execute the macro).

So I tried now with a very simple example - and yes, you're right, it didn't work when I ran the whole branch (EG 4.3).

That actually confused me quite a bit so I exported the whole branch and copied it into a single code node. And then I executed this code node and it worked. Hmmm...!!

Honestly, Chris! If you want EG to be a developer’s tool then you will have to have a developer mode added which basically means:
- Add NOTHING to the code written
- WYSIWYG in regards of code

I have currently to use EG for writing ETL processes which in the end are executed in batch.

The only thing which I prefer over using good old PC SAS is that I just can disconnect/reconnect if my code goes berserk and that it’s very easy to execute the same code in different environments/on different servers.

But besides of very basic unit testing EG is more of a hassle than a help.

I sure can’t use any of the wizards because as we know if I later on would like to export the code I will get heaps of EG “garbage” which might even not work in batch unless I tweak the config.

And now I even learn that an exported flow executed via EG doesn’t behave the same as the flow executed directly in EG. I think no further comment is needed here.

Sorry Chris for my tone. I’m just a bit frustrated in the moment.

I appreciate your commitment and contributions to make the SAS world a better place a lot.

Thanks
Patrick Message was edited by: Patrick
Trusted Advisor
Posts: 1,061

Re: chain process flows ; loop

Hi, guys

This brings up somewhat of a philosophical issue that I grapple with. As soon as I see "automate", I think SAS DIS. I generally think of EG as an adhoc analytics tool.

I'm not sure it's fair to criticize EG for not having "industrial" features that one would associate with a production line.

I'd be interested in the views of others who use EG and the other SAS tools.

Tom
Super Contributor
Posts: 356

Re: chain process flows ; loop

Fully Agree...

EG Adhoc analysis etc, DIS ETL automation.... Bring on the day that we can open EG project in DIS and convert, or be able to deploy eg jobs to DIS....

Barry
Respected Advisor
Posts: 3,841

Re: chain process flows ; loop

Yep, I fully agree.

EG is an analysts tool!

The only issue I have: It's now also promoted as a developers tool and therefore new SAS deployments don't even install PC SAS anymore (and not everybody got DIS).
Ask a Question
Discussion stats
  • 6 replies
  • 1588 views
  • 1 like
  • 5 in conversation