<?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: ODS destination creating summary statistics in different files in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270045#M15864</link>
    <description>&lt;P&gt;Hello PG,&lt;/P&gt;&lt;P&gt;How are you? I really appreciate your expertise.&lt;/P&gt;&lt;P&gt;The countyname variable has 102 unique counties. I need individual summary for each county . That means, there will be 120 rtf files with individual summary. For example, in countyA rtf file we should have countyA summary statistics, countyB rtf will have countyB summary statistics and so on. My macro variables don't get resolved with the ods statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Here's my original code:&lt;/P&gt;&lt;P&gt;PROC SQL noprint ;&lt;BR /&gt;SELECT COUNT(DISTINCT COUNTYNAME) INTO : Nobs FROM QSSTOTAL;&lt;BR /&gt;SELECT DISTINCT COUNTYNAME INTO : NAME1-:NAME%LEFT(&amp;amp;Nobs) FROM QSSTOTAL;QUIT;&lt;BR /&gt;%macro output_all;&lt;BR /&gt;%DO i=1 %TO &amp;amp;Nobs;&lt;BR /&gt;%put Processing &amp;amp;&amp;amp;name&amp;amp;i;&lt;BR /&gt;%end;&lt;BR /&gt;DATA %DO COUNT=1 %TO &amp;amp;Nobs;&lt;BR /&gt;%SYSFUNC(COMPRESS (&amp;amp;&amp;amp;NAME&amp;amp;COUNT,/,PS))&lt;BR /&gt;%END;&lt;BR /&gt;;&lt;BR /&gt;SET qsstotal;&lt;BR /&gt;SELECT (COUNTYNAME) ;&lt;BR /&gt;%DO COUNTY=1 %TO &amp;amp;Nobs;&lt;BR /&gt;WHEN ("&amp;amp;&amp;amp;NAME&amp;amp;COUNTY") OUTPUT&lt;BR /&gt;%SYSFUNC(COMPRESS (&amp;amp;&amp;amp;NAME&amp;amp;COUNTY,/,PS));&lt;BR /&gt;%END;&lt;BR /&gt;OTHERWISE;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;ods rtf file = "R:\H\COUNTY2016\%SYSFUNC(COMPRESS (&amp;amp;&amp;amp;NAME&amp;amp;count,/,PS)).rtf"&lt;BR /&gt;newfile="&amp;amp;&amp;amp;Name&amp;amp;count" bodytitle;&lt;BR /&gt;title;&lt;BR /&gt;proc freq data=qsstotal;&lt;BR /&gt;tables q1--q10;where countyname="%SYSFUNC(COMPRESS (&amp;amp;&amp;amp;NAME&amp;amp;COUNTY,/,PS))";&lt;BR /&gt;by countyname;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;ods rtf close;&lt;/P&gt;&lt;P&gt;%mend;&lt;BR /&gt;options mprint;&lt;BR /&gt;%output_all;&lt;/P&gt;</description>
    <pubDate>Thu, 12 May 2016 13:24:27 GMT</pubDate>
    <dc:creator>kllamitarey</dc:creator>
    <dc:date>2016-05-12T13:24:27Z</dc:date>
    <item>
      <title>ODS destination creating summary statistics in different files</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/269878#M15856</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;I want the&amp;nbsp;summary statistics output of individual counties in a rtf fromat. Altogether there should be 102 rtf files in the folder county2016. &amp;nbsp;I cannot output the summary statistics in the given directory. The macro output_all only creates multiple datasets but couldn't produce the output files. I appreciate any input to solve this problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL noprint ;&lt;BR /&gt;SELECT COUNT(DISTINCT COUNTYNAME) INTO : Nobs FROM QSSTOTAL;&lt;BR /&gt;SELECT DISTINCT COUNTYNAME INTO : NAME1-:NAME%LEFT(&amp;amp;Nobs) FROM QSSTOTAL;QUIT;&lt;BR /&gt;%macro output_all;&lt;BR /&gt;%DO i=1 %TO &amp;amp;Nobs;&lt;BR /&gt;%put &amp;nbsp;&amp;amp;&amp;amp;name&amp;amp;i;&lt;BR /&gt;%end;&lt;BR /&gt;DATA %DO COUNT=1 %TO &amp;amp;Nobs;&lt;BR /&gt;%SYSFUNC(COMPRESS (&amp;amp;&amp;amp;NAME&amp;amp;COUNT,/,PS))&lt;BR /&gt;%END;&lt;BR /&gt;;&lt;BR /&gt;SET qsstotal;&lt;BR /&gt;SELECT (COUNTYNAME) ;&lt;BR /&gt;%DO COUNTY=1 %TO &amp;amp;Nobs;&lt;BR /&gt;WHEN ("&amp;amp;&amp;amp;NAME&amp;amp;COUNTY") OUTPUT&lt;BR /&gt;%SYSFUNC(COMPRESS (&amp;amp;&amp;amp;NAME&amp;amp;COUNTY,/,PS));&lt;BR /&gt;%END;&lt;BR /&gt;OTHERWISE;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;ods rtf file = "C:\H\COUNTY2016\%SYSFUNC(COMPRESS (&amp;amp;&amp;amp;NAME&amp;amp;county,/,PS)).rtf"&lt;BR /&gt;bodytitle;&lt;BR /&gt;title;&lt;BR /&gt;proc freq data=qsstotal;&lt;BR /&gt;tables q1--q10;* q2 q3 q4 q5 q6 q7 q8 q9 q10; where countyname="%SYSFUNC(COMPRESS (&amp;amp;&amp;amp;NAME&amp;amp;COUNTY,/,PS))";&lt;BR /&gt;*by countyname;&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;ods rtf close;&lt;/P&gt;&lt;P&gt;%mend;&lt;BR /&gt;options mprint;&lt;BR /&gt;%output_all;&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2016 20:57:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/269878#M15856</guid>
      <dc:creator>kllamitarey</dc:creator>
      <dc:date>2016-05-11T20:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: ODS destination creating summary statistics in different files</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/269897#M15857</link>
      <description>&lt;P&gt;Why not simplify things a lot with NEWFILE= option?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods rtf file = "C:\H\COUNTY2016\County_1.rtf" NEWFILE=BYGROUP bodytitle;
title;
&lt;BR /&gt;proc freq data=qsstotal;
tables q1--q10;
by countyname;
run;

ods rtf close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 May 2016 21:27:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/269897#M15857</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-05-11T21:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: ODS destination creating summary statistics in different files</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/269905#M15858</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;It needs to produce 102 files for each county with its summary statistics included not just one file. Did I make clear?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2016 21:52:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/269905#M15858</guid>
      <dc:creator>kllamitarey</dc:creator>
      <dc:date>2016-05-11T21:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: ODS destination creating summary statistics in different files</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/269908#M15859</link>
      <description>&lt;P&gt;This is the message&amp;nbsp;I got &amp;nbsp;"Apparent symbolic reference NAME103 not resolved"&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2016 21:57:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/269908#M15859</guid>
      <dc:creator>kllamitarey</dc:creator>
      <dc:date>2016-05-11T21:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: ODS destination creating summary statistics in different files</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/269910#M15860</link>
      <description>&lt;P&gt;There is no symbolic reference in the code I proposed. Please post the code you ran.&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2016 22:10:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/269910#M15860</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-05-11T22:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: ODS destination creating summary statistics in different files</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/269913#M15861</link>
      <description>&lt;P&gt;No.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you need 102 files, one for each county&lt;/P&gt;
&lt;P&gt;OR&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;102 files for each county, so say 10 counties, then thats 1020 files.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At any rate the NEWFILE creates a new file for each BY group which seems a lot like what you're doing. Is there a reason you think it won't work?&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2016 22:13:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/269913#M15861</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-05-11T22:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: ODS destination creating summary statistics in different files</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270041#M15863</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, I need 102 files , one for each country. I think&amp;nbsp;&lt;SPAN&gt;NEWFILE option works but m&lt;/SPAN&gt;y macro&amp;nbsp;is not resolved to&amp;nbsp;individual value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem should be&amp;nbsp;here: &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%SYSFUNC(COMPRESS (&amp;amp;&amp;amp;NAME&amp;amp;count,/,PS)).rtf"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where countyname="%SYSFUNC(COMPRESS (&amp;amp;&amp;amp;NAME&amp;amp;COUNTY,/,PS))";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate your insight.&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>Thu, 12 May 2016 13:14:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270041#M15863</guid>
      <dc:creator>kllamitarey</dc:creator>
      <dc:date>2016-05-12T13:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: ODS destination creating summary statistics in different files</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270045#M15864</link>
      <description>&lt;P&gt;Hello PG,&lt;/P&gt;&lt;P&gt;How are you? I really appreciate your expertise.&lt;/P&gt;&lt;P&gt;The countyname variable has 102 unique counties. I need individual summary for each county . That means, there will be 120 rtf files with individual summary. For example, in countyA rtf file we should have countyA summary statistics, countyB rtf will have countyB summary statistics and so on. My macro variables don't get resolved with the ods statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Here's my original code:&lt;/P&gt;&lt;P&gt;PROC SQL noprint ;&lt;BR /&gt;SELECT COUNT(DISTINCT COUNTYNAME) INTO : Nobs FROM QSSTOTAL;&lt;BR /&gt;SELECT DISTINCT COUNTYNAME INTO : NAME1-:NAME%LEFT(&amp;amp;Nobs) FROM QSSTOTAL;QUIT;&lt;BR /&gt;%macro output_all;&lt;BR /&gt;%DO i=1 %TO &amp;amp;Nobs;&lt;BR /&gt;%put Processing &amp;amp;&amp;amp;name&amp;amp;i;&lt;BR /&gt;%end;&lt;BR /&gt;DATA %DO COUNT=1 %TO &amp;amp;Nobs;&lt;BR /&gt;%SYSFUNC(COMPRESS (&amp;amp;&amp;amp;NAME&amp;amp;COUNT,/,PS))&lt;BR /&gt;%END;&lt;BR /&gt;;&lt;BR /&gt;SET qsstotal;&lt;BR /&gt;SELECT (COUNTYNAME) ;&lt;BR /&gt;%DO COUNTY=1 %TO &amp;amp;Nobs;&lt;BR /&gt;WHEN ("&amp;amp;&amp;amp;NAME&amp;amp;COUNTY") OUTPUT&lt;BR /&gt;%SYSFUNC(COMPRESS (&amp;amp;&amp;amp;NAME&amp;amp;COUNTY,/,PS));&lt;BR /&gt;%END;&lt;BR /&gt;OTHERWISE;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;ods rtf file = "R:\H\COUNTY2016\%SYSFUNC(COMPRESS (&amp;amp;&amp;amp;NAME&amp;amp;count,/,PS)).rtf"&lt;BR /&gt;newfile="&amp;amp;&amp;amp;Name&amp;amp;count" bodytitle;&lt;BR /&gt;title;&lt;BR /&gt;proc freq data=qsstotal;&lt;BR /&gt;tables q1--q10;where countyname="%SYSFUNC(COMPRESS (&amp;amp;&amp;amp;NAME&amp;amp;COUNTY,/,PS))";&lt;BR /&gt;by countyname;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;ods rtf close;&lt;/P&gt;&lt;P&gt;%mend;&lt;BR /&gt;options mprint;&lt;BR /&gt;%output_all;&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2016 13:24:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270045#M15864</guid>
      <dc:creator>kllamitarey</dc:creator>
      <dc:date>2016-05-12T13:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: ODS destination creating summary statistics in different files</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270070#M15865</link>
      <description>&lt;P&gt;The NEWFILE option does this, creates a new report on a specified interval. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/3138i3A039A88CE9DD743/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="image.jpeg" title="image.jpeg" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2016 14:03:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270070#M15865</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-05-12T14:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: ODS destination creating summary statistics in different files</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270117#M15867</link>
      <description>&lt;P&gt;I tried looking at your code, but there's a lot of things to change so here's the solution with NEWFILE instead. I don't know how the naming structure works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods rtf file = "R:\H\COUNTY2016\County.rtf"
newfile="bygroup" bodytitle;
proc freq data=qsstotal;
by countyname;
tables q1--q10;;

run;

ods rtf close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you absolutely want to control the name and the NEWFILE doesn't work for you, then I'd suggest changing your code to the following.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rather than do slices of data and create separate output datasets, just filter on the PROC FREQ with a WHERE.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL noprint ;

SELECT DISTINCT COUNTYNAME 
INTO : NAME1- 
FROM QSSTOTAL;
QUIT;
%let nobs=&amp;amp;sqlobs;



%macro output_all;
%DO i=1 %TO &amp;amp;Nobs;
%put Processing &amp;amp;&amp;amp;&amp;amp;name&amp;amp;i;

	ods rtf file = "R:\H\COUNTY2016\County &amp;amp;&amp;amp;&amp;amp;name&amp;amp;i..rtf"
		proc freq data=qsstotal;
		tables q1--q10;
		where countyname="&amp;amp;&amp;amp;&amp;amp;name&amp;amp;i";
		run;
	ods rtf close;
%end;
%mend;

options mprint;
%output_all;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Obviously this is all untested since I have no data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good Luck.&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2016 17:53:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270117#M15867</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-05-12T17:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: ODS destination creating summary statistics in different files</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270222#M15869</link>
      <description>&lt;P&gt;Hello Rezza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Atleast with&amp;nbsp;your second program, I 'm able to produce the output but it's limited to first&amp;nbsp;county only.&amp;nbsp;Do we need to develop a loop for the ods statement? Green light should be&amp;nbsp;waiting.Just a little twist. Thank you in advance. Have a great time.&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2016 22:12:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270222#M15869</guid>
      <dc:creator>kllamitarey</dc:creator>
      <dc:date>2016-05-12T22:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: ODS destination creating summary statistics in different files</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270223#M15870</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Are you suggesting me to use like this in ods statement?&lt;/P&gt;&lt;P&gt;ods rtf file = "R:H\COUNTY2016\&amp;amp;&amp;amp;&amp;amp;name&amp;amp;i...rtf" &amp;nbsp;&lt;/P&gt;&lt;P&gt;newfile=&lt;/P&gt;&lt;P&gt;proc freq data=qsstotal;&lt;BR /&gt;&amp;nbsp;tables q1--q10;&lt;BR /&gt;&amp;nbsp;where countyname="&amp;amp;&amp;amp;&amp;amp;NAME&amp;amp;i";&lt;BR /&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2016 22:17:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270223#M15870</guid>
      <dc:creator>kllamitarey</dc:creator>
      <dc:date>2016-05-12T22:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: ODS destination creating summary statistics in different files</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270224#M15871</link>
      <description>&lt;P&gt;I was missing a semicolon in my ods rtf statement and a period to allow the name to resolve properly -&amp;nbsp;the log throws a bunch of errors which are straight forward to debug.&lt;/P&gt;
&lt;P&gt;The code below works with the SASHELP.CLASS dataset, modify it for your project.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL noprint ;

SELECT DISTINCT age 
INTO : NAME1- 
FROM sashelp.class;
QUIT;
%let nobs=&amp;amp;sqlobs;



%macro output_all;
%DO i=1 %TO &amp;amp;Nobs;
%put Processing &amp;amp;&amp;amp;&amp;amp;name&amp;amp;i;

	ods rtf file = "C:\_localdata\temp\County &amp;amp;&amp;amp;&amp;amp;name&amp;amp;i...rtf";
		proc freq data=sashelp.class;
		tables sex;
		where age=&amp;amp;&amp;amp;&amp;amp;name&amp;amp;i;
		run;
	ods rtf close;
%end;
%mend;

options mprint;
%output_all;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 May 2016 22:25:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270224#M15871</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-05-12T22:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: ODS destination creating summary statistics in different files</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270228#M15872</link>
      <description>&lt;P&gt;You can run the code....what did it produce?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.class out=class;
by age;
run;

ods rtf file="C:\_localdata\temp\output.rtf" newfile=bygroup;

proc freq data=class;
by age;
table sex;
run;

ods rtf close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 May 2016 22:39:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270228#M15872</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-05-12T22:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: ODS destination creating summary statistics in different files</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270351#M15880</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;The only remaining concern is that the program is able to output for only one county(but gave the result &amp;nbsp;exaclty what I wanted). The program ignored remaining 101 counties. The macro resolution was perfect. &amp;nbsp;Why is the do loop processing in the ods statement is limited to only one county(first county)?There is no warning/error in the log as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for helping me.&lt;/P&gt;&lt;P&gt;Have a good day&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2016 14:24:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270351#M15880</guid>
      <dc:creator>kllamitarey</dc:creator>
      <dc:date>2016-05-13T14:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: ODS destination creating summary statistics in different files</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270359#M15882</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;It did produce six rtf files.&amp;nbsp;When I utilized this idea in my program, I got exactly what I wanted but the fileneme should go with the county name. instead,It came with county number.In this regard , should we need the macro to name the appropriate file by its county name?&lt;/P&gt;&lt;P&gt;Thoughts?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2016 14:46:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270359#M15882</guid>
      <dc:creator>kllamitarey</dc:creator>
      <dc:date>2016-05-13T14:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: ODS destination creating summary statistics in different files</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270368#M15885</link>
      <description>&lt;P&gt;Both examples worked perfectly in my case - with names.&lt;/P&gt;
&lt;P&gt;Post your code and check it over that it aligns with the sample code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I only get multiple files. Are there errors in your log?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The NEWFILE method will not allow you to control the name, you'll need to use the macro version if you want county name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2016 15:07:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270368#M15885</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-05-13T15:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: ODS destination creating summary statistics in different files</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270375#M15886</link>
      <description>&lt;P&gt;No errors in the log. That's what I got. Attached is the partial output. I wanted CountyA, CountyB, CountyC etc. Inside each file, I got exactly what I wanted. Thanks&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/3163i46A431BB4520D6AB/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="rtfcountyfile.PNG" title="rtfcountyfile.PNG" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2016 15:30:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270375#M15886</guid>
      <dc:creator>kllamitarey</dc:creator>
      <dc:date>2016-05-13T15:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: ODS destination creating summary statistics in different files</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270383#M15887</link>
      <description>&lt;P&gt;POST YOUR CODE AND LOG.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are twp solutions provided, which did you use? I can't help debug something I can't see.&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2016 15:39:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270383#M15887</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-05-13T15:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: ODS destination creating summary statistics in different files</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270392#M15889</link>
      <description>&lt;P&gt;I got the result from the program without using the macro. With the macro program, I don't get solution.&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2016 16:03:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-destination-creating-summary-statistics-in-different-files/m-p/270392#M15889</guid>
      <dc:creator>kllamitarey</dc:creator>
      <dc:date>2016-05-13T16:03:55Z</dc:date>
    </item>
  </channel>
</rss>

