<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: proc http - loading one record per call in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-http-loading-one-record-per-call/m-p/875008#M42908</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile '/home/fkhurshed/CLASS2/example1.json';
length value $500.;
if mod(_n_, 3)=1 then record+1;
input;
value = _infile_;
run;



data clean;
set have;
by record;


name = catt('/home/fkhurshed/CLASS2/contact', put(record, 8. -l), '.json');
file dummy filevar=name ;

if last.record then value = substr(value, 1, length(value)-1);

put value;

if last.record then do;
str = '%import_json(record='|| trim(put(record, 8. -l)) || ', file=' || name || ');';
call execute(str);
end;

run;



%macro import_json(record= , file=);

filename mydata "&amp;amp;file";
libname myjson JSON fileref=mydata;

proc datasets lib=myjson; quit;

data want&amp;amp;record;
set myjson.alldata;
run;

filename mydata;
libname myjson;

%mend;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now change the %import_json macro to be your call API call/read.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tested and works for import.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 10 May 2023 15:59:32 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2023-05-10T15:59:32Z</dc:date>
    <item>
      <title>proc http - loading one record per call</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-http-loading-one-record-per-call/m-p/874718#M42887</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using a proc http procedure to upload a contact list via an api web site call.&lt;/P&gt;
&lt;P&gt;But the issue, I am facing is: it is like the api web site is not able to upload many contacts at the same time.&amp;nbsp; I have upload 10 contacts, one by one so, 10 proc http call.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%do j=1 %to 1 /*&amp;amp;cie_count.*/;
		    
			%chkifpathexist(dest&amp;amp;j.);
			%if &amp;amp;FEXIST. = 1 %then 
				%do;
					%put the pathname dest&amp;amp;j. exist;
					%put %sysfunc(quote(%sysfunc(pathname(dest&amp;amp;j.))));
					%put &amp;amp;&amp;amp;DirectoryId&amp;amp;j.;
					%put "uploading the consent information for the company : &amp;amp;&amp;amp;cie&amp;amp;j." ;

                     /* https://api.qualtrics.com/3f3d5290d19c2-create-directory-contact*/
					
					filename respp&amp;amp;j. "%sysfunc(getoption(WORK))/Consentinfo&amp;amp;j..json";
					PROC HTTP
						METHOD="POST"
    					URL= "&amp;amp;url_./directories/&amp;amp;&amp;amp;DirectoryId&amp;amp;j./contacts"
    					OUT=respp&amp;amp;j.
    					in=dest&amp;amp;j.;
    					headers
   						'x-api-token'= &amp;amp;Api_Token.
   						'Content-Type'='application/json';   
					run;
					
					libname respp&amp;amp;j. json "%sysfunc(getoption(WORK))/Consentinfo&amp;amp;j..json";
					proc datasets lib=respp&amp;amp;j.;
					run;

					data TrasactionContactsImportSummary&amp;amp;j.;
					set respp&amp;amp;j..alldata;
					run;

					data result&amp;amp;j.;
					set respp&amp;amp;j..result;
					call symputx("ContactId&amp;amp;j.",id,'g');
					run;
					%put "ContactId&amp;amp;j. = &amp;amp;&amp;amp;Contactid&amp;amp;j";
					%end;
					/* Number of Records per Minutes*/


				
			%else
				%do;
					%put the pathname does not exist;
				%end;
		%end;
	%end;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The sample json file look like that:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;{"firstName" :"Clint1", "lastName" :"Eastwood1", "email" :"Clint1.Eastwood1@hotmail.com", "extRef" :"AAAAA1",&lt;BR /&gt;"embeddedData" : { "Brand" :" Insurance", "Consent Date" :"15JUL2020:14:29:52",&lt;BR /&gt;"Dataset Creation Timestamp" :"28MAR2023:22:01:07.758540" }, "unsubscribed" :"true" },&lt;BR /&gt;{ "firstName" :"Clint2", "lastName" :"Eastwood2", "email" :"Clint2.Eastwood2@hotmail.com", "extRef" :"AAAAA2",&lt;BR /&gt;"embeddedData" : { "Brand" :" Insurance", "Consent Date" :"29AUG2022:08:25:57",&lt;BR /&gt;"Dataset Creation Timestamp" :"28MAR2023:22:01:07.758540" }, "unsubscribed" :"true" },&lt;BR /&gt;{ "firstName" :"Clint3", "lastName" :"Eastwood3", "email" :"Clint3.Eastwood3@hotmail.com", "extRef" :"AAAAA3",&lt;BR /&gt;"embeddedData" : { "Brand" :" Insurance", "Consent Date" :"29JUL2020:16:21:59",&lt;BR /&gt;"Dataset Creation Timestamp" :"28MAR2023:22:01:07.758540" }, "unsubscribed" :"true" },&lt;BR /&gt;{ "firstName" :"Clint4", "lastName" :"Eastwood4", "email" :"Clint4.Eastwood4@hotmail.com", "extRef" :"AAAAA4",&lt;BR /&gt;"embeddedData" : { "Brand" :" Insurance", "Consent Date" :"07NOV2019:04:24:10",&lt;BR /&gt;"Dataset Creation Timestamp" :"28MAR2023:22:01:07.758540" }, "unsubscribed" :"true" },&lt;BR /&gt;{ "firstName" :"Clint5", "lastName" :"Eastwood5", "email" :"Clint5.Eastwood5@hotmail.com", "extRef" :"AAAAA5",&lt;BR /&gt;"embeddedData" : { "Brand" :" Insurance", "Consent Date" :"14JUL2020:18:35:37",&lt;BR /&gt;"Dataset Creation Timestamp" :"28MAR2023:22:01:07.758540" }, "unsubscribed" :"true" },&lt;BR /&gt;{ "firstName" :"Clint6", "lastName" :"Eastwood6", "email" :"Clint6.Eastwood6@hotmail.com", "extRef" :"AAAAA6",&lt;BR /&gt;"embeddedData" : { "Brand" :" Insurance", "Consent Date" :"26JAN2022:17:13:50",&lt;BR /&gt;"Dataset Creation Timestamp" :"28MAR2023:22:01:07.758540" }, "unsubscribed" :"true" },&lt;BR /&gt;{ "firstName" :"Clint7", "lastName" :"Eastwood7", "email" :"Clint7.Eastwood7@hotmail.com", "extRef" :"AAAAA7",&lt;BR /&gt;"embeddedData" : { "Brand" :" Insurance", "Consent Date" :"13AUG2021:06:53:31",&lt;BR /&gt;"Dataset Creation Timestamp" :"28MAR2023:22:01:07.758540" }, "unsubscribed" :"true" },&lt;BR /&gt;{ "firstName" :"Clint8", "lastName" :"Eastwood8", "email" :"Clint8.Eastwood8@hotmail.com", "extRef" :"AAAAA8",&lt;BR /&gt;"embeddedData" : { "Brand" :" Insurance", "Consent Date" :"03FEB2021:14:02:29",&lt;BR /&gt;"Dataset Creation Timestamp" :"28MAR2023:22:01:07.758540" }, "unsubscribed" :"true" },&lt;BR /&gt;{ "firstName" :"Clint9", "lastName" :"Eastwood9", "email" :"Clint9.Eastwood9@hotmail.com", "extRef" :"AAAAA9",&lt;BR /&gt;"embeddedData" : { "Brand" :" Insurance", "Consent Date" :"24MAR2022:20:19:40",&lt;BR /&gt;"Dataset Creation Timestamp" :"28MAR2023:22:01:07.758540" }, "unsubscribed" :"true" },&lt;BR /&gt;{ "firstName" :"Clint10", "lastName" :"Eastwood10", "email" :"Clint10.Eastwood10@hotmail.com", "extRef" :"AAAA10",&lt;BR /&gt;"embeddedData" : { "Brand" :" Insurance", "Consent Date" :"14SEP2022:14:58:17",&lt;BR /&gt;"Dataset Creation Timestamp" :"28MAR2023:22:01:07.758540" }, "unsubscribed" :"true" }&lt;/PRE&gt;
&lt;P&gt;So, the issue I am facing here, it is like the API Web site is able to read only one record at the time and that per call.&amp;nbsp; So when a json file containing 10 records is sent, it take only the first records and forgot the&amp;nbsp; others.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have sent the ten records each individually, it works but I will need to make ten different json files.&lt;/P&gt;
&lt;P&gt;Is there a way to loop trough each record and make a call for each record.&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 17:55:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-http-loading-one-record-per-call/m-p/874718#M42887</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2023-05-09T17:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: proc http - loading one record per call</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-http-loading-one-record-per-call/m-p/874727#M42888</link>
      <description>Where's the source data coming from to create the JSON file? A SAS data set? One row per call?</description>
      <pubDate>Tue, 09 May 2023 18:55:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-http-loading-one-record-per-call/m-p/874727#M42888</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-05-09T18:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: proc http - loading one record per call</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-http-loading-one-record-per-call/m-p/874728#M42889</link>
      <description>&lt;P&gt;In that particular case, it comes from a sas dataset. So I wlll need to create one file per record. Is there a way to read the json file, one record at the time. ex:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Read the first record:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;{"firstName" :"Clint1", "lastName" :"Eastwood1", "email" :"Clint1.Eastwood1@hotmail.com", "extRef" :"AAAAA1",&lt;BR /&gt;"embeddedData" : { "Brand" :" Insurance", "Consent Date" :"15JUL2020:14:29:52",&lt;BR /&gt;"Dataset Creation Timestamp" :"28MAR2023:22:01:07.758540" }, "unsubscribed" :"true" }&lt;/PRE&gt;
&lt;P&gt;and make the proc http call&lt;/P&gt;
&lt;P&gt;Read the second record:&lt;/P&gt;
&lt;PRE&gt;{ "firstName" :"Clint2", "lastName" :"Eastwood2", "email" :"Clint2.Eastwood2@hotmail.com", "extRef" :"AAAAA2",&lt;BR /&gt;"embeddedData" : { "Brand" :" Insurance", "Consent Date" :"29AUG2022:08:25:57",&lt;BR /&gt;"Dataset Creation Timestamp" :"28MAR2023:22:01:07.758540" }, "unsubscribed" :"true" }&lt;/PRE&gt;
&lt;P&gt;and make the proc http call&amp;nbsp; and so on until record 10 ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 19:01:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-http-loading-one-record-per-call/m-p/874728#M42889</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2023-05-09T19:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: proc http - loading one record per call</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-http-loading-one-record-per-call/m-p/874729#M42890</link>
      <description>Of course. How do you create the JSON datafile from the SAS data set?&lt;BR /&gt;&lt;BR /&gt;Basically write a macro that you use CALL EXECUTE to operate on every single row.</description>
      <pubDate>Tue, 09 May 2023 19:24:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-http-loading-one-record-per-call/m-p/874729#M42890</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-05-09T19:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: proc http - loading one record per call</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-http-loading-one-record-per-call/m-p/874732#M42891</link>
      <description>&lt;P&gt;Imagine that my json file is saved on the server as below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;{ "firstName" :"Clint1", "lastName" :"Eastwood1", "email" :"Clint1.Eastwood1@hotmail.com", "extRef" :"235987",&lt;BR /&gt;"embeddedData" : { "Brand" :"Anthony Insurance", "Consent Date" :"15JUL2020:14:29:52",&lt;BR /&gt;"Dataset Creation Timestamp" :"28MAR2023:22:01:07.758540" }, "unsubscribed" :"true" },&lt;BR /&gt;{ "firstName" :"Clint2", "lastName" :"Eastwood2", "email" :"Clint2.Eastwood2@hotmail.com", "extRef" :"236663",&lt;BR /&gt;"embeddedData" : { "Brand" :"Anthony Insurance", "Consent Date" :"29AUG2022:08:25:57",&lt;BR /&gt;"Dataset Creation Timestamp" :"28MAR2023:22:01:07.758540" }, "unsubscribed" :"true" }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From that point, could you provide an example how to make the http call below but that with each record:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;filename respp&amp;amp;j. "%sysfunc(getoption(WORK))/Consentinfo&amp;amp;j..json";&lt;BR /&gt;PROC HTTP&lt;BR /&gt;METHOD="POST"&lt;BR /&gt;URL= "&amp;amp;url_./directories/&amp;amp;&amp;amp;DirectoryId&amp;amp;j./contacts"&lt;BR /&gt;OUT=respp&amp;amp;j.&lt;BR /&gt;in=dest&amp;amp;j.;&lt;BR /&gt;headers&lt;BR /&gt;'x-api-token'= &amp;amp;Api_Token.&lt;BR /&gt;'Content-Type'='application/json'; &lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;libname respp&amp;amp;j. json "%sysfunc(getoption(WORK))/Consentinfo&amp;amp;j..json";&lt;BR /&gt;proc datasets lib=respp&amp;amp;j.;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data TrasactionContactsImportSummary&amp;amp;j.;&lt;BR /&gt;set respp&amp;amp;j..alldata;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data result&amp;amp;j.;&lt;BR /&gt;set respp&amp;amp;j..result;&lt;BR /&gt;call symputx("ContactId&amp;amp;j.",id,'g');&lt;BR /&gt;run;&lt;BR /&gt;%put "ContactId&amp;amp;j. = &amp;amp;&amp;amp;Contactid&amp;amp;j";&lt;BR /&gt;%end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where the json file :&amp;nbsp;Consentinfo&amp;amp;j..json contains the two records&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 19:35:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-http-loading-one-record-per-call/m-p/874732#M42891</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2023-05-09T19:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: proc http - loading one record per call</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-http-loading-one-record-per-call/m-p/874735#M42892</link>
      <description>How did that big JSON file get created initially? I'm suggesting you back up a step and create a single file for each record, assuming your data source is a SAS data set. This will ensure that the file is created properly each time. Alternatively, you would read in the JSOn and then parse it line by line....but the first way is easier for sure.</description>
      <pubDate>Tue, 09 May 2023 19:56:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-http-loading-one-record-per-call/m-p/874735#M42892</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-05-09T19:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: proc http - loading one record per call</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-http-loading-one-record-per-call/m-p/874744#M42893</link>
      <description>Also, that JSON doesn't pass a JSON lint so not sure if that's why it's only reading the first record...</description>
      <pubDate>Tue, 09 May 2023 20:38:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-http-loading-one-record-per-call/m-p/874744#M42893</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-05-09T20:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: proc http - loading one record per call</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-http-loading-one-record-per-call/m-p/875008#M42908</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile '/home/fkhurshed/CLASS2/example1.json';
length value $500.;
if mod(_n_, 3)=1 then record+1;
input;
value = _infile_;
run;



data clean;
set have;
by record;


name = catt('/home/fkhurshed/CLASS2/contact', put(record, 8. -l), '.json');
file dummy filevar=name ;

if last.record then value = substr(value, 1, length(value)-1);

put value;

if last.record then do;
str = '%import_json(record='|| trim(put(record, 8. -l)) || ', file=' || name || ');';
call execute(str);
end;

run;



%macro import_json(record= , file=);

filename mydata "&amp;amp;file";
libname myjson JSON fileref=mydata;

proc datasets lib=myjson; quit;

data want&amp;amp;record;
set myjson.alldata;
run;

filename mydata;
libname myjson;

%mend;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now change the %import_json macro to be your call API call/read.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tested and works for import.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 15:59:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-http-loading-one-record-per-call/m-p/875008#M42908</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-05-10T15:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: proc http - loading one record per call</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-http-loading-one-record-per-call/m-p/875209#M42927</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%do j=1 %to &amp;amp;cie_count.;
		    
			%chkifpathexist(dest&amp;amp;j.);
			%if &amp;amp;FEXIST. = 1 %then 
				%do;
					%put the pathname dest&amp;amp;j. exist;
					%put %sysfunc(quote(%sysfunc(pathname(dest&amp;amp;j.))));
					%put &amp;amp;&amp;amp;DirectoryId&amp;amp;j.;
					%put "uploading the consent information for the company : &amp;amp;&amp;amp;cie&amp;amp;j." ;
                    /* Getting the number of observations in each brand, i.e.
					   j=1, Anthony Insurance, j=2 NBI, j=3 Belairdirect, j=4 intact
					   AIcnt NBIcnt BDcnt Intcnt */

					%if &amp;amp;j=1       %then %let limitmax= &amp;amp;AIcnt.;
					%else %if &amp;amp;j=2 %then %let limitmax= &amp;amp;NBIcnt.;
					%else %if &amp;amp;j=3 %then %let limitmax= &amp;amp;BDcnt.;
					%else %if &amp;amp;j=4 %then %let limitmax= &amp;amp;Intcnt.;

					%put The number of observations in &amp;amp;&amp;amp;cie&amp;amp;j. is : &amp;amp;=limitmax.;

					/* Putting the proc http into a macro function*/

					%macro upload_json(i,j,directoryId,record);
					
					/* call example: %upload_json(i,j,directoryId,record); where i is equal to _n_ into the dataset
   					j is an index for the brand, directoryId=&amp;amp;&amp;amp;DirectoryId&amp;amp;j. and record is a field into the dataset
					https://api.qualtrics.com/3f3d5290d19c2-create-directory-contact
					*/
                    					
					filename res&amp;amp;i. "%sysfunc(getoption(WORK))/Consentinfo&amp;amp;i..json";

					PROC HTTP
						METHOD="POST"
    					URL= "&amp;amp;url_./directories/&amp;amp;directoryId./contacts"
    					OUT=res&amp;amp;i.
    					in=&amp;amp;record.;
    					headers
   						'x-api-token'= &amp;amp;Api_Token.
   						'Content-Type'='application/json';   
					run;

					libname res&amp;amp;i. json "%sysfunc(getoption(WORK))/Consentinfo&amp;amp;i..json";

					proc datasets lib=res&amp;amp;i.;
					run;

                    /* TxnCtxImpSmry= TransactionContactsImportSummary */

					data TxnCtxImpSmry&amp;amp;i.;
					set res&amp;amp;i..alldata;
					run;

					data result&amp;amp;i.;
					set res&amp;amp;i..result;
                    call symputx("ContactId&amp;amp;i.",id,'g');				
					run;
					%put Contactid&amp;amp;i equal &amp;amp;&amp;amp;ContactId&amp;amp;i.;

					proc datasets library=res&amp;amp;i. nolist;
					delete TxnCtxImpSmry&amp;amp;i. result&amp;amp;i.;
					quit;

					libname res&amp;amp;i clear;

					data _null_;
					rc=fdelete("res&amp;amp;i.");
					run;
                  
					proc datasets library=work nolist;
					delete TxnCtxImpSmry&amp;amp;i. result&amp;amp;i.;
					quit;
               
					%mend upload_json;

					/* Now reading the dataset line by line, putting the information into 
					   the variable record, the sending the information to Qualtrics */
                   
					
                    	Data ConsentInfo&amp;amp;j.;
						length record $2048;
						set info_1 ;
						where brand = "&amp;amp;&amp;amp;cie&amp;amp;j.";
						i=_n_;
						record=cats("'", '{ "firstName" : ',' "',firstName,'", ',' "lastName" : ','"',lastName,'", ','"email" :',
                        '"',email,'", ','"extRef" :','"',extRef,'", ','"embeddedData" : ','{ "Brand" :','"',Brand,'", ',
                        '"Consent Date" :','"',put(CONSENT_DT,datetime18.),'" ,','"Dataset Creation Timestamp" :',
                        '"',put(DW_CREATION_TS,datetime21.6),'" },','"unsubscribed" :','"',unsubscribed,'" }',"'");
                        call symputx('NewRecord',record,'g');	
						run;
                        
						/****** Executing record by record ******/
						
						Data _null_;
						length str $ 2048;
						set ConsentInfo&amp;amp;j.;
						call symputx('NewRecord',record,'g');
                        str=cats('%nrstr(%upload_json(',i,',',%NRSTR("&amp;amp;j."),',',%NRSTR("&amp;amp;&amp;amp;DirectoryId&amp;amp;j."),',',%NRSTR("&amp;amp;NewRecord."),'));');
						call symputx('str',str,'g');                  	
                        %put &amp;amp;=j &amp;amp;=NewRecord &amp;amp;&amp;amp;DirectoryId&amp;amp;j &amp;amp;=str.;
						call execute(str);
						run;	
				%end;				
			%else
				%do;
					%put the pathname does not exist;
				%end;
		%end;/* do j statement*/&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here's my SAS code and it works.&amp;nbsp; But I wonder if there is a nice way to gather in a dataset the values of&amp;nbsp;&lt;CODE class=" language-sas"&gt;%put Contactid&amp;amp;i equal &amp;amp;&amp;amp;ContactId&amp;amp;i.;&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 14:17:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-http-loading-one-record-per-call/m-p/875209#M42927</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2023-05-11T14:17:32Z</dc:date>
    </item>
  </channel>
</rss>

