<?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: Create dynamic format for use in proc report in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-dynamic-format-for-use-in-proc-report/m-p/224857#M14303</link>
    <description>&lt;P&gt;Thanks, Stevyfargose. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I will try that - I am not tied to proc format, but I do need to figure out how to dynamically create a collapsed&amp;nbsp;"other" category (I don't want to hard code anything because the country names will change from month to month, and so will the counts associated with them).&lt;/P&gt;</description>
    <pubDate>Wed, 09 Sep 2015 21:52:07 GMT</pubDate>
    <dc:creator>LoriK</dc:creator>
    <dc:date>2015-09-09T21:52:07Z</dc:date>
    <item>
      <title>Create dynamic format for use in proc report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-dynamic-format-for-use-in-proc-report/m-p/224844#M14301</link>
      <description>&lt;P&gt;In SAS 9.3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm creating a table in Proc Report and would like to display the&amp;nbsp;values for a variable named "country" with all values (country names and their corresponding counts) displayed unless the country&amp;nbsp;represents &amp;lt;20% of the total count. &amp;nbsp;My dataset is huge, so I've created a sample of the data for illustration. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAMPLE DATA&lt;/P&gt;&lt;P&gt;PersonID &amp;nbsp; country &amp;nbsp; &amp;nbsp; &amp;nbsp;count &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Australia &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; USA &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1 &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Australia &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Canada &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Canada &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;6 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Canada &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Germany &amp;nbsp; &amp;nbsp;1 &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created new variable "countrycount" to sum totals for each country.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sql /*noprint */;&lt;BR /&gt;create table finalsql as&lt;BR /&gt;select * , sum(count) as countrycount label='Country Count'&lt;BR /&gt;from final&lt;BR /&gt;group by country&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to give me output:&lt;/P&gt;&lt;P&gt;PersonID &amp;nbsp; country &amp;nbsp; &amp;nbsp; &amp;nbsp;count &amp;nbsp; &amp;nbsp;countrycount &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Australia &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; USA &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Australia &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Canada &amp;nbsp; &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Canada &amp;nbsp; &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;6 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Canada &amp;nbsp; &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Germany &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to show a table where Canada and Australia are displayed, and USA and Germany are collapsed into the 'other' category. &amp;nbsp;I'd like to display the total counts by country, like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TABLE&lt;/P&gt;&lt;P&gt;Country &amp;nbsp; &amp;nbsp;Total&lt;/P&gt;&lt;P&gt;Canada &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;Australia &amp;nbsp; 2&lt;/P&gt;&lt;P&gt;Other &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to automate report generation, and the arrival data will be changing monthly, so&amp;nbsp;I need a dynamic process to collapse countries into the "other" category. &amp;nbsp;Is there a way to create a format that would essentially work like this? My challenge is to create a format based on the values from two variables, one character and one numeric.&amp;nbsp;&amp;nbsp;OR is there another way to do this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;/*I realize this wouldn't actually work in proc format - hope it helps&amp;nbsp;explains&amp;nbsp;my question*/ &amp;nbsp;&lt;/P&gt;&lt;P&gt;proc format&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; value &amp;nbsp; &amp;nbsp; &amp;nbsp;$country_collapsed&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;country&amp;nbsp;= country&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/* do this for all values where countrycount &amp;gt;=20% of total */&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;country totals &amp;lt;20% = 'other'; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* collapse all countries into 'other' category if countrycount &amp;lt;20% total */&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2015 20:39:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-dynamic-format-for-use-in-proc-report/m-p/224844#M14301</guid>
      <dc:creator>LoriK</dc:creator>
      <dc:date>2015-09-09T20:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Create dynamic format for use in proc report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-dynamic-format-for-use-in-proc-report/m-p/224853#M14302</link>
      <description>&lt;P&gt;If proc format is not the only option you have than you can also try creating a view and use the view in your program&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create view collapsed as&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select personid,country,count,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case country&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when 'Canada' then 'Canada'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when 'Australia' then 'Australia'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else 'other' end&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from sample;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2015 21:15:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-dynamic-format-for-use-in-proc-report/m-p/224853#M14302</guid>
      <dc:creator>stevyfargose</dc:creator>
      <dc:date>2015-09-09T21:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Create dynamic format for use in proc report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-dynamic-format-for-use-in-proc-report/m-p/224857#M14303</link>
      <description>&lt;P&gt;Thanks, Stevyfargose. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I will try that - I am not tied to proc format, but I do need to figure out how to dynamically create a collapsed&amp;nbsp;"other" category (I don't want to hard code anything because the country names will change from month to month, and so will the counts associated with them).&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2015 21:52:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-dynamic-format-for-use-in-proc-report/m-p/224857#M14303</guid>
      <dc:creator>LoriK</dc:creator>
      <dc:date>2015-09-09T21:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: Create dynamic format for use in proc report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-dynamic-format-for-use-in-proc-report/m-p/224871#M14304</link>
      <description>Hi:&lt;BR /&gt;It sounds to me like something you would implement with a SAS Macro program, where the collapsing would happen inside a macro and the categories would be created.&lt;BR /&gt;cynthia</description>
      <pubDate>Thu, 10 Sep 2015 01:22:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-dynamic-format-for-use-in-proc-report/m-p/224871#M14304</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2015-09-10T01:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Create dynamic format for use in proc report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-dynamic-format-for-use-in-proc-report/m-p/224986#M14309</link>
      <description>&lt;P&gt;I think this is an example of what you might want. Basically get a summary of the data, created a cntlin dataset for proc format filtered on your value range, feed that to proc format and use. This overwrites the existing, if any format, and recreates it.&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;proc freq data=sashelp.cars noprint ;
tables cylinders / out=percent;
run;

data cylindercntlin;
set percent;
fmtname = 'Cylinders';      
start = cylinders; end=cylinders;
label = 'Other';
Type='N';  /* for character this would be C*/
IF .&amp;lt; percent &amp;lt; 20; /* so only values with the percent less than 20 will be mapped*/
run;

proc format cntlin=cylindercntlin library=work;
run;

proc freq data=sashelp.cars ;
tables cylinders ;
format cylinders Cylinders.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Sep 2015 16:02:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-dynamic-format-for-use-in-proc-report/m-p/224986#M14309</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-09-10T16:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Create dynamic format for use in proc report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-dynamic-format-for-use-in-proc-report/m-p/225186#M14320</link>
      <description>&lt;P&gt;Thanks, Cynthia. &amp;nbsp;I'm going to try that and the CNTLIN options that you guys have suggested. &amp;nbsp;I appreciate your thoughts on how to do this!&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2015 15:19:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-dynamic-format-for-use-in-proc-report/m-p/225186#M14320</guid>
      <dc:creator>LoriK</dc:creator>
      <dc:date>2015-09-11T15:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Create dynamic format for use in proc report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-dynamic-format-for-use-in-proc-report/m-p/225187#M14321</link>
      <description>&lt;P&gt;Thanks, ballardw. &amp;nbsp;I'm going to try this, as well. &amp;nbsp;If I can figure it out, I'll post again with my code to make it work.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2015 15:22:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-dynamic-format-for-use-in-proc-report/m-p/225187#M14321</guid>
      <dc:creator>LoriK</dc:creator>
      <dc:date>2015-09-11T15:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Create dynamic format for use in proc report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-dynamic-format-for-use-in-proc-report/m-p/225840#M14349</link>
      <description>&lt;P&gt;I wanted to follow up. &amp;nbsp;I took the cntlin suggested by ballardw and with a little modification, it worked! &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only thing I am still working through is how to force the "Other" and missing categories to sort to the last position while allowing everything else to sort alphabetically (and again, I can't hard code the formatting since the countries will change, more will be added, etc.). &amp;nbsp;I may end up having to manually do that in the end report - I can't figure out an order that will do the trick.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all for your help and suggestions. &amp;nbsp;Here is my final code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc freq data=final noprint;&lt;BR /&gt;tables country_of_birth / out=r.percent ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data countryofbirthcntlin;&lt;BR /&gt;set r.percent;&lt;BR /&gt;fmtname= 'COB';&lt;BR /&gt;start=country_of_birth; end=country_of_birth;&lt;BR /&gt;Type='C'; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/*this would be N for numeric*/&lt;BR /&gt;IF 0&amp;lt; percent &amp;lt; 1 then label='Other* ' ; &amp;nbsp;/*so only values with percent less than 20 will be mapped to the other category*/&lt;BR /&gt;ELSE IF percent &amp;gt;=1 then label= country_of_birth;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc format cntlin=countryofbirthcntlin library=work;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc report data=&lt;SPAN&gt;countryofbirthcntlin&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;column country_of_birth&amp;nbsp;count;&lt;BR /&gt;define &lt;SPAN&gt;country_of_birth&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;/ &amp;nbsp;group format=$COB.;&lt;BR /&gt;define count / 'Number';&lt;/P&gt;&lt;P&gt;rbreak after / summarize page ;&lt;/P&gt;&lt;P&gt;compute after / style={just=l};&lt;BR /&gt;&lt;BR /&gt;endcomp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2015 14:16:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-dynamic-format-for-use-in-proc-report/m-p/225840#M14349</guid>
      <dc:creator>LoriK</dc:creator>
      <dc:date>2015-09-16T14:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Create dynamic format for use in proc report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-dynamic-format-for-use-in-proc-report/m-p/225954#M14356</link>
      <description>&lt;P&gt;If you look at the Proc Format documentation you will see that there are a number of options that we have not addressed in this topic. One thing is to code a value format with different options and see if that helps. Then use the CNTLOUT option on proc format to see what the values set in the format used were so you can incorporate those elements into your format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also note that several procs have ORDER = directives that may interact with formats. For instance the DEFINE block supporst ORDER = with options of Data, Formatted, Freq and Internal. Without a specific instruction the default is Formatted, which will generally be the alphabetic order of your country format. So you would Lithuania, Other, Poland.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For Proc report you could either insure that the order of the data read into the procedure is the order you want and use the Order=Data option or go another step to create a variable that would be in the sequence you want, probably a numeric, and assign that sequence variable an equivalent and use the Order=internal option.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The steps above to get the format could also get you an informat, Invalue in proc format,&amp;nbsp;to transform the name to a sequence variable.&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2015 21:58:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-dynamic-format-for-use-in-proc-report/m-p/225954#M14356</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-09-16T21:58:00Z</dc:date>
    </item>
  </channel>
</rss>

