I'm new to this concept and I was wondering if you could help me.
I have successfully used PROC HTTP to call data from a website. the problem is that I'm only able to call single Portfolio id each time (this is how the API is set up).
I was wondering if you could help me change this code to use hypothetical Table A column B values (all 150+ values) to feed into the below code as portfolio ids and eventually create a table with results from using these portfolio ids.
%let AccessKey =/*Enter Token id Here*/; %let Portfoli_id =/*Enter Portfolio id Here*/; proc http url="url/&Portfoli_id"
I've done something similar for posting to an API one at a time. Instead of using %let to set your variables, use data null with call symputx. You'll need a count variable to know how many times to loop. Use that count number to know which observation in your dataset to grab. Hope this is helpful.
/*After the dataset is created, figure out the count you'll need to loop through*/ data _null_;
/*compile APILoop macro*/
%do i=1 %to &cnt.;
/*Create needed variables you'll pass into the loop - one at a time*/
set table_A (firstobs=&i. obs=&i.);
/*Now you have the variables created to put into your proc http*/
/*insert code here*/
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.