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

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Patrick
Opal | Level 21

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

5 REPLIES 5
TomKari
Onyx | Level 15

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

leonfox1
Calcite | Level 5

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!

Patrick
Opal | Level 21

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).

TomKari
Onyx | Level 15

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

leonfox1
Calcite | Level 5

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!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 5 replies
  • 4385 views
  • 3 likes
  • 3 in conversation