BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
alepage
Barite | Level 11

Hello,

 

I have getting the surveyid from a previous script (not included).

and I am able to execute the script below but, I am unable to replace the surveyID by it macro variable .

 

Does someone know how to do that ?

 

%let SurveyID=SV*************MwSAyrGK;

options set=SSLREQCERT="allow";
filename rsp temp;
proc http
url="https://ca1.qualtrics.com/API/v3/responseexports/"
method= "POST"
in='{"format" : "csv","surveyId" : "SV******QMwSAyrGK"}'
out=rsp;
 headers   
   'x-api-token'= &Api_Token.
   'Content-Type'='application/json';
run;
But I would like to replace the value of the surveyid by a macro variable for safety purpose and automation.

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hello @alepage,

 


@alepage wrote:

I am unable to replace the surveyID by it macro variable .


Because the single quotes prevent the resolution of &SurveyID? If so, use double quotes instead and duplicate the inner double quotes:

in="{""format"" : ""csv"",""surveyId"" : ""&SurveyID""}"

View solution in original post

1 REPLY 1
FreelanceReinh
Jade | Level 19

Hello @alepage,

 


@alepage wrote:

I am unable to replace the surveyID by it macro variable .


Because the single quotes prevent the resolution of &SurveyID? If so, use double quotes instead and duplicate the inner double quotes:

in="{""format"" : ""csv"",""surveyId"" : ""&SurveyID""}"

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register 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
  • 1042 views
  • 3 likes
  • 2 in conversation