BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kibicrealu1
Fluorite | Level 6

In Excel I am executing a stored process that in last step creates a table in external database (Teradata):

data teradb.a;
set b;
run;

When this is executed, a new sheet in Excel with table contents is also created. How can I prevent this from happening? I just want teradb.a to be created, don't need a separate worksheet in Excel with it...

I execute stored process in vba using following code:

Dim SAS2 As SASExcelAddInSet SAS2 = Application.COMAddIns.Item("SAS.ExcelAddIn").Object
Dim streams As SASRangesSet streams = New SASRanges
Sheets("Entry Criteria").Range("J9").Clear
streams.Add "XcelData", Sheets("Entry Criteria").Range(Cells(4, "D"), Cells(25, "F"))
SAS2
.InsertStoredProcess "/system/UpdateParameters", Sheets("Entry Criteria").Range("J9"), , , streams

I was playing with ODS options or using proc sql with NOPRINT option, but this doesn't help. Would highly appreciate your suggestions!

1 ACCEPTED SOLUTION

Accepted Solutions
kibicrealu1
Fluorite | Level 6

Thanks Chris, that didn't work as well.

 

However, solution turned out to be in the Tools -> Options of SAS ribbon in Excel.

 

Unchecking "Open output data automatically" under "Output Data Sets" section in "Data" tab did the trick.

View solution in original post

6 REPLIES 6
ChrisNZ
Tourmaline | Level 20

What happens if you clear the libname at the end of the stored process?

kibicrealu1
Fluorite | Level 6

When I create dataset in work or any other SAS library I assigned during stored process execution everything works as intended - dataset is created, no additional info (apart from stored process status) is shown in Excel.

ChrisNZ
Tourmaline | Level 20

What happens if you clear the TERADB libname at the end of the stored process?

kibicrealu1
Fluorite | Level 6

Submitting 

libname TERADB clear;

 unfortunately has no impact.

Just a note (in case it is relevant here) - library is preassigned.

ChrisNZ
Tourmaline | Level 20

I am unsure what to do next really. One last idea: declare a new, user-defined,library.

I am just trying to prevent to process from accessing the data and copying it to Excel.

No idea if it's any useful but that's all I have.

libname TERADB2 (TERADB);
data TERADB2.A;
  set B;
run;
libname TERADB2 clear;

The fact that you request insertion in Excel makes the  not inserting when using a SAS library  the odd-looking behaviour.

 

 

 

kibicrealu1
Fluorite | Level 6

Thanks Chris, that didn't work as well.

 

However, solution turned out to be in the Tools -> Options of SAS ribbon in Excel.

 

Unchecking "Open output data automatically" under "Output Data Sets" section in "Data" tab did the trick.

CFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 4286 views
  • 0 likes
  • 2 in conversation