BookmarkSubscribeRSS Feed
Resa
Pyrite | Level 9

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.

3 REPLIES 3
RMP
SAS Employee RMP
SAS Employee

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

Resa
Pyrite | Level 9

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

DirkH
Calcite | Level 5

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;

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!

How to Concatenate Values

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.

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