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.

Become an Explorer! Join SAS Analytics Explorers to learn and complete challenges that earn rewards!

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.

Become an Explorer! Join SAS Analytics Explorers to learn and complete challenges that earn rewards!

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore Now →
Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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