<?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 Can I combine proc ranks with proc format then save it into a new dataset? in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Can-I-combine-proc-ranks-with-proc-format-then-save-it-into-a/m-p/724945#M9881</link>
    <description>&lt;P&gt;I have a dataset that i need to find the quartiles for one variable then change the numbers of the quartiles into words (assign low to 0, mid-low to 1, etc...). I am not sure how to combine both and then save it to a new dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data mydata;&lt;/P&gt;&lt;P&gt;input var1 income population percentage;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1 500 60 100%&lt;/P&gt;&lt;P&gt;2 400 70 90%&lt;/P&gt;&lt;P&gt;3 400 100 80%&lt;/P&gt;&lt;P&gt;4 800 222 80%&lt;/P&gt;&lt;P&gt;5 500 100 75%&lt;/P&gt;&lt;P&gt;6 600 213 70%&lt;/P&gt;&lt;P&gt;7 900 900 60%&lt;/P&gt;&lt;P&gt;8 1000 909 50%&lt;/P&gt;&lt;P&gt;9 100 600 40%&lt;/P&gt;&lt;P&gt;10 760 235 20%&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc rank data=mydata groups=4 out=want;&lt;BR /&gt;var percentage;&lt;BR /&gt;ranks quartiles;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried adding the proc format to the variable quartiles but i failed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Tue, 09 Mar 2021 18:52:33 GMT</pubDate>
    <dc:creator>jude1</dc:creator>
    <dc:date>2021-03-09T18:52:33Z</dc:date>
    <item>
      <title>Can I combine proc ranks with proc format then save it into a new dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Can-I-combine-proc-ranks-with-proc-format-then-save-it-into-a/m-p/724945#M9881</link>
      <description>&lt;P&gt;I have a dataset that i need to find the quartiles for one variable then change the numbers of the quartiles into words (assign low to 0, mid-low to 1, etc...). I am not sure how to combine both and then save it to a new dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data mydata;&lt;/P&gt;&lt;P&gt;input var1 income population percentage;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1 500 60 100%&lt;/P&gt;&lt;P&gt;2 400 70 90%&lt;/P&gt;&lt;P&gt;3 400 100 80%&lt;/P&gt;&lt;P&gt;4 800 222 80%&lt;/P&gt;&lt;P&gt;5 500 100 75%&lt;/P&gt;&lt;P&gt;6 600 213 70%&lt;/P&gt;&lt;P&gt;7 900 900 60%&lt;/P&gt;&lt;P&gt;8 1000 909 50%&lt;/P&gt;&lt;P&gt;9 100 600 40%&lt;/P&gt;&lt;P&gt;10 760 235 20%&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc rank data=mydata groups=4 out=want;&lt;BR /&gt;var percentage;&lt;BR /&gt;ranks quartiles;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried adding the proc format to the variable quartiles but i failed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 18:52:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Can-I-combine-proc-ranks-with-proc-format-then-save-it-into-a/m-p/724945#M9881</guid>
      <dc:creator>jude1</dc:creator>
      <dc:date>2021-03-09T18:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Can I combine proc ranks with proc format then save it into a new dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Can-I-combine-proc-ranks-with-proc-format-then-save-it-into-a/m-p/724946#M9882</link>
      <description>&lt;P&gt;Again, I request that you provide your data as working code, that does what you want; and not code that kinda sorta gets close to what you want but doesn't really work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is how to use custom formats with PROC RANK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
    value rankf 0='Low'; /* I'm lazy, you type the rest */
run;
proc rank data=mydata groups=4 out=want;
    var percentage;
    ranks quartiles;
    format quartiles rankf.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 18:59:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Can-I-combine-proc-ranks-with-proc-format-then-save-it-into-a/m-p/724946#M9882</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-03-09T18:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Can I combine proc ranks with proc format then save it into a new dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Can-I-combine-proc-ranks-with-proc-format-then-save-it-into-a/m-p/724948#M9883</link>
      <description>&lt;UL&gt;
&lt;LI&gt;What variable specifically are you trying to attach a format to?&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;What format are you trying to attach it?&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;How did you define the format?&lt;/LI&gt;
&lt;LI&gt;How did you try to attach the format to the variable?&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 09 Mar 2021 18:58:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Can-I-combine-proc-ranks-with-proc-format-then-save-it-into-a/m-p/724948#M9883</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-03-09T18:58:51Z</dc:date>
    </item>
  </channel>
</rss>

