<?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: proc report use indent format in compute statement in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-use-indent-format-in-compute-statement/m-p/827794#M81971</link>
    <description>&lt;P&gt;The stuff coming after the slash in the COMPUTE statement has declarative character and is evaluated when the procedure is prepared for execution. But you can make the position in the LINE statement dynamic (similar to a PUT statement in a data step), but you need to create an &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;in&lt;/STRONG&gt;&lt;/FONT&gt;format to get a numeric value first:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
  invalue indsex
  'M'=20
  'F'=40
  ;
run;

proc report data=class nowd;
  column _all_;
  define sex  /noprint order order=data;
  compute before sex;
    __tmp = input(sex,indsex.);
    line @__tmp sex $;
  endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 09 Aug 2022 10:08:01 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2022-08-09T10:08:01Z</dc:date>
    <item>
      <title>proc report use indent format in compute statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-use-indent-format-in-compute-statement/m-p/827743#M81970</link>
      <description>&lt;P&gt;I want to custom indentation in compute statement of proc report. My code is like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.class out=class;
  by sex;
run;

proc format;
  value $indsex
  'M'=20
  'F'=40
  ;
run;

proc report data=class nowd;
  column _all_;
  define sex  /noprint order order=data;
  compute before sex/style={indent=$indsex.};
    line @1 sex $;
  endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It doesn't work.&lt;/P&gt;
&lt;P&gt;I know there is if statement can be used in compute block to solve this, but why indent=$format. just doesn't work?&lt;/P&gt;
&lt;P&gt;Thanks for any hints.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 04:05:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-use-indent-format-in-compute-statement/m-p/827743#M81970</guid>
      <dc:creator>whymath</dc:creator>
      <dc:date>2022-08-09T04:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: proc report use indent format in compute statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-use-indent-format-in-compute-statement/m-p/827794#M81971</link>
      <description>&lt;P&gt;The stuff coming after the slash in the COMPUTE statement has declarative character and is evaluated when the procedure is prepared for execution. But you can make the position in the LINE statement dynamic (similar to a PUT statement in a data step), but you need to create an &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;in&lt;/STRONG&gt;&lt;/FONT&gt;format to get a numeric value first:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
  invalue indsex
  'M'=20
  'F'=40
  ;
run;

proc report data=class nowd;
  column _all_;
  define sex  /noprint order order=data;
  compute before sex;
    __tmp = input(sex,indsex.);
    line @__tmp sex $;
  endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Aug 2022 10:08:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-use-indent-format-in-compute-statement/m-p/827794#M81971</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-08-09T10:08:01Z</dc:date>
    </item>
  </channel>
</rss>

