<?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: Add new column  in proc report in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Add-new-column-in-proc-report/m-p/706938#M26420</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods pdf notoc file="F:\Brugere\MMEA\hey1.pdf" ;
proc report data=pdf1 nowd;
column teststed analysebeskrivelse dato Ledigtid Nærekontakter åbnetesttilbud;
define teststed/display;
define Ledigtid/ display;
define Nærekontakter/computed;
define åbnetesttilbud/computed;
compute Ledigtid;
    if Ledigtid = "&amp;gt;10%" then call define(_col_,"style","style={background=green}");
	if Ledigtid = "&amp;lt;10%" then call define(_col_,"style","style={background=red}"); 
endcomp;
compute Nærekontakter;
    if find(teststed,'Nære kontakter')&amp;gt;0 or find(analysebeskrivelse,'Nære kontakter')&amp;gt;0 then do;

        Nærekontakter=ledigtid;
        if Ledigtid = "&amp;gt;10%" then call define(_col_,"style","style={background=green}");
	    if Ledigtid = "&amp;lt;10%" then call define(_col_,"style","style={background=red}"); 
    end;
endcomp;
compute åbnetesttilbud;
if find(analysebeskrivelse,'Virustest')&amp;gt;0  then do;

        åbnetesttilbud=ledigtid;
        if Ledigtid = "&amp;gt;10%" then call define(_col_,"style","style={background=green}");
	    if Ledigtid = "&amp;lt;10%" then call define(_col_,"style","style={background=red}"); 
	

    end;
endcomp;

run;

ods pdf close;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I added the XX (called nære kontakter) and YY (åbne testetilbud)&lt;/P&gt;&lt;P&gt;I now get two new columns with the matching color basedon ledigtid, but i still want the text "&amp;lt;10%" etc in the new columns&lt;/P&gt;</description>
    <pubDate>Fri, 18 Dec 2020 12:53:07 GMT</pubDate>
    <dc:creator>mmea</dc:creator>
    <dc:date>2020-12-18T12:53:07Z</dc:date>
    <item>
      <title>Add new column  in proc report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-new-column-in-proc-report/m-p/706924#M26410</link>
      <description>&lt;P&gt;Hi. with this code I made a proc report:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods pdf notoc file="F:\Brugere\MMEA\hej.pdf" ;
proc report data=pdf1 nowd;
column teststed analysebeskrivelse dato Ledigtid;
define teststed/display;
define Ledigtid/ display;
compute Ledigtid;
    if Ledigtid = "&amp;gt;10%" then call define(_col_,"style","style={background=green}");
	if Ledigtid = "&amp;lt;10%" then call define(_col_,"style","style={background=red}"); 
endcomp;

run;

ods pdf close;


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This code gives me this report (I have just cut out a small piece):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mmea_0-1608291675582.png"&gt;&lt;img src="https://communities.sas.com/skins/images/2FD96521DCF95C42FE57BF2A7CB72678/responsive_peak/images/image_not_found.png" alt="mmea_0-1608291675582.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to make new columns called fx "XX" and "YY". Column "XX" should contain all the values and colors of "Ledigtid" for those in "analysebeskrivelse" or "Teststed" who has the characters 'Nære kontakter' in the name. Anything else should be in "YY".&lt;/P&gt;&lt;P&gt;So i want the colors green and red match with the new columns I want to make based on the names from Teststed.&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;Does it make sense?&lt;/P&gt;&lt;P&gt;I hope so &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 11:49:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-new-column-in-proc-report/m-p/706924#M26410</guid>
      <dc:creator>mmea</dc:creator>
      <dc:date>2020-12-18T11:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Add new column  in proc report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-new-column-in-proc-report/m-p/706926#M26411</link>
      <description>&lt;P&gt;Can you please provide a larger screen capture so I can read the text? It's too small right now.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 11:52:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-new-column-in-proc-report/m-p/706926#M26411</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-12-18T11:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: Add new column  in proc report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-new-column-in-proc-report/m-p/706928#M26412</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mmea_0-1608292420165.png"&gt;&lt;img src="https://communities.sas.com/skins/images/2FD96521DCF95C42FE57BF2A7CB72678/responsive_peak/images/image_not_found.png" alt="mmea_0-1608292420165.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 11:53:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-new-column-in-proc-report/m-p/706928#M26412</guid>
      <dc:creator>mmea</dc:creator>
      <dc:date>2020-12-18T11:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: Add new column  in proc report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-new-column-in-proc-report/m-p/706932#M26414</link>
      <description>&lt;P&gt;Untested code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods pdf notoc file="F:\Brugere\MMEA\hej.pdf" ;
proc report data=pdf1 nowd;
column teststed analysebeskrivelse dato Ledigtid xx;
define teststed/display;
define Ledigtid/ display;
define xx/computed;
compute Ledigtid;
    if Ledigtid = "&amp;gt;10%" then call define(_col_,"style","style={background=green}");
	if Ledigtid = "&amp;lt;10%" then call define(_col_,"style","style={background=red}"); 
endcomp;
compute xx;
    if find(teststed,'Nære kontakter')&amp;gt;0 or find(analysebeskrivelse,'Nære kontakter')&amp;gt;0 then do;

        xx=ledigtid;
        if Ledigtid = "&amp;gt;10%" then call define(_col_,"style","style={background=green}");
	    if Ledigtid = "&amp;lt;10%" then call define(_col_,"style","style={background=red}"); 
    end;
endcomp;
run;

ods pdf close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;YY would be similar, so its a homework assignment for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 12:29:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-new-column-in-proc-report/m-p/706932#M26414</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-12-18T12:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: Add new column  in proc report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-new-column-in-proc-report/m-p/706933#M26415</link>
      <description>&lt;P&gt;thank you so much.&lt;/P&gt;&lt;P&gt;For YY then I should say if not "Nære kontakter"? I am quite new in SAS&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 12:34:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-new-column-in-proc-report/m-p/706933#M26415</guid>
      <dc:creator>mmea</dc:creator>
      <dc:date>2020-12-18T12:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: Add new column  in proc report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-new-column-in-proc-report/m-p/706935#M26417</link>
      <description>&lt;P&gt;I fixed it!&lt;/P&gt;&lt;P&gt;The only thing is that the text "&amp;gt;10%" etc. do not come with just the color&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 12:37:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-new-column-in-proc-report/m-p/706935#M26417</guid>
      <dc:creator>mmea</dc:creator>
      <dc:date>2020-12-18T12:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: Add new column  in proc report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-new-column-in-proc-report/m-p/706937#M26419</link>
      <description>&lt;P&gt;Show us the code you used. Please paste your code as text into the box that appears when you click on the "running man" icon.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 12:50:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-new-column-in-proc-report/m-p/706937#M26419</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-12-18T12:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Add new column  in proc report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-new-column-in-proc-report/m-p/706938#M26420</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods pdf notoc file="F:\Brugere\MMEA\hey1.pdf" ;
proc report data=pdf1 nowd;
column teststed analysebeskrivelse dato Ledigtid Nærekontakter åbnetesttilbud;
define teststed/display;
define Ledigtid/ display;
define Nærekontakter/computed;
define åbnetesttilbud/computed;
compute Ledigtid;
    if Ledigtid = "&amp;gt;10%" then call define(_col_,"style","style={background=green}");
	if Ledigtid = "&amp;lt;10%" then call define(_col_,"style","style={background=red}"); 
endcomp;
compute Nærekontakter;
    if find(teststed,'Nære kontakter')&amp;gt;0 or find(analysebeskrivelse,'Nære kontakter')&amp;gt;0 then do;

        Nærekontakter=ledigtid;
        if Ledigtid = "&amp;gt;10%" then call define(_col_,"style","style={background=green}");
	    if Ledigtid = "&amp;lt;10%" then call define(_col_,"style","style={background=red}"); 
    end;
endcomp;
compute åbnetesttilbud;
if find(analysebeskrivelse,'Virustest')&amp;gt;0  then do;

        åbnetesttilbud=ledigtid;
        if Ledigtid = "&amp;gt;10%" then call define(_col_,"style","style={background=green}");
	    if Ledigtid = "&amp;lt;10%" then call define(_col_,"style","style={background=red}"); 
	

    end;
endcomp;

run;

ods pdf close;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I added the XX (called nære kontakter) and YY (åbne testetilbud)&lt;/P&gt;&lt;P&gt;I now get two new columns with the matching color basedon ledigtid, but i still want the text "&amp;lt;10%" etc in the new columns&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 12:53:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-new-column-in-proc-report/m-p/706938#M26420</guid>
      <dc:creator>mmea</dc:creator>
      <dc:date>2020-12-18T12:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: Add new column  in proc report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-new-column-in-proc-report/m-p/706940#M26421</link>
      <description>&lt;P&gt;Probably my mistake, I think you should have&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;compute Nærekontakter/character;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;compute åbnetesttilbud/character;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I may be so bold as to suggest a style improvement — I find that colors red and green are too bold and too overwhelming and makes the text hard to read. (Maybe you feel the same, or maybe not ... its a personal thing, I guess). So I use the following&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;"style={background=lightmoderategreen}"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;"style={background=lightmoderatered}"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which makes a better looking output, in my opinion.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 13:08:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-new-column-in-proc-report/m-p/706940#M26421</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-12-18T13:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: Add new column  in proc report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-new-column-in-proc-report/m-p/706948#M26423</link>
      <description>&lt;P&gt;Thank you so much it worked!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know if you can add to you code, that you before running the PDF you want to remove some of the columns?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=pdf1 nowd;
column teststed analysebeskrivelse dato Ledigtid Nærekontakter åbnetesttilbud;
define teststed/display;
define Ledigtid/ display;
define Nærekontakter/computed;
define åbnetesttilbud/computed;
compute Ledigtid;
    if Ledigtid = "&amp;gt;10%" then call define(_col_,"style","style={background=green}");
	if Ledigtid = "&amp;lt;10%" then call define(_col_,"style","style={background=red}"); 
endcomp;
compute Nærekontakter/character;
    if find(teststed,'Nære kontakter')&amp;gt;0 or find(analysebeskrivelse,'Nære kontakter')&amp;gt;0 then do;

        Nærekontakter=ledigtid;
        if Ledigtid = "&amp;gt;10%" then call define(_col_,"style","style={background=green}");
	    if Ledigtid = "&amp;lt;10%" then call define(_col_,"style","style={background=red}"); 
    end;
endcomp;
compute åbnetesttilbud/character;
if find(analysebeskrivelse,'Virustest')&amp;gt;0  then do;

        åbnetesttilbud=ledigtid;
        if Ledigtid = "&amp;gt;10%" then call define(_col_,"style","style={background=green}");
	    if Ledigtid = "&amp;lt;10%" then call define(_col_,"style","style={background=red}"); 
	

    end;
endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I use ledigtid and analysebeskrivelse in my statements, but I dont want them in my final report. Can I remove them?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 14:10:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-new-column-in-proc-report/m-p/706948#M26423</guid>
      <dc:creator>mmea</dc:creator>
      <dc:date>2020-12-18T14:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Add new column  in proc report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-new-column-in-proc-report/m-p/706955#M26424</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;define ledigtid/noprint;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 18 Dec 2020 14:27:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-new-column-in-proc-report/m-p/706955#M26424</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-12-18T14:27:07Z</dc:date>
    </item>
  </channel>
</rss>

