<?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: Formats error in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Formats-error/m-p/129100#M35210</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;N comes before Y so the default order works and didn't need the prefacing 1 and 2. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Sep 2012 17:54:16 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2012-09-24T17:54:16Z</dc:date>
    <item>
      <title>Formats error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formats-error/m-p/129091#M35201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi Team,&lt;BR /&gt;I learnt a couple of days ago from the Forum about getting the outputs in the order of the format applied and not alphabetically which is usually the case&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;.(by using numbers in the front as shown&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;VALUE $Bikes&lt;/P&gt;&lt;P&gt;"N"="1-Suzuki-"&lt;/P&gt;&lt;P&gt;"Y"="2-Suzuki+"&lt;/P&gt;&lt;P&gt;"F"="3-Foam"&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting the&lt;STRONG&gt; output&lt;/STRONG&gt; as :&lt;/P&gt;&lt;P&gt;3-Foam&lt;/P&gt;&lt;P&gt;1-Suzuki-&lt;/P&gt;&lt;P&gt;2-Suzuki+&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why is the 3 coming at the first place?????????&lt;/P&gt;&lt;P&gt;Could anyone help me solve this problem please&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2012 14:46:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formats-error/m-p/129091#M35201</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2012-09-24T14:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: Formats error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formats-error/m-p/129092#M35202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Which procedure are using and what options? For example Proc tabulate has order= options of formatted, data, freq and unformatted as options which can also be affected by using class options of ascending, descending or groupinternal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2012 14:53:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formats-error/m-p/129092#M35202</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-09-24T14:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Formats error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formats-error/m-p/129093#M35203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First I wrote a format.&lt;/P&gt;&lt;P&gt;Then I applied it in the datastep for example:&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;format var $BIKES.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;Later I&amp;nbsp; am using the HAVE dataset in the Proc freq with ODS option to get a Pdf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I was thinking irrespective of the procedure I use since I put 1,2 and 3. I should get it in that order...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2012 15:05:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formats-error/m-p/129093#M35203</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2012-09-24T15:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Formats error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formats-error/m-p/129094#M35204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;VALUE $Bikes&lt;/P&gt;&lt;P&gt;"N"="1-Suzuki-"&lt;/P&gt;&lt;P&gt;"Y"="2-Suzuki+"&lt;/P&gt;&lt;P&gt;"F"="3-Foam";&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input bike $ @@;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;Y N Y F F Y N&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;proc freq data=have &lt;SPAN style="color: #ff0000;"&gt;order=formatted;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; tables bike;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; format bike $bikes.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2012 15:27:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formats-error/m-p/129094#M35204</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-09-24T15:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: Formats error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formats-error/m-p/129095#M35205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Linlin,&lt;/P&gt;&lt;P&gt;This code works. But do I have to use the format stmnt only in the freq step? cant i use in the datastep and get the job done?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2012 15:33:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formats-error/m-p/129095#M35205</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2012-09-24T15:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Formats error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formats-error/m-p/129096#M35206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why I am asking that question is that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fOR FORMAT LIKE THIS IT WORKED PERFECT. i MEAN 1 COMES BEFORE 2.&lt;/P&gt;&lt;P&gt;wITH THE EARLIER EXAMPLE( WITH 1 2 AND 3)&amp;nbsp; IT WORKS WIRED&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VALUE $COBRA&lt;/P&gt;&lt;P&gt;"N"="1- COB-"&lt;/P&gt;&lt;P&gt;"Y"="2- COB+"&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2012 15:38:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formats-error/m-p/129096#M35206</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2012-09-24T15:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: Formats error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formats-error/m-p/129097#M35207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Linlin,&lt;/P&gt;&lt;P&gt;If you dont mind could you also help me interpret the code for the other question I posted today.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2012 15:43:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formats-error/m-p/129097#M35207</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2012-09-24T15:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Formats error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formats-error/m-p/129098#M35208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ALSO:&lt;/P&gt;&lt;P&gt;If there are 20 variables like shown (few) below do I need to keep on doing what I did or is there any short cut method to do this??????&lt;/P&gt;&lt;P&gt;$DIA to be applied on DIA variable&lt;/P&gt;&lt;P&gt;$COBRA to be applied on COBRA variable.so on&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VALUE $DIA&lt;/P&gt;&lt;P&gt;"N"="1- Dia-"&lt;/P&gt;&lt;P&gt;"Y"="2- Dia+"&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VALUE $COBRA&lt;/P&gt;&lt;P&gt;"N"="1- COB-"&lt;/P&gt;&lt;P&gt;"Y"="2- COB+"&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;VALUE $CAB&lt;/P&gt;&lt;P&gt;"N"="1- Cabr-"&lt;/P&gt;&lt;P&gt;"Y"="2- Cab+"&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;VALUE $HITECH&lt;/P&gt;&lt;P&gt;"N"="1- Hit-"&lt;/P&gt;&lt;P&gt;"Y"="2- Hit+"&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;VALUE $PULL&lt;/P&gt;&lt;P&gt;"N"="1- Pull-"&lt;/P&gt;&lt;P&gt;"Y"="2- Pull+"&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2012 15:50:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formats-error/m-p/129098#M35208</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2012-09-24T15:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Formats error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formats-error/m-p/129099#M35209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Data step repeats the order the data is read as it processes one record at a time (generally) when using the set statement or reading an external file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However the format doesn't need to be added as you did. Notice that Linlin's solution does not use your set "want".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2012 17:53:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formats-error/m-p/129099#M35209</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-09-24T17:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: Formats error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formats-error/m-p/129100#M35210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;N comes before Y so the default order works and didn't need the prefacing 1 and 2. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2012 17:54:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formats-error/m-p/129100#M35210</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-09-24T17:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Formats error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formats-error/m-p/129101#M35211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Again, the "N" will come before "Y" so the prefaces won't be needed unless you are going to force output to use the formatted option.&lt;/P&gt;&lt;P&gt;Ordering output sometimes is something to consider when creating coding schemes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2012 17:56:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formats-error/m-p/129101#M35211</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-09-24T17:56:31Z</dc:date>
    </item>
  </channel>
</rss>

