<?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 Producing the same report for each instance of a variable in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Producing-the-same-report-for-each-instance-of-a-variable/m-p/402814#M19571</link>
    <description>&lt;P&gt;I can use this code to produce a report in and excel file for 1 of the 49 schools in my district.&amp;nbsp; I would like to be able to produce&amp;nbsp; separate excel files for each of the 49 schools that maintains the proc report features and picks up the school name (SchoolName1...schoolname2....Schoolname 49) in the both filename and the where statement.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is possible that some of the schools would have no data, and although I could send them an empty file, that would waste their time and mine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions, simplifications or alterations to the code would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ODS TAGSETS.EXCELXP&lt;BR /&gt;file='D:\ADAM\SAS Practice\sG 2018\byschool\ELASchoolName1.xls'&lt;BR /&gt;STYLE=minimal&lt;BR /&gt;OPTIONS ( Orientation = 'landscape'&lt;BR /&gt;FitToPage = 'yes'&lt;BR /&gt;Pages_FitWidth = '1'&lt;BR /&gt;Pages_FitHeight = '100' );&lt;BR /&gt;&lt;BR /&gt;Proc Report data=targela nowd ;&lt;BR /&gt;where&amp;nbsp; school eq 'SchoolName1';&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;column&amp;nbsp; Student&amp;nbsp; StudentId&amp;nbsp; Grade&amp;nbsp; School&amp;nbsp; ELA2017&amp;nbsp; ELALevel2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ELALeveL2017&amp;nbsp; EAL17&amp;nbsp; ProfDrop&amp;nbsp; BQELA&amp;nbsp; ELGtarget&amp;nbsp; ELAptsNeeded &amp;nbsp;&lt;BR /&gt;;&lt;BR /&gt;Define&amp;nbsp; Student/display;&lt;BR /&gt;Define&amp;nbsp; StudentId/display;&lt;BR /&gt;Define&amp;nbsp; Grade/display;&lt;BR /&gt;Define&amp;nbsp; School/display;&lt;BR /&gt;Define&amp;nbsp; ELA2017/display;&lt;BR /&gt;Define&amp;nbsp; ELALevel2016/display;&lt;BR /&gt;Define&amp;nbsp; ELALeveL2017/display;&lt;BR /&gt;Define&amp;nbsp; EAL17/display;&lt;BR /&gt;Define&amp;nbsp; ProfDrop/display;&lt;BR /&gt;Define&amp;nbsp; BQELA/display;&lt;BR /&gt;Define&amp;nbsp; ELGtarget/display;&lt;BR /&gt;Define&amp;nbsp; ELAptsNeeded/display;&lt;BR /&gt;&lt;BR /&gt;Compute&amp;nbsp; ELALevel2016;;&lt;BR /&gt;if ELALevel2016 = 1 then call define(_col_,"style","style={background=red}") ;&lt;BR /&gt;else if ELALevel2016 = 2 then call define(_col_,"style","style={background=yellow}") ;&lt;BR /&gt;else if ELALevel2016 = 3 then call define(_col_,"style","style={background=green}") ;&lt;BR /&gt;else if ELALevel2016 = 4 then call define(_col_,"style","style={background=blue}") ;&lt;BR /&gt;else if ELALevel2016 = 5 then call define(_col_,"style","style={background=violet}") ;&lt;BR /&gt;endcomp;&lt;BR /&gt;&lt;BR /&gt;Compute&amp;nbsp; ELALevel2017;;&lt;BR /&gt;if ELALevel2017 = 1 then call define(_col_,"style","style={background=red}") ;&lt;BR /&gt;else if ELALevel2017 = 2 then call define(_col_,"style","style={background=yellow}") ;&lt;BR /&gt;else if ELALevel2017 = 3 then call define(_col_,"style","style={background=green}") ;&lt;BR /&gt;else if ELALevel2017 = 4 then call define(_col_,"style","style={background=blue}") ;&lt;BR /&gt;else if ELALevel2017 = 5 then call define(_col_,"style","style={background=violet}") ;&lt;BR /&gt;endcomp;&lt;BR /&gt;&lt;BR /&gt;Compute&amp;nbsp; EAL17;;&lt;BR /&gt;if EAL17 = 1.1 then call define(_col_,"style","style={background=red}") ;&lt;BR /&gt;else if EAL17 = 1.2 then call define(_col_,"style","style={background=coral}") ;&lt;BR /&gt;else if EAL17 = 1.3 then call define(_col_,"style","style={background=pink}") ;&lt;BR /&gt;else if EAL17 = 2.1 then call define(_col_,"style","style={background=orange}") ;&lt;BR /&gt;else if EAL17 = 2.2 then call define(_col_,"style","style={background=yellow}") ;&lt;BR /&gt;else if EAL17 = 3 then call define(_col_,"style","style={background=green}") ;&lt;BR /&gt;else if EAL17 = 4 then call define(_col_,"style","style={background=blue}") ;&lt;BR /&gt;else if EAL17 = 5 then call define(_col_,"style","style={background=violet}") ;&lt;BR /&gt;&lt;BR /&gt;endcomp;&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;quit;&lt;BR /&gt;ods tagsets.excelxp close;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Oct 2017 15:42:24 GMT</pubDate>
    <dc:creator>plzsiga</dc:creator>
    <dc:date>2017-10-10T15:42:24Z</dc:date>
    <item>
      <title>Producing the same report for each instance of a variable</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Producing-the-same-report-for-each-instance-of-a-variable/m-p/402814#M19571</link>
      <description>&lt;P&gt;I can use this code to produce a report in and excel file for 1 of the 49 schools in my district.&amp;nbsp; I would like to be able to produce&amp;nbsp; separate excel files for each of the 49 schools that maintains the proc report features and picks up the school name (SchoolName1...schoolname2....Schoolname 49) in the both filename and the where statement.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is possible that some of the schools would have no data, and although I could send them an empty file, that would waste their time and mine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions, simplifications or alterations to the code would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ODS TAGSETS.EXCELXP&lt;BR /&gt;file='D:\ADAM\SAS Practice\sG 2018\byschool\ELASchoolName1.xls'&lt;BR /&gt;STYLE=minimal&lt;BR /&gt;OPTIONS ( Orientation = 'landscape'&lt;BR /&gt;FitToPage = 'yes'&lt;BR /&gt;Pages_FitWidth = '1'&lt;BR /&gt;Pages_FitHeight = '100' );&lt;BR /&gt;&lt;BR /&gt;Proc Report data=targela nowd ;&lt;BR /&gt;where&amp;nbsp; school eq 'SchoolName1';&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;column&amp;nbsp; Student&amp;nbsp; StudentId&amp;nbsp; Grade&amp;nbsp; School&amp;nbsp; ELA2017&amp;nbsp; ELALevel2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ELALeveL2017&amp;nbsp; EAL17&amp;nbsp; ProfDrop&amp;nbsp; BQELA&amp;nbsp; ELGtarget&amp;nbsp; ELAptsNeeded &amp;nbsp;&lt;BR /&gt;;&lt;BR /&gt;Define&amp;nbsp; Student/display;&lt;BR /&gt;Define&amp;nbsp; StudentId/display;&lt;BR /&gt;Define&amp;nbsp; Grade/display;&lt;BR /&gt;Define&amp;nbsp; School/display;&lt;BR /&gt;Define&amp;nbsp; ELA2017/display;&lt;BR /&gt;Define&amp;nbsp; ELALevel2016/display;&lt;BR /&gt;Define&amp;nbsp; ELALeveL2017/display;&lt;BR /&gt;Define&amp;nbsp; EAL17/display;&lt;BR /&gt;Define&amp;nbsp; ProfDrop/display;&lt;BR /&gt;Define&amp;nbsp; BQELA/display;&lt;BR /&gt;Define&amp;nbsp; ELGtarget/display;&lt;BR /&gt;Define&amp;nbsp; ELAptsNeeded/display;&lt;BR /&gt;&lt;BR /&gt;Compute&amp;nbsp; ELALevel2016;;&lt;BR /&gt;if ELALevel2016 = 1 then call define(_col_,"style","style={background=red}") ;&lt;BR /&gt;else if ELALevel2016 = 2 then call define(_col_,"style","style={background=yellow}") ;&lt;BR /&gt;else if ELALevel2016 = 3 then call define(_col_,"style","style={background=green}") ;&lt;BR /&gt;else if ELALevel2016 = 4 then call define(_col_,"style","style={background=blue}") ;&lt;BR /&gt;else if ELALevel2016 = 5 then call define(_col_,"style","style={background=violet}") ;&lt;BR /&gt;endcomp;&lt;BR /&gt;&lt;BR /&gt;Compute&amp;nbsp; ELALevel2017;;&lt;BR /&gt;if ELALevel2017 = 1 then call define(_col_,"style","style={background=red}") ;&lt;BR /&gt;else if ELALevel2017 = 2 then call define(_col_,"style","style={background=yellow}") ;&lt;BR /&gt;else if ELALevel2017 = 3 then call define(_col_,"style","style={background=green}") ;&lt;BR /&gt;else if ELALevel2017 = 4 then call define(_col_,"style","style={background=blue}") ;&lt;BR /&gt;else if ELALevel2017 = 5 then call define(_col_,"style","style={background=violet}") ;&lt;BR /&gt;endcomp;&lt;BR /&gt;&lt;BR /&gt;Compute&amp;nbsp; EAL17;;&lt;BR /&gt;if EAL17 = 1.1 then call define(_col_,"style","style={background=red}") ;&lt;BR /&gt;else if EAL17 = 1.2 then call define(_col_,"style","style={background=coral}") ;&lt;BR /&gt;else if EAL17 = 1.3 then call define(_col_,"style","style={background=pink}") ;&lt;BR /&gt;else if EAL17 = 2.1 then call define(_col_,"style","style={background=orange}") ;&lt;BR /&gt;else if EAL17 = 2.2 then call define(_col_,"style","style={background=yellow}") ;&lt;BR /&gt;else if EAL17 = 3 then call define(_col_,"style","style={background=green}") ;&lt;BR /&gt;else if EAL17 = 4 then call define(_col_,"style","style={background=blue}") ;&lt;BR /&gt;else if EAL17 = 5 then call define(_col_,"style","style={background=violet}") ;&lt;BR /&gt;&lt;BR /&gt;endcomp;&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;quit;&lt;BR /&gt;ods tagsets.excelxp close;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 15:42:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Producing-the-same-report-for-each-instance-of-a-variable/m-p/402814#M19571</guid>
      <dc:creator>plzsiga</dc:creator>
      <dc:date>2017-10-10T15:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: Producing the same report for each instance of a variable</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Producing-the-same-report-for-each-instance-of-a-variable/m-p/402818#M19572</link>
      <description>&lt;P&gt;Use a macro.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See the examples here on how to create a macro:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stats.idre.ucla.edu/sas/seminars/sas-macros-introduction/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/seminars/sas-macros-introduction/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example of how you can deal with an 'empty' data set:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=p011imau3tm4jen1us2a45cyenz9.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=p011imau3tm4jen1us2a45cyenz9.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 15:51:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Producing-the-same-report-for-each-instance-of-a-variable/m-p/402818#M19572</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-10T15:51:30Z</dc:date>
    </item>
  </channel>
</rss>

