Desktop productivity for business analysts and programmers

Calling/Including a Process Flow (EG 4.3)

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

Calling/Including a Process Flow (EG 4.3)

Hi, I am using EG 4.3 and I am wondering if there is a way to write code that would call a process flow in the same EG project to run.  Does anyone have any ideas if this is possible?

As an example, if I have a project with 2 process flows, PF1 and PF2, I would like to write a program in PF1 that calls PF2 to run, similar to how a "%include" would work.  Any thoughts?

Thank you in advance!


Accepted Solutions
Solution
‎02-23-2014 12:53 AM
Respected Advisor
Posts: 3,823

Re: Calling/Including a Process Flow (EG 4.3)

If these are macros then you could also store them as .sas files somewhere on the file system (readable from the SAS Server where you run your EG project from) and then use options SASAUTOS during startup of your EG project.

http://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/viewer.htm#win-sysop-sasautos...

If these are more general macros: Same approach but you add the option to your the autoexec of the application server context (usermods autoexec).

View solution in original post


All Replies
Trusted Advisor
Posts: 1,050

Re: Calling/Including a Process Flow (EG 4.3)

Hi, Leon

Although it might be possible to develop something using the SAS developer facilities, I'd like to suggest that there might be a better way to accomplish your objectives using EG in a more "standard" way.

Instead of describing how you'd like to solve your problem, could you provide a few more details about what you're trying to do, and the community will probably have some thoughts.

Incidentally, you certainly can use the "%include" functionality in EG. I've done it many times.

Tom

New Contributor
Posts: 3

Re: Calling/Including a Process Flow (EG 4.3)

Thanks Tom.  I suppose I was a bit vague, probably because I have already thought of a few acceptable solutions, I think I am just searching for the best solution and/or a best practice to follow.  Here is a few details, any input you have would be appreciated:


I have a process flow devoted to general macros that I have written and want available to use in the project.  Here are some options I came up with:

1) Make that process flow an "autoexec" process and it will run every time the project is opened. The only downside is that the programs containing the macros would take 10-20 seconds to run every time the project is opened--not a big deal, so this may be the best solution.

2) "Publish" that process flow code by exporting all the code in that process flow to a SAS program.  Then, I could either "%include" that SAS program (if it is located outside of the project) or simply copy/paste that "Published" code into the process flow where I would like to call it.  The advantage to this method is that it shortens the amount of time needed to run the code and there is nothing running at start up, but the downside is that it requires an extra step.

3) Somehow add these macros into a personal library that will allow them to be available in all my SAS EG projects. The downside to this is that other users would need to have access to these, so this doesn't really solve my problem I suppose.

4) Somehow "%include" the SAS programs which contain my macros. I would like to do something like this, but I think "%include" only works for external SAS programs outside of the EG project.


I suppose I am just curious how other SAS developers handle these types of situations.  I would love to hear your input, even though it might seem like a silly question.  Thanks again!

Solution
‎02-23-2014 12:53 AM
Respected Advisor
Posts: 3,823

Re: Calling/Including a Process Flow (EG 4.3)

If these are macros then you could also store them as .sas files somewhere on the file system (readable from the SAS Server where you run your EG project from) and then use options SASAUTOS during startup of your EG project.

http://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/viewer.htm#win-sysop-sasautos...

If these are more general macros: Same approach but you add the option to your the autoexec of the application server context (usermods autoexec).

Trusted Advisor
Posts: 1,050

Re: Calling/Including a Process Flow (EG 4.3)

Very interesting!

No, it's not silly in the slightest, it's just a use case in EG that I hadn't seen previously. Now that you've explained it, your original question makes perfect sense.

While I was reading your reply, exactly the same suggestion that Patrick made was forming itself in my head. I think that's exactly the right approach for you to follow.

It might make it easier that EG has two program editor modes. The default one is that programs are stored within the EG project, but you can also use EG to edit external SAS programs. Just put your programs in to a directory, and then open them in EG. And then use the SASAUTOS option to have SAS reference them.

Good luck,

  Tom

New Contributor
Posts: 3

Re: Calling/Including a Process Flow (EG 4.3)

Tom & Patrick,

Thank you so much!  Both of your answers were very helpful and I sincerely appreciate it.  I wasn't aware of SASAUTOS--I am going to read up on this and attempt to implement.  Thanks again!

☑ This topic is SOLVED.

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

Discussion stats
  • 5 replies
  • 1434 views
  • 3 likes
  • 3 in conversation