Your SAS programs, embedded in web apps and elsewhere

Suppress %stpbegin and %stpend within DI Studio

Frequent Contributor
Posts: 95

Suppress %stpbegin and %stpend within DI Studio

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.

SAS Employee RMP
SAS Employee
Posts: 52

Suppress %stpbegin and %stpend within DI Studio


one possible solution would be to 'suppress' the STPBEGIN and STPEND macros in the Preprocess block of the DI Job. In the Preprocess block you could define two empty macros, for example  %MACRO STPBEGIN; %MEND STPBEGIN. This way the macros will still be called however no function will be performed. Might work. Not tested.



Frequent Contributor
Posts: 95

Re: Suppress %stpbegin and %stpend within DI Studio

Hi Richard,

Thanks for your suggestion. Tried it, but unfortunately it did not do the trick.

In the generated code the %stpbegin macro is put at the very beginning of the job code, before anything else.

The structure of the generated code is as follows:




* Job:             JOB_NAME                                A5U4WTEN.C00009MG *

* Description:                                                               *

*                                                                            *


* Version:         SAS Data Integration Studio 4.21                          *


/* General macro variables  */


/* Setup to capture return codes  */


/* initialize syserr to 0 */


/* Create metadata macro variables */


/* Set metadata options */


/* Setup for capturing job status  */


/*---- Start of Pre-Process Code  ----*/

%macro stpbegin ;

%mend ;

/*---- End of Pre-Process Code  ----*/

So even the pre-process code is ran after the "original" %stpbegin. But your idea did help me ... trying some things out atm

New Contributor
Posts: 2

Re: Suppress %stpbegin and %stpend within DI Studio

To overwrite %stpbegin and %stpend before `%stpbegin` runs, you need to add StoredProcess pre-processing code.

Open the Properties window of the job (with a richt click), select the Options tag, select the General options and scroll down.


There you can add

%macro stpbegin();

%macro stpend();
Ask a Question
Discussion stats
  • 3 replies
  • 3 in conversation