<?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 format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-format/m-p/801938#M315652</link>
    <description>&lt;P&gt;To answer you detailed question, yes the RANGE dataset is being made just from that data step.&amp;nbsp; The OUTPUT statements are what is writing the observations to the dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should look further down in the program to see what the RANGE dataset is going to be used for.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We can make a guess.&amp;nbsp; It looks like it is assigning a numeric value for each of the series of text strings.&amp;nbsp; So most likely it will be used to make sure those text strings can be sorted into the right order in some future report somewhere.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note there is no need to add periods to the lengths specified in the LENGTH statement.&amp;nbsp; SAS variables can only have integer lengths.&lt;/P&gt;</description>
    <pubDate>Mon, 14 Mar 2022 14:08:16 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2022-03-14T14:08:16Z</dc:date>
    <item>
      <title>proc format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-format/m-p/801903#M315631</link>
      <description>&lt;PRE&gt;proc format;
value scorefmt
low-539 ="SCORE&amp;lt;540"
540-559="540&amp;lt;=SCORE&amp;lt;560"
560-579="560&amp;lt;=SCORE&amp;lt;580";
run;

data Range;
length SCORE_LBL $15. Sort_order 8.;

SCORE_LBL="SCORE&amp;lt;540"; Sort_order=1;output;
SCORE_LBL="540&amp;lt;=SCORE&amp;lt;560"; Sort_order=2;output;
SCORE_LBL="560&amp;lt;=SCORE&amp;lt;580"; Sort_order=3;output;
SCORE_LBL="580&amp;lt;=SCORE&amp;lt;600"; Sort_order=4;output;
SCORE_LBL="600&amp;lt;=SCORE&amp;lt;620"; Sort_order=5;output;
;
run;

proc print data=Range;
run;&lt;/PRE&gt;
&lt;P&gt;I have some proc format code. my question is, is the programs creating the variable SCORE_LBL&amp;nbsp; and Sort_order from nothing? there is no input data set and dataset Range is created. so What is happening in the proc format code? where does score_lbl or is it an assumption for later use if we feed in scores...?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 07:33:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-format/m-p/801903#M315631</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2022-03-14T07:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: proc format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-format/m-p/801912#M315638</link>
      <description>&lt;P&gt;Since the FORMAT is not used anywhere in the Data step it has absolutely nothing to do with the contents of the data set Range.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would have to see Scorefmt. used somewhere for the format to be used. Either in a FORMAT, ATTRIB or PUT statement most likely.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The data step is a way to create data that contains the character values desired for a variable named Score_lbl and a numeric variable named order. The OUTPUT writes each set of values to the data set Range.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 09:57:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-format/m-p/801912#M315638</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-03-14T09:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: proc format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-format/m-p/801915#M315639</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/416388"&gt;@HeatherNewton&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Proc Format Step creates a SAS format with the name &lt;EM&gt;scorefmt&lt;/EM&gt;. The format is used to display variable values translated to (in this case) one of 3 categories, so any value lower than 540 is displayed as "SCORE&amp;lt;540".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Data Step is not using the created format. It creates a data set with 5 rows, each containing a text variable with a category text similar to the category text used in the format, but here 5 categories instead of the 3 in the format. The table is then printed, but apart from that in can't be used to anything, so it makes no sense. The categories&amp;nbsp; must be implemented as a format to be of any use.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 10:07:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-format/m-p/801915#M315639</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2022-03-14T10:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: proc format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-format/m-p/801938#M315652</link>
      <description>&lt;P&gt;To answer you detailed question, yes the RANGE dataset is being made just from that data step.&amp;nbsp; The OUTPUT statements are what is writing the observations to the dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should look further down in the program to see what the RANGE dataset is going to be used for.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We can make a guess.&amp;nbsp; It looks like it is assigning a numeric value for each of the series of text strings.&amp;nbsp; So most likely it will be used to make sure those text strings can be sorted into the right order in some future report somewhere.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note there is no need to add periods to the lengths specified in the LENGTH statement.&amp;nbsp; SAS variables can only have integer lengths.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 14:08:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-format/m-p/801938#M315652</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-03-14T14:08:16Z</dc:date>
    </item>
  </channel>
</rss>

