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.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 6 replies
  • 1136 views
  • 0 likes
  • 2 in conversation