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

Hi, all

I'm experimenting with a custom task framework that over several submissions will submit snippets of IML code.

The problem is that that when I submit the code "proc iml;" via a custom task, EG is adding a line of

;*';*";*/;quit;

at the end of the submission, which of course is exiting IML.

Does anyone know if there is a property or other element of the custom task toolkit that I can use to stop EG from submitting this additional code?

Thanks,

  Tom

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

Tom,

You cannot prevent EG from submitting this "epilogue" in the "traditional" task -- the kind where you let EG submit the code for you.

But you can build your own custom task that supports interactive-style processing by using the ISASTaskExecution API.  In that case, you don't return a SAS program for EG to run.  Instead, EG tells your task when it's ready and calls Run on it.  Within the Run method, you can use the SasSubmitter class to run your program and get the output.

If you're looking at my book, the Command Prompt task and Data Set->DATA Step task are examples of ISASTaskExecution.  The Macro Variable Viewer task has an example of using the SasSubmitter methods.

Chris

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

View solution in original post

6 REPLIES 6
Quentin
Super User

Would be nice to have an option to turn off EG adding this magic string.  Once or twice I've had an unmatched quote but didn't notice it right away because EG added the magic string, and the length of the quoted string wasn't long enough to trigger the 'you may have an unmatched quote' message. 

The magic string provides a level of protection to prevent people from mistakenly thinking their SAS session is hung when they submit code with an unmatched quote or forget to end a block comment.  But for those of us who are used to having that problem when we make a mistake in our code, it can be confusing when it doesn't happen.

BASUG is hosting free webinars Next up: Jane Eslinger presenting PROC REPORT and the ODS EXCEL destination on Mar 27 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
jakarman
Barite | Level 11

That code mustbe found in the EGuide installation (program files/SAShome). It sounds weird but SAS feared users could change all kind of things in a SAS installation (autoexec.sas config.sas) and wanting to prevent that moved that code into the Eguide software. When you can change your Eguide installation by yourself (not a closed desktop policy)  you can change that.24484 - How to automatically execute code when SAS® Enterprise Guide® opens  https://communities.sas.com/message/171219 

It is the same area of the autoeg.sas (4.1) location. When going around there I found nested structure of about 7 files being used at startup of the Eguide session/transaction.
There is code at the start (end?) of the session and of each transaction. Normally you will only see the transaction level (code start/end). 
The session-init will be seen in parallel code submission, this is long unwanted part of all that stuff. It is always present in activated logging of the WS but not many will see that.

It makes sense to not have that magic string submitted-code for experienced users  and getting more reliable code being stored for batch-processing (Quentin/TomK).

Wondering when ChrisH will come in.      

---->-- ja karman --<-----
TomKari
Onyx | Level 15

Hi, Jaap

I took a pretty good look around the EG flotsam and jetsam, but I couldn't find any indication that the ";*';*";*/;quit;" string is stored in any of those files. I suspect it's in the EG code itself.

However, if you know of a particular file that contains it, by all means let me know, and I'll dig into it!

Thanks,

  Tom

ChrisHemedinger
Community Manager

Tom,

You cannot prevent EG from submitting this "epilogue" in the "traditional" task -- the kind where you let EG submit the code for you.

But you can build your own custom task that supports interactive-style processing by using the ISASTaskExecution API.  In that case, you don't return a SAS program for EG to run.  Instead, EG tells your task when it's ready and calls Run on it.  Within the Run method, you can use the SasSubmitter class to run your program and get the output.

If you're looking at my book, the Command Prompt task and Data Set->DATA Step task are examples of ISASTaskExecution.  The Macro Variable Viewer task has an example of using the SasSubmitter methods.

Chris

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
TomKari
Onyx | Level 15

Thanks, Chris

I think (?!?) this is exactly what I'm after, although I'll have to get a little more adept with these concepts to know for sure.

Thanks for pointing me in the right direction!

  Tom

ChrisHemedinger
Community Manager

Sure thing Tom.  If you want a .NET test harness that supports interactive procedures, check out the SasHarness sample that I presented at SAS Global Forum a couple of years ago.

This app doesn't have the benefits of the SAS.Tasks.Toolkit helper classes, but you can play with some of the possibilities.

Chris

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

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
  • 6 replies
  • 1525 views
  • 3 likes
  • 4 in conversation