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.

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!

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.

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 1 reply
  • 740 views
  • 1 like
  • 2 in conversation