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
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.
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.
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.
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.
Ready to level-up your skills? Choose your own adventure.