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

Hi,

Final users have eg 7.1.

I know that when a prompt with multiple values is selected sas creates:

%let prompt = a;

%let prompt0=2;

%let prompt1=a;

%let prompt2=b;

 

Before setting the prompt values via VBS i need to add several parameters:

ValuePromp(0) = "a b c d e"

Set appSAS = CreateObject("SASEGObjectModel.Application.7.1")

Set prjObject = appSAS.Open(FullProgSAS,"")

Set ParmList = prjObject.Parameters

NumPar=ParmList.count

oFullNomeLog.write "Print NumPar " & NumPar & vbcrlf        ‘Print NumPar 7

NumCli_ = len(ValuePromp(0)) - len(replace(ValuePromp(0)," ",""))

NumCli = NumCli_ + 1

Dim Clients

Clients = Split(ValuePromp(0))

For i=0 to NumCli_

    oFullNomeLog.write "Print Value: " & Clients(i) & vbcrlf                        ‘Print Value: a

    oFullNomeLog.write "Print Par Name: prompt" & (i + 1) & vbcrlf           ‘Print Par Name: prompt1

    '' ParmList.Add Clients(i) ,"prompt" & (i + 1)                              'doesn't work

Next

 

But I can't manage to create those.

I'm missing something.

Do you have any idea?

Thank you in advance

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

I'll have to double-check but I don't think you can Add new prompts with the automation API.

 

However, since prompts turn into macro variables, you could submit the prompt/macro assignments by adding a new Code object to the CodeCollection, set code.Text to "%let newprompt=value;" or whatever you need, and then use code.Run. to submit.

Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.

View solution in original post

1 REPLY 1
ChrisHemedinger
Community Manager

I'll have to double-check but I don't think you can Add new prompts with the automation API.

 

However, since prompts turn into macro variables, you could submit the prompt/macro assignments by adding a new Code object to the CodeCollection, set code.Text to "%let newprompt=value;" or whatever you need, and then use code.Run. to submit.

Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1 reply
  • 574 views
  • 1 like
  • 2 in conversation