<?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: Use SAS macro to generate multiple output files for the same number of input files in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621828#M182863</link>
    <description>&lt;P&gt;what if you run this&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;rsubmit;

data S1; set F3; if obs&amp;lt;=2000; run;

endrsubmit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 03 Feb 2020 01:15:48 GMT</pubDate>
    <dc:creator>fdsaaaa</dc:creator>
    <dc:date>2020-02-03T01:15:48Z</dc:date>
    <item>
      <title>Use SAS macro to generate multiple output files for the same number of input files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621811#M182853</link>
      <description>&lt;P&gt;Dear Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to run the following codes for 31 files including S1 to S31 and want to get 21 output files including O1 to O31. I highlighted the locations of both input and output files in the code. I know I should use macro to perform the job. Could you please suggest me how should I write the macro code to solve the problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc nlp noprint data=&lt;STRONG&gt;S1&lt;/STRONG&gt; absgconv=1e-15 OUTEST=T1; by obs;&lt;BR /&gt;bounds R&amp;gt;=0, R&amp;lt;=1;&lt;BR /&gt;min f;&lt;BR /&gt;decvar R=1;&lt;BR /&gt;f = abs(PRC1_IBES-(BVPS1_1+(((FEPS1_1/BVPS1_1_1)-R)/(1+R))*BVPS1_1&lt;BR /&gt;+(((FEPS2_1/BVPS2_1_1)-R)/((1+R)**2))*BVPS1_1_1&lt;BR /&gt;+(((FEPS3_1/BVPS3_1_1)-R)/((1+R)**3))*BVPS2_1_1&lt;BR /&gt;+(((FEPS4_1/BVPS4_1_1)-R)/((1+R)**4))*BVPS3_1_1&lt;BR /&gt;+(((FEPS5_1/BVPS5_1_1)-R)/((1+R)**5))*BVPS4_1_1&lt;BR /&gt;+(((FEPS6_1/BVPS6_1_1)-R)/((1+R)**6))*BVPS5_1_1&lt;BR /&gt;+(((FEPS7_1/BVPS7_1_1)-R)/((1+R)**7))*BVPS6_1_1&lt;BR /&gt;+(((FEPS8_1/BVPS8_1_1)-R)/((1+R)**8))*BVPS7_1_1&lt;BR /&gt;+(((FEPS9_1/BVPS9_1_1)-R)/((1+R)**9))*BVPS8_1_1&lt;BR /&gt;+(((FEPS10_1/BVPS10_1_1)-R)/((1+R)**10))*BVPS9_1_1&lt;BR /&gt;+(((FEPS11_1/BVPS11_1_1)-R)/((1+R)**11))*BVPS10_1_1&lt;BR /&gt;+(((FEPS12_1/BVPS12_1_1)-R)/(R*(1+R)**11))*BVPS11_1_1));&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data T1; set T1;&lt;BR /&gt;if _TYPE_='PARMS';&lt;BR /&gt;rename R=rgls1_1_1;&lt;BR /&gt;keep obs R; run;&lt;BR /&gt;data &lt;STRONG&gt;O1&lt;/STRONG&gt;; merge S1 (in=xx) T1(in=yy); by obs; if xx and yy; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate your help.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Feb 2020 22:10:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621811#M182853</guid>
      <dc:creator>nazmul</dc:creator>
      <dc:date>2020-02-02T22:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Use SAS macro to generate multiple output files for the same number of input files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621812#M182854</link>
      <description>&lt;P&gt;Without sample data, there's not much we can do to help with your specific need..&lt;/P&gt;
&lt;P&gt;Here's an outline of an approach to solve your problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create your input data (INSETS):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*Number of datasets;
%let num_dsets=31;
*No sample data -- create 31 INSETS;

data _null_;
	do i=1 to &amp;amp;num_dsets;
		num=put(i, z2.);
		call execute(cats('data INSET_', num, ';', 
			'NONSENSE = "Hello from Dataset #', num, '";', 'RAND_NUM = ranuni(', i, 
			');', 'run;'));
	end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Write macro to do what you want with each INSET:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*Write macro to do something;

%macro dosomething(dsin=, num=);
	data OUTSET_&amp;amp;num.;
		set &amp;amp;dsin.;
		OTHER_NONSENSE=cats("Hello from Macro (where inset =", &amp;amp;num., ")");
	run;

%mend;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Apply macro on each INSET using a data _null_ step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*Run macro on all INSETS;

data _null_;
	do i=1 to &amp;amp;num_dsets;
		num=put(i, z2.);
		call execute(cats('%dosomething(dsin=INSET_', num, ',num=', num, ')'));
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Combine your outputs how you wish:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*Combine results;

data combined;
	set work.outset:;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Feb 2020 22:41:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621812#M182854</guid>
      <dc:creator>unison</dc:creator>
      <dc:date>2020-02-02T22:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: Use SAS macro to generate multiple output files for the same number of input files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621821#M182856</link>
      <description>&lt;PRE&gt;%macro rtm(i=32);
proc nlp noprint data=S&amp;amp;i absgconv=1e-15 OUTEST=T1; by obs;
bounds R&amp;gt;=0, R&amp;lt;=1;
min f;
decvar R=1;
f = abs(PRC1_IBES-(BVPS1_1+(((FEPS1_1/BVPS1_1_1)-R)/(1+R))*BVPS1_1
+(((FEPS2_1/BVPS2_1_1)-R)/((1+R)**2))*BVPS1_1_1
+(((FEPS3_1/BVPS3_1_1)-R)/((1+R)**3))*BVPS2_1_1
+(((FEPS4_1/BVPS4_1_1)-R)/((1+R)**4))*BVPS3_1_1
+(((FEPS5_1/BVPS5_1_1)-R)/((1+R)**5))*BVPS4_1_1
+(((FEPS6_1/BVPS6_1_1)-R)/((1+R)**6))*BVPS5_1_1
+(((FEPS7_1/BVPS7_1_1)-R)/((1+R)**7))*BVPS6_1_1
+(((FEPS8_1/BVPS8_1_1)-R)/((1+R)**8))*BVPS7_1_1
+(((FEPS9_1/BVPS9_1_1)-R)/((1+R)**9))*BVPS8_1_1
+(((FEPS10_1/BVPS10_1_1)-R)/((1+R)**10))*BVPS9_1_1
+(((FEPS11_1/BVPS11_1_1)-R)/((1+R)**11))*BVPS10_1_1
+(((FEPS12_1/BVPS12_1_1)-R)/(R*(1+R)**11))*BVPS11_1_1));
run;
data T1; set T1;
if _TYPE_='PARMS';
rename R=rgls1_1_1;
keep obs R; run;
data O&amp;amp;i; merge S&amp;amp;i (in=xx) T1(in=yy); by obs; if xx and yy; run;
%mend rtm;
%rtm(i=31);&lt;/PRE&gt;</description>
      <pubDate>Sun, 02 Feb 2020 23:47:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621821#M182856</guid>
      <dc:creator>fdsaaaa</dc:creator>
      <dc:date>2020-02-02T23:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: Use SAS macro to generate multiple output files for the same number of input files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621822#M182857</link>
      <description>&lt;P&gt;Thank you for your kind help. Your code itself works perfectly. I followed your code to modify my one. However, it does not work. Could you please check? I highly appreciate your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rsubmit;&lt;BR /&gt;%let num_dsets=3;&lt;BR /&gt;data Inset_01; set F3; if obs&amp;lt;=2000; run;&lt;BR /&gt;data Inset_02; set F3; if 2000&amp;lt;obs&amp;lt;=4000; run;&lt;BR /&gt;data Inset_03; set F3; if 4000&amp;lt;obs&amp;lt;=6000; run;&lt;/P&gt;&lt;P&gt;%macro dosomething(dsin=, num=);&lt;BR /&gt;proc nlp noprint data=&amp;amp;dsin. absgconv=1e-15 OUTEST=T1; by obs;&lt;BR /&gt;bounds R&amp;gt;=0, R&amp;lt;=1;&lt;BR /&gt;min f;&lt;BR /&gt;decvar R=1;&lt;BR /&gt;f = abs(PRC1_IBES-(BVPS1_1+(((FEPS1_1/BVPS1_1_1)-R)/(1+R))*BVPS1_1&lt;BR /&gt;+(((FEPS2_1/BVPS2_1_1)-R)/((1+R)**2))*BVPS1_1_1&lt;BR /&gt;+(((FEPS3_1/BVPS3_1_1)-R)/((1+R)**3))*BVPS2_1_1&lt;BR /&gt;+(((FEPS4_1/BVPS4_1_1)-R)/((1+R)**4))*BVPS3_1_1&lt;BR /&gt;+(((FEPS5_1/BVPS5_1_1)-R)/((1+R)**5))*BVPS4_1_1&lt;BR /&gt;+(((FEPS6_1/BVPS6_1_1)-R)/((1+R)**6))*BVPS5_1_1&lt;BR /&gt;+(((FEPS7_1/BVPS7_1_1)-R)/((1+R)**7))*BVPS6_1_1&lt;BR /&gt;+(((FEPS8_1/BVPS8_1_1)-R)/((1+R)**8))*BVPS7_1_1&lt;BR /&gt;+(((FEPS9_1/BVPS9_1_1)-R)/((1+R)**9))*BVPS8_1_1&lt;BR /&gt;+(((FEPS10_1/BVPS10_1_1)-R)/((1+R)**10))*BVPS9_1_1&lt;BR /&gt;+(((FEPS11_1/BVPS11_1_1)-R)/((1+R)**11))*BVPS10_1_1&lt;BR /&gt;+(((FEPS12_1/BVPS12_1_1)-R)/(R*(1+R)**11))*BVPS11_1_1));&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data T1; set T1;&lt;BR /&gt;if _TYPE_='PARMS';&lt;BR /&gt;rename R=rgls1_1_1;&lt;BR /&gt;keep obs R; run;&lt;BR /&gt;data OUTSET_&amp;amp;num.; merge &amp;amp;dsin. (in=xx) T1(in=yy); by obs; if xx and yy; run;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;do i=1 to &amp;amp;num_dsets;&lt;BR /&gt;num=put(i, z2.);&lt;BR /&gt;call execute(cats('%dosomething(dsin=INSET_', num, ',num=', num, ')'));&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;endrsubmit;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Feb 2020 23:55:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621822#M182857</guid>
      <dc:creator>nazmul</dc:creator>
      <dc:date>2020-02-02T23:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: Use SAS macro to generate multiple output files for the same number of input files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621823#M182858</link>
      <description>&lt;P&gt;Thank you for your kind help. I applied the code you mentioned, however, I did not find any SAS output. One additional information I want to share is that I am running my codes on a remote server.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS log file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;5122 rsubmit;&lt;BR /&gt;NOTE: Remote submit to WRDS commencing.&lt;BR /&gt;20842 data S1; set F3; if obs&amp;lt;=2000; run;&lt;BR /&gt;20843 data S2; set F3; if 2000&amp;lt;obs&amp;lt;=4000; run;&lt;BR /&gt;20844 data S3; set F3; if 4000&amp;lt;obs&amp;lt;=6000; run;&lt;BR /&gt;20845&lt;BR /&gt;20846 %macro rtm(i=4);&lt;BR /&gt;20847 proc nlp noprint data=S&amp;amp;i absgconv=1e-15 OUTEST=T1; by obs;&lt;BR /&gt;20848 bounds R&amp;gt;=0, R&amp;lt;=1;&lt;BR /&gt;20849 min f;&lt;BR /&gt;20850 decvar R=1;&lt;BR /&gt;20851 f = abs(PRC1_IBES-(BVPS1_1+(((FEPS1_1/BVPS1_1_1)-R)/(1+R))*BVPS1_1&lt;BR /&gt;20852 +(((FEPS2_1/BVPS2_1_1)-R)/((1+R)**2))*BVPS1_1_1&lt;BR /&gt;20853 +(((FEPS3_1/BVPS3_1_1)-R)/((1+R)**3))*BVPS2_1_1&lt;BR /&gt;20854 +(((FEPS4_1/BVPS4_1_1)-R)/((1+R)**4))*BVPS3_1_1&lt;BR /&gt;20855 +(((FEPS5_1/BVPS5_1_1)-R)/((1+R)**5))*BVPS4_1_1&lt;BR /&gt;20856 +(((FEPS6_1/BVPS6_1_1)-R)/((1+R)**6))*BVPS5_1_1&lt;BR /&gt;20857 +(((FEPS7_1/BVPS7_1_1)-R)/((1+R)**7))*BVPS6_1_1&lt;BR /&gt;20858 +(((FEPS8_1/BVPS8_1_1)-R)/((1+R)**8))*BVPS7_1_1&lt;BR /&gt;20859 +(((FEPS9_1/BVPS9_1_1)-R)/((1+R)**9))*BVPS8_1_1&lt;BR /&gt;20860 +(((FEPS10_1/BVPS10_1_1)-R)/((1+R)**10))*BVPS9_1_1&lt;BR /&gt;20861 +(((FEPS11_1/BVPS11_1_1)-R)/((1+R)**11))*BVPS10_1_1&lt;BR /&gt;20862 +(((FEPS12_1/BVPS12_1_1)-R)/(R*(1+R)**11))*BVPS11_1_1));&lt;BR /&gt;20863 run;&lt;BR /&gt;20864 data T1; set T1;&lt;BR /&gt;20865 if _TYPE_='PARMS';&lt;BR /&gt;20866 rename R=rgls1_1_1;&lt;BR /&gt;20867 keep obs R; run;&lt;BR /&gt;20868 data O&amp;amp;i; merge S&amp;amp;i (in=xx) T1(in=yy); by obs; if xx and yy; run;&lt;BR /&gt;20869 %mend rtm;&lt;BR /&gt;20870 %rtm(i=3);&lt;BR /&gt;NOTE: Remote submit to WRDS complete.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 00:00:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621823#M182858</guid>
      <dc:creator>nazmul</dc:creator>
      <dc:date>2020-02-03T00:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: Use SAS macro to generate multiple output files for the same number of input files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621824#M182859</link>
      <description>&lt;P&gt;What doesn’t work? Can you show the log output?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 00:15:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621824#M182859</guid>
      <dc:creator>unison</dc:creator>
      <dc:date>2020-02-03T00:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: Use SAS macro to generate multiple output files for the same number of input files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621825#M182860</link>
      <description>&lt;P&gt;Dear Unison,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The codes that I made based on your codes do not work. Could you please check the log files posted here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;5126 rsubmit;&lt;BR /&gt;NOTE: Remote submit to WRDS commencing.&lt;BR /&gt;20900 %let num_dsets=3;&lt;BR /&gt;20901 data Inset_01; set F3; if obs&amp;lt;=2000; run;&lt;BR /&gt;20902 data Inset_02; set F3; if 2000&amp;lt;obs&amp;lt;=4000; run;&lt;BR /&gt;20903 data Inset_03; set F3; if 4000&amp;lt;obs&amp;lt;=6000; run;&lt;BR /&gt;20904&lt;BR /&gt;20905 %macro dosomething(dsin=, num=);&lt;BR /&gt;20906 proc nlp noprint data=&amp;amp;dsin. absgconv=1e-15 OUTEST=T1; by obs;&lt;BR /&gt;20907 bounds R&amp;gt;=0, R&amp;lt;=1;&lt;BR /&gt;20908 min f;&lt;BR /&gt;20909 decvar R=1;&lt;BR /&gt;20910 f = abs(PRC1_IBES-(BVPS1_1+(((FEPS1_1/BVPS1_1_1)-R)/(1+R))*BVPS1_1&lt;BR /&gt;20911 +(((FEPS2_1/BVPS2_1_1)-R)/((1+R)**2))*BVPS1_1_1&lt;BR /&gt;20912 +(((FEPS3_1/BVPS3_1_1)-R)/((1+R)**3))*BVPS2_1_1&lt;BR /&gt;20913 +(((FEPS4_1/BVPS4_1_1)-R)/((1+R)**4))*BVPS3_1_1&lt;BR /&gt;20914 +(((FEPS5_1/BVPS5_1_1)-R)/((1+R)**5))*BVPS4_1_1&lt;BR /&gt;20915 +(((FEPS6_1/BVPS6_1_1)-R)/((1+R)**6))*BVPS5_1_1&lt;BR /&gt;20916 +(((FEPS7_1/BVPS7_1_1)-R)/((1+R)**7))*BVPS6_1_1&lt;BR /&gt;20917 +(((FEPS8_1/BVPS8_1_1)-R)/((1+R)**8))*BVPS7_1_1&lt;BR /&gt;20918 +(((FEPS9_1/BVPS9_1_1)-R)/((1+R)**9))*BVPS8_1_1&lt;BR /&gt;20919 +(((FEPS10_1/BVPS10_1_1)-R)/((1+R)**10))*BVPS9_1_1&lt;BR /&gt;20920 +(((FEPS11_1/BVPS11_1_1)-R)/((1+R)**11))*BVPS10_1_1&lt;BR /&gt;20921 +(((FEPS12_1/BVPS12_1_1)-R)/(R*(1+R)**11))*BVPS11_1_1));&lt;BR /&gt;20922 run;&lt;BR /&gt;20923&lt;BR /&gt;20924 data T1; set T1;&lt;BR /&gt;20925 if _TYPE_='PARMS';&lt;BR /&gt;20926 rename R=rgls1_1_1;&lt;BR /&gt;20927 keep obs R; run;&lt;BR /&gt;20928 data OUTSET_&amp;amp;num.; merge &amp;amp;dsin. (in=xx) T1(in=yy); by obs; if xx and yy;&lt;BR /&gt;20928! run;&lt;BR /&gt;20929 %mend;&lt;BR /&gt;20930&lt;BR /&gt;20931 data _null_;&lt;BR /&gt;20932 do i=1 to &amp;amp;num_dsets;&lt;BR /&gt;20933 num=put(i, z2.);&lt;BR /&gt;20934 call execute(cats('%dosomething(dsin=INSET_', num, ',num=', num,&lt;BR /&gt;20934! ')'));&lt;BR /&gt;20935 end;&lt;BR /&gt;20936 run;&lt;BR /&gt;NOTE: Remote submit to WRDS complete.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Mon, 03 Feb 2020 00:37:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621825#M182860</guid>
      <dc:creator>nazmul</dc:creator>
      <dc:date>2020-02-03T00:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Use SAS macro to generate multiple output files for the same number of input files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621826#M182861</link>
      <description>&lt;P&gt;include the entire log&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 01:09:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621826#M182861</guid>
      <dc:creator>fdsaaaa</dc:creator>
      <dc:date>2020-02-03T01:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: Use SAS macro to generate multiple output files for the same number of input files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621827#M182862</link>
      <description>&lt;P&gt;That's the entire log file. As I mentioned earlier, nothing is happing when I run the macro.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 01:14:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621827#M182862</guid>
      <dc:creator>nazmul</dc:creator>
      <dc:date>2020-02-03T01:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Use SAS macro to generate multiple output files for the same number of input files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621828#M182863</link>
      <description>&lt;P&gt;what if you run this&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;rsubmit;

data S1; set F3; if obs&amp;lt;=2000; run;

endrsubmit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Feb 2020 01:15:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621828#M182863</guid>
      <dc:creator>fdsaaaa</dc:creator>
      <dc:date>2020-02-03T01:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Use SAS macro to generate multiple output files for the same number of input files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621830#M182865</link>
      <description>&lt;P&gt;I only see NOTEs and no ERRORs. I cannot tell what is going wrong from this. What output datasets are you seeing?&lt;BR /&gt;&lt;BR /&gt;I suggest pulling the proc nlp out from the macro and experimenting on that until you can get it to work for one INSET. From there, wrap in the macro command and build up from there.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 01:28:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621830#M182865</guid>
      <dc:creator>unison</dc:creator>
      <dc:date>2020-02-03T01:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Use SAS macro to generate multiple output files for the same number of input files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621833#M182867</link>
      <description>&lt;P&gt;Thank you for asking. My codes work for a single file (e.g. S1). I tried to put the complete log file here but the size of the log file is too long for the webpage (you know log file is usually long for PROC command). I, therefore, copied the last part of the log file here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate your kind help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: The above message was for the following BY group:&lt;BR /&gt;obs=1996&lt;BR /&gt;WARNING: Your program statements cannot be executed completely.&lt;BR /&gt;WARNING: Your program statements cannot be executed completely.&lt;BR /&gt;ERROR: NRRIDG Optimization cannot be completed.&lt;BR /&gt;WARNING: Optimization routine cannot improve the function value.&lt;BR /&gt;WARNING: In a total of 2550 calls an error occurred during execution of the&lt;BR /&gt;program statements. NLP attempted to recover by using a shorter step&lt;BR /&gt;size.&lt;BR /&gt;NOTE: The above message was for the following BY group:&lt;BR /&gt;obs=1997&lt;BR /&gt;ERROR: There are references to missing variables when the program code is&lt;BR /&gt;executed for _OBS_= 1&lt;BR /&gt;WARNING: Your program statements cannot be executed completely.&lt;BR /&gt;WARNING: In a total of 2551 calls an error occurred during execution of the&lt;BR /&gt;program statements. NLP attempted to recover by using a shorter step&lt;BR /&gt;size.&lt;BR /&gt;NOTE: The above message was for the following BY group:&lt;BR /&gt;obs=1998&lt;BR /&gt;ERROR: There are references to missing variables when the program code is&lt;BR /&gt;executed for _OBS_= 1&lt;BR /&gt;WARNING: Your program statements cannot be executed completely.&lt;BR /&gt;WARNING: In a total of 2552 calls an error occurred during execution of the&lt;BR /&gt;program statements. NLP attempted to recover by using a shorter step&lt;BR /&gt;size.&lt;BR /&gt;NOTE: The above message was for the following BY group:&lt;BR /&gt;obs=1999&lt;BR /&gt;NOTE: There were 1977 observations read from the data set WORK.S1.&lt;BR /&gt;NOTE: The data set WORK.S2 has 27298 observations and 7 variables.&lt;BR /&gt;NOTE: The PROCEDURE NLP printed pages 1-548.&lt;BR /&gt;NOTE: PROCEDURE NLP used (Total process time):&lt;BR /&gt;real time 39.59 seconds&lt;BR /&gt;cpu time 2.55 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;5567&lt;BR /&gt;5568 data S2; set S2;&lt;BR /&gt;5569 if _TYPE_='PARMS';&lt;BR /&gt;5570 rename R=rgls1_1_1;&lt;BR /&gt;5571 keep obs R; run;&lt;/P&gt;&lt;P&gt;NOTE: There were 27298 observations read from the data set WORK.S2.&lt;BR /&gt;NOTE: The data set WORK.S2 has 1429 observations and 2 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.02 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;5572 data S3; merge S1 (in=xx) S2(in=yy); by obs; if xx and yy; run;&lt;/P&gt;&lt;P&gt;NOTE: There were 1977 observations read from the data set WORK.S1.&lt;BR /&gt;NOTE: There were 1429 observations read from the data set WORK.S2.&lt;BR /&gt;NOTE: The data set WORK.S3 has 1429 observations and 3952 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.15 seconds&lt;BR /&gt;cpu time 0.08 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NOTE: Remote submit to WRDS complete.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 01:45:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621833#M182867</guid>
      <dc:creator>nazmul</dc:creator>
      <dc:date>2020-02-03T01:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: Use SAS macro to generate multiple output files for the same number of input files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621834#M182868</link>
      <description>&lt;P&gt;you have heaps of warnings and error messages ! you need to resolve those before you consider using a macro .&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 01:50:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621834#M182868</guid>
      <dc:creator>fdsaaaa</dc:creator>
      <dc:date>2020-02-03T01:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Use SAS macro to generate multiple output files for the same number of input files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621835#M182869</link>
      <description>&lt;P&gt;Thank you for mentioning the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Those warnings are very common when one tries to use optimization function for the quadratic equation in SAS and SAS provides correct optimization even with those warnings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I restart the SAS and find that your codes are working however only for the very last file. Say if I have three input files (e.g., S1, S2, &amp;amp; S3), I get output only for the last file (In this case, S3). I am sorry for the inconvenience.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please suggest why it may happen?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 01:58:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621835#M182869</guid>
      <dc:creator>nazmul</dc:creator>
      <dc:date>2020-02-03T01:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: Use SAS macro to generate multiple output files for the same number of input files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621836#M182870</link>
      <description>&lt;P&gt;whoops. that's because I forgot to put a do loop in .&amp;nbsp; try this&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro rtm (j=31) ; 

%do i = 1 %to &amp;amp;j ; 
&lt;SPAN style="display: inline !important; float: none; background-color: #eaeaea; color: #333333; font-family: monospace,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px; word-wrap: normal;"&gt;&lt;BR /&gt;proc nlp noprint data=S&amp;amp;i absgconv=1e-15 OUTEST=T1; by obs;&lt;BR /&gt;bounds R&amp;gt;=0, R&amp;lt;=1;&lt;BR /&gt;min f;&lt;BR /&gt;decvar R=1;&lt;BR /&gt;f = abs(PRC1_IBES-(BVPS1_1+(((FEPS1_1/BVPS1_1_1)-R)/(1+R))*BVPS1_1&lt;BR /&gt;+(((FEPS2_1/BVPS2_1_1)-R)/((1+R)**2))*BVPS1_1_1&lt;BR /&gt;+(((FEPS3_1/BVPS3_1_1)-R)/((1+R)**3))*BVPS2_1_1&lt;BR /&gt;+(((FEPS4_1/BVPS4_1_1)-R)/((1+R)**4))*BVPS3_1_1&lt;BR /&gt;+(((FEPS5_1/BVPS5_1_1)-R)/((1+R)**5))*BVPS4_1_1&lt;BR /&gt;+(((FEPS6_1/BVPS6_1_1)-R)/((1+R)**6))*BVPS5_1_1&lt;BR /&gt;+(((FEPS7_1/BVPS7_1_1)-R)/((1+R)**7))*BVPS6_1_1&lt;BR /&gt;+(((FEPS8_1/BVPS8_1_1)-R)/((1+R)**8))*BVPS7_1_1&lt;BR /&gt;+(((FEPS9_1/BVPS9_1_1)-R)/((1+R)**9))*BVPS8_1_1&lt;BR /&gt;+(((FEPS10_1/BVPS10_1_1)-R)/((1+R)**10))*BVPS9_1_1&lt;BR /&gt;+(((FEPS11_1/BVPS11_1_1)-R)/((1+R)**11))*BVPS10_1_1&lt;BR /&gt;+(((FEPS12_1/BVPS12_1_1)-R)/(R*(1+R)**11))*BVPS11_1_1));&lt;BR /&gt;run;&lt;BR /&gt;data T1; set T1;&lt;BR /&gt;if _TYPE_='PARMS';&lt;BR /&gt;rename R=rgls1_1_1;&lt;BR /&gt;keep obs R; run;&lt;BR /&gt;data O&amp;amp;i; merge S&amp;amp;i (in=xx) T1(in=yy); by obs; if xx and yy; run;&lt;BR /&gt;&lt;/SPAN&gt;
%end;
%mend rtm;
%rtm(j=31);

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 02:11:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621836#M182870</guid>
      <dc:creator>fdsaaaa</dc:creator>
      <dc:date>2020-02-03T02:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: Use SAS macro to generate multiple output files for the same number of input files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621838#M182871</link>
      <description>&lt;P&gt;Thank you Unison. Your codes are perfect. I do not know why they did not work in my previous attempt. I&amp;nbsp; restart SAS and now your codes are giving me what I wanted. I highly appreciate your help.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 02:12:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621838#M182871</guid>
      <dc:creator>nazmul</dc:creator>
      <dc:date>2020-02-03T02:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: Use SAS macro to generate multiple output files for the same number of input files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621839#M182872</link>
      <description>Thank you for your valuable time and help.</description>
      <pubDate>Mon, 03 Feb 2020 02:15:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621839#M182872</guid>
      <dc:creator>nazmul</dc:creator>
      <dc:date>2020-02-03T02:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: Use SAS macro to generate multiple output files for the same number of input files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621846#M182876</link>
      <description>&lt;P&gt;Thank you very much. Your solution works perfectly. I am sorry I do not have the option to choose two right answers here. Otherwise, I would select your one too.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 03:15:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-SAS-macro-to-generate-multiple-output-files-for-the-same/m-p/621846#M182876</guid>
      <dc:creator>nazmul</dc:creator>
      <dc:date>2020-02-03T03:15:42Z</dc:date>
    </item>
  </channel>
</rss>

