SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Suppress %stpbegin and %stpend within DI Studio (cross-post)

Reply
Frequent Contributor
Posts: 84

Suppress %stpbegin and %stpend within DI Studio (cross-post)

I initially posted my question in the SAS Stored Processes forums, however this forum might be a better place for it.

Please find below a "copy" of my question.

I am faced with the situation where a customer has created a Stored Process from a job inside DI Studio (version 4.21).

The final step in this job is that data is "exported" to a .csv file using a data _null_ step and the file _webout statement.

A similar solution has been implemented at this customer from within Enterprise Guide.

When a Stored Process is created from within Enterprise Guide this solution works since it is possible to suppres the implementation of the %stpbegin and %stpend macros.

When the Stored Process is created inside DI Studio I could not find how this can be suppressed resulting in the fact that these macros are automatically added.

Result is that when this Stored Process is run from within the SAS Portal we are faced with the error that the file _webout is in use as described in Usage Note 13599.

So my question:

Is it possible (just as in Enterprise Guide) to suppress the addition of the %stpbegin and %stpend macro when a Stored Process is generated from a job inside DI Studio?

NOTE: For now we "workaround" the issue by manually editing the generated SAS code with a text editor and remove both macros from the code.

Respected Advisor
Posts: 3,896

Suppress %stpbegin and %stpend within DI Studio (cross-post)

What if you just overlay the macros?

Not sure if this works. It depends if job pre-code is added before or after %stpbegin is called and if the macro catalog in work is used before the one where %stpbegin lives.

In case both conditions are met then you could simple define 2 empty shell macros as job pre-code:

%macro stpbegin;

%mend;

%macro stpend;

%mend;

Bit dirty and there might be a better solution - but may be this works.

Frequent Contributor
Posts: 84

Re: Suppress %stpbegin and %stpend within DI Studio (cross-post)

Thanks for your input and sorry for not reacting sooner.

A similar suggestion was made in my first post in the Stored Process section.

Your suggestion will not work since %stpbegin is put way at the beginning of the code as you can see in my reply here

SAS Employee
Posts: 36

Suppress %stpbegin and %stpend within DI Studio (cross-post)

If you deploy to a workspace server instead of a stored process server those macros will be commented out.  When using the stored process wizard, just select a workspace server instead.

Another option if you just want the job code without anything around it, is to select deploy for scheduling, which will generate the job code and put the code into a directory of your choice.

Finally, if you want to just generate the code, in DI Studio 4.3 that shipped with 9.3, there is a command line feature that lets you deploy a job from a command line.  It will also just generate the job code and place it in a directory for you.

Hope this helps.

Frequent Contributor
Posts: 84

Re: Suppress %stpbegin and %stpend within DI Studio (cross-post)

Thank you for your suggestions, I will test your options and get back to you with the results.

Frequent Contributor
Posts: 84

Re: Suppress %stpbegin and %stpend within DI Studio (cross-post)

Hi nar@sas,

What I should have known but what did not spring to mind when posting my first reply is the fact that we need streaming output.

As such changing over to a workspace server is (unfortunately) not an option.

The current workaround we have/use is to edit the code generated with the stored process and simply manually comment out the two macros.

However an option that would prevent us from manually editing the code would of course be preferred

Ask a Question
Discussion stats
  • 5 replies
  • 273 views
  • 0 likes
  • 3 in conversation