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.
Resa,
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.
Cheers,
Richard
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:
*ProcessBody;
%stpbegin;
/******************************************************************************
* Job: JOB_NAME A5U4WTEN.C00009MG *
* Description: *
* *
<snip>
* Version: SAS Data Integration Studio 4.21 *
******************************************************************************/
/* General macro variables */
<snip>
/* Setup to capture return codes */
<snip>
/* initialize syserr to 0 */
<snip>
/* Create metadata macro variables */
<snip>
/* Set metadata options */
<snip>
/* Setup for capturing job status */
<snip>
/*---- 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
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();
%mend;
%macro stpend();
%mend;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: