<?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: how to call a format in the datastep in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-call-a-format-in-the-datastep/m-p/405491#M98658</link>
    <description>&lt;P&gt;can i sort the formatted character value on basis of numeric.&lt;/P&gt;&lt;P&gt;For example&amp;nbsp;&lt;SPAN&gt;format num_val ncodes.; is there anyway i can sort on basis of numeric values?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Oct 2017 12:14:46 GMT</pubDate>
    <dc:creator>mj5</dc:creator>
    <dc:date>2017-10-19T12:14:46Z</dc:date>
    <item>
      <title>how to call a format in the datastep</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-call-a-format-in-the-datastep/m-p/405435#M98637</link>
      <description>&lt;PRE&gt;DATA temp1;
  input subj 1-4 num_val 6 result $8-20 ;
  DATALINES;
1024 1 manual 
1167 1 manual 
1168 2 testing 
1201 2 testing 
1302 3 plain
1302 4 natural
;

data fmtdata;
  set temp1 (rename=(num_val=start result=label));
  by start;
  retain fmtname 'ncodes' type 'N';
  if first.start;
run;

proc format cntlin = fmtdata;
run;&lt;/PRE&gt;&lt;P&gt;How to call the format?&lt;/P&gt;&lt;P&gt;I am using format num_val $ncodes.;&lt;/P&gt;&lt;P&gt;But it doesnt work&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 07:57:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-call-a-format-in-the-datastep/m-p/405435#M98637</guid>
      <dc:creator>mj5</dc:creator>
      <dc:date>2017-10-19T07:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to call a format in the datastep</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-call-a-format-in-the-datastep/m-p/405436#M98638</link>
      <description>&lt;P&gt;You've created ncodes as a numeric format - it's character formats which have the $ sign at the start so drop that and you should be fine.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 08:11:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-call-a-format-in-the-datastep/m-p/405436#M98638</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2017-10-19T08:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to call a format in the datastep</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-call-a-format-in-the-datastep/m-p/405437#M98639</link>
      <description>&lt;P&gt;Thanks, Can the length be increased for the format name for fmtname as the formats are getting truncated&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 08:18:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-call-a-format-in-the-datastep/m-p/405437#M98639</guid>
      <dc:creator>mj5</dc:creator>
      <dc:date>2017-10-19T08:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to call a format in the datastep</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-call-a-format-in-the-datastep/m-p/405438#M98640</link>
      <description>&lt;P&gt;You shouldn't really need to do that - can you post the data and code you're using to apply the format?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 08:20:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-call-a-format-in-the-datastep/m-p/405438#M98640</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2017-10-19T08:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to call a format in the datastep</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-call-a-format-in-the-datastep/m-p/405485#M98657</link>
      <description>&lt;P&gt;You can control the number of characters of the formatted value that print.&amp;nbsp; All of these would be legitimate uses of the same format:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;format num_val ncodes.;&lt;/P&gt;
&lt;P&gt;format num_val ncodes4.;&lt;/P&gt;
&lt;P&gt;format num_val ncodes8.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's the reason that you can't create a format name ending in a digit ... it gives you the flexibility later to add a width when applying the format.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 11:59:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-call-a-format-in-the-datastep/m-p/405485#M98657</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-10-19T11:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to call a format in the datastep</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-call-a-format-in-the-datastep/m-p/405491#M98658</link>
      <description>&lt;P&gt;can i sort the formatted character value on basis of numeric.&lt;/P&gt;&lt;P&gt;For example&amp;nbsp;&lt;SPAN&gt;format num_val ncodes.; is there anyway i can sort on basis of numeric values?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 12:14:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-call-a-format-in-the-datastep/m-p/405491#M98658</guid>
      <dc:creator>mj5</dc:creator>
      <dc:date>2017-10-19T12:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to call a format in the datastep</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-call-a-format-in-the-datastep/m-p/405509#M98664</link>
      <description>&lt;P&gt;proc sort will use the raw, unformatted value of a variable. If you want to sort by formatted values, create a new variable that holds those formatted values and sort by that.&lt;/P&gt;
&lt;P&gt;Certain SAS procedures can be told to use formatted values in their calculations (ie proc freq).&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 12:54:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-call-a-format-in-the-datastep/m-p/405509#M98664</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-10-19T12:54:59Z</dc:date>
    </item>
  </channel>
</rss>

