<?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: LOOP on PROC execution in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/LOOP-on-PROC-execution/m-p/509109#M1737</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/199490"&gt;@HGimenez&lt;/a&gt;: Great that DOSUBL works for you (really without a semicolon&amp;nbsp;after the PROC SOAP statement?). Honestly, I'm not familiar with PROC SOAP. When I quickly tested my suggestion last night I used PROC EXPORT (creating a dummy file&amp;nbsp;&lt;SPAN&gt;response.xml) instead, but for some reason my SAS session didn't like it and crashed. Therefore, I didn't recommend DOSUBL wholeheartedly (without further testing). But I used DOSUBL repeatedly and successfully in a big project where it called a macro containing DATA and PROC steps. So, I knew that it should work in principle.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 31 Oct 2018 14:03:05 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2018-10-31T14:03:05Z</dc:date>
    <item>
      <title>LOOP on PROC execution</title>
      <link>https://communities.sas.com/t5/New-SAS-User/LOOP-on-PROC-execution/m-p/508948#M1710</link>
      <description>&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to loop on a PROC execution. Is it possible? I can do a loop inside a data step, but I cannot call a PROC inside a data step since -as far as I know&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to call a PROC SOAP, which sometimes works and sometimes returns and empty file. I want to keep executing the PROC SOAP until the response has more than zero bytes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to do something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;filesize = 0;&lt;/P&gt;&lt;P&gt;do while (filesize = 0)&lt;/P&gt;&lt;P&gt;PROC SOAP&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in='c:\temp\request.xml'&amp;nbsp;out='c:\temp\response.xml'&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;url='&lt;A href="http://some.web.service" target="_blank"&gt;http://some.web.service&lt;/A&gt;'&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;soapaction='&lt;A href="http://some.soap.action" target="_blank"&gt;http://some.soap.action&lt;/A&gt;';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;run;&lt;/P&gt;&lt;P&gt;rc = filename ('req', 'C:\temp\response.xml');&lt;BR /&gt;fid = fopen ('req');&lt;BR /&gt;infoname = foptname (fid, 4);&lt;BR /&gt;filesize = finfo(fid, infoname);&lt;/P&gt;&lt;P&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know how to solve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 21:57:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/LOOP-on-PROC-execution/m-p/508948#M1710</guid>
      <dc:creator>HGimenez</dc:creator>
      <dc:date>2018-10-30T21:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: LOOP on PROC execution</title>
      <link>https://communities.sas.com/t5/New-SAS-User/LOOP-on-PROC-execution/m-p/508954#M1711</link>
      <description>&lt;P&gt;You can't run a SAS procedure inside a DATA step. PROC SOAP will need to be moved prior to the DATA step, then most likely you will need to use macro code to do the looping. You could possibly do the file checking in macro as well but might be easier to stick with the DATA step if you are not familiar with the macro function %SYSFUNC.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 22:12:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/LOOP-on-PROC-execution/m-p/508954#M1711</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-10-30T22:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: LOOP on PROC execution</title>
      <link>https://communities.sas.com/t5/New-SAS-User/LOOP-on-PROC-execution/m-p/508957#M1712</link>
      <description>&lt;P&gt;Your best bet is probably to put the Proc call inside a macro with a %do %until construct. You can see an example of %do %until here &lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000543770.htm&amp;nbsp;" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000543770.htm&amp;nbsp;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 22:15:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/LOOP-on-PROC-execution/m-p/508957#M1712</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2018-10-30T22:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: LOOP on PROC execution</title>
      <link>https://communities.sas.com/t5/New-SAS-User/LOOP-on-PROC-execution/m-p/508975#M1716</link>
      <description>&lt;P&gt;The &lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p09dcftd1xxg1kn1brnjyc0q93yk.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;DOSUBL function&lt;/A&gt; might be another option. It can execute SAS code (e.g. a macro containing several DATA and PROC steps) from within a DATA step. However, in your case I'd prefer a macro solution as has been suggested.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 23:38:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/LOOP-on-PROC-execution/m-p/508975#M1716</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-10-30T23:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: LOOP on PROC execution</title>
      <link>https://communities.sas.com/t5/New-SAS-User/LOOP-on-PROC-execution/m-p/509079#M1731</link>
      <description>&lt;P&gt;Thanks Chris. I think I am almost there, but the code is not working.&amp;nbsp;Should I use %sysfunc to call PROC SOAP? Is that possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	&lt;BR /&gt;/* not working */&lt;BR /&gt;&lt;BR /&gt;%local rc fid fidc;
	%local Bytes CreateDT ModifyDT;
	%do %until(&amp;amp;Bytes &amp;gt; 0);
		PROC SOAP
			in=reqFile
			out=respFile
   			url=&amp;amp;url
			soapaction=&amp;amp;soapAction;
			RUN;
		%let rc=%sysfunc(filename(onefile,&amp;amp;webServicesResponseFile));
		%let fid=%sysfunc(fopen(&amp;amp;onefile));
		%let Bytes=%sysfunc(finfo(&amp;amp;fid,File Size (bytes)));
		%let fidc=%sysfunc(fclose(&amp;amp;fid));
		%let rc=%sysfunc(filename(onefile));
		%put NOTE: File size of &amp;amp;filename is &amp;amp;Bytes bytes;
		%end;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 12:36:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/LOOP-on-PROC-execution/m-p/509079#M1731</guid>
      <dc:creator>HGimenez</dc:creator>
      <dc:date>2018-10-31T12:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: LOOP on PROC execution</title>
      <link>https://communities.sas.com/t5/New-SAS-User/LOOP-on-PROC-execution/m-p/509081#M1732</link>
      <description>&lt;P&gt;Thanks Reinhard! It looks like this is working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code snippet&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA _null_;
	responseFileSize = 0;
	do while (responseFileSize = 0);
		rc = DOSUBL("PROC SOAP in=reqFile out=respFile url=&amp;amp;url soapaction=&amp;amp;soapAction");
		fid=fopen('respFile');
		infoname = foptname(fid, 4); 
  		responseFileSize = finfo(fid,infoname); 
		fid = fclose('respFile');
		end;
	run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 31 Oct 2018 12:38:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/LOOP-on-PROC-execution/m-p/509081#M1732</guid>
      <dc:creator>HGimenez</dc:creator>
      <dc:date>2018-10-31T12:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: LOOP on PROC execution</title>
      <link>https://communities.sas.com/t5/New-SAS-User/LOOP-on-PROC-execution/m-p/509109#M1737</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/199490"&gt;@HGimenez&lt;/a&gt;: Great that DOSUBL works for you (really without a semicolon&amp;nbsp;after the PROC SOAP statement?). Honestly, I'm not familiar with PROC SOAP. When I quickly tested my suggestion last night I used PROC EXPORT (creating a dummy file&amp;nbsp;&lt;SPAN&gt;response.xml) instead, but for some reason my SAS session didn't like it and crashed. Therefore, I didn't recommend DOSUBL wholeheartedly (without further testing). But I used DOSUBL repeatedly and successfully in a big project where it called a macro containing DATA and PROC steps. So, I knew that it should work in principle.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 14:03:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/LOOP-on-PROC-execution/m-p/509109#M1737</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-10-31T14:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: LOOP on PROC execution</title>
      <link>https://communities.sas.com/t5/New-SAS-User/LOOP-on-PROC-execution/m-p/509369#M1774</link>
      <description>&lt;P&gt;No, you only use %sysfunc with functions, not procedures.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Without seeing the log it's difficult to know exactly where your problem lies. If you still want to try this method could you post a copy of your log.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 22:38:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/LOOP-on-PROC-execution/m-p/509369#M1774</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2018-10-31T22:38:46Z</dc:date>
    </item>
  </channel>
</rss>

