BookmarkSubscribeRSS Feed
Resa
Pyrite | Level 9

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.

5 REPLIES 5
Patrick
Opal | Level 21

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.

Resa
Pyrite | Level 9

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

nar_sas
SAS Employee

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.

Resa
Pyrite | Level 9

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

Resa
Pyrite | Level 9

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

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 connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1006 views
  • 0 likes
  • 3 in conversation