<?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: Building a field with proc report in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Building-a-field-with-proc-report/m-p/106143#M9884</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tk's!! Cynthia!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Aug 2012 14:40:43 GMT</pubDate>
    <dc:creator>Abud</dc:creator>
    <dc:date>2012-08-29T14:40:43Z</dc:date>
    <item>
      <title>Building a field with proc report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Building-a-field-with-proc-report/m-p/106141#M9882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everybody!&lt;/P&gt;&lt;P&gt;Can I build a field with the function SUBSTR in the proc report ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;I'm trying to do something like this, but it doesn't working.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc report data=rsm_negs;&lt;/P&gt;&lt;P&gt;col Mercado Qtd Fin papel;&lt;/P&gt;&lt;P&gt;define Mercado / group;&lt;/P&gt;&lt;P&gt;define qtd / sum;&lt;/P&gt;&lt;P&gt;define fin / sum;&lt;/P&gt;&lt;P&gt;define mercadoria / group computed;&lt;/P&gt;&lt;P&gt;compute mercadoria;&lt;/P&gt;&lt;P&gt; mercadoria = substr(Papel,1,3);&lt;/P&gt;&lt;P&gt;endcomp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tk's in advanced!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2012 15:54:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Building-a-field-with-proc-report/m-p/106141#M9882</guid>
      <dc:creator>Abud</dc:creator>
      <dc:date>2012-08-28T15:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: Building a field with proc report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Building-a-field-with-proc-report/m-p/106142#M9883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; The left to right order of your items in the COLUMN statement will be important.&amp;nbsp; I do not see MERCADORIA in your COLUMN statement and I am not on a system where I have SAS to test with, but if you had this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;col Mercado Qtd Fin &lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;papel&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #3366ff;"&gt;&lt;STRONG&gt;mercadoria&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with MERCADORIA appearing after PAPEL in the COLUMN statement, then you should be able to do this in a COMPUTE block:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;define mercadoria / computed "Mercadoria";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;compute mercadoria / character length=3;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; mercadoria = substr(Papel,1,3);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;endcomp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;You cannot have a usage of GROUP -and- COMPUTED in your DEFINE statement for MERCADORIA. So if you need to collapse rows for summarizing based on the first 3 characters of PAPEL, you might need to create MERCADORIA as a variable in your dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2012 18:56:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Building-a-field-with-proc-report/m-p/106142#M9883</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2012-08-28T18:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Building a field with proc report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Building-a-field-with-proc-report/m-p/106143#M9884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tk's!! Cynthia!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2012 14:40:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Building-a-field-with-proc-report/m-p/106143#M9884</guid>
      <dc:creator>Abud</dc:creator>
      <dc:date>2012-08-29T14:40:43Z</dc:date>
    </item>
  </channel>
</rss>

