<?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 a new Dataset for every unique Country and it should have data of that specific country in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393484#M94765</link>
    <description>&lt;P&gt;Do you know all the possible countries in your myhome.product dataset in advance?&lt;/P&gt;</description>
    <pubDate>Wed, 06 Sep 2017 09:37:22 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2017-09-06T09:37:22Z</dc:date>
    <item>
      <title>create a new Dataset for every unique Country and it should have data of that specific country</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393478#M94760</link>
      <description>&lt;P&gt;can u help me trough this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote code like this but its not the efficient code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data AU CANADA France Germany NZ UK US;&lt;BR /&gt;set myhome.product;&lt;BR /&gt;if country = 'Australia' then output AU;&lt;BR /&gt;if country = 'Canada' then output Canada;&lt;BR /&gt;if country = 'France' then output France;&lt;BR /&gt;if country = 'Germany' then output Germany;&lt;BR /&gt;if country = 'New Zealand' then output NZ;&lt;BR /&gt;if country = 'United Kingdom' then output UK;&lt;BR /&gt;if country = 'United States' then output US;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 09:32:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393478#M94760</guid>
      <dc:creator>Karan_Dumbre</dc:creator>
      <dc:date>2017-09-06T09:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: create a new Dataset for every unique Country and it should have data of that specific country</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393483#M94764</link>
      <description>&lt;P&gt;IF / THEN statements are very quick. &amp;nbsp;It's surprising that you find the program slow. &amp;nbsp;At any rate, adding ELSE would speed things up:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;if country = 'Australia' then output AU;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ELSE if country = 'Canada' then output Canada;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ELSE if country = 'France' then output France;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ELSE if country = 'Germany' then output Germany;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ELSE if country = 'New Zealand' then output NZ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ELSE if country = 'United Kingdom' then output UK;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ELSE if country = 'United States' then output US;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In addition, you could change the order of the statements if you know something about your data. &amp;nbsp;Right now, the possibilities get evaluated in alphabetical order ("Australia" first, "United States" last). &amp;nbsp;You could improve that by listing the possibilities&amp;nbsp;in order from most frequently occurring to least frequently occurring.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 09:38:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393483#M94764</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-09-06T09:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: create a new Dataset for every unique Country and it should have data of that specific country</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393484#M94765</link>
      <description>&lt;P&gt;Do you know all the possible countries in your myhome.product dataset in advance?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 09:37:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393484#M94765</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-09-06T09:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: create a new Dataset for every unique Country and it should have data of that specific country</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393485#M94766</link>
      <description>&lt;P&gt;can you help me to write more efficient code , what if number of countries are more than 100&lt;/P&gt;&lt;P&gt;here there are only few of them&lt;/P&gt;&lt;P&gt;so i can directly use the if else statement&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 09:40:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393485#M94766</guid>
      <dc:creator>Karan_Dumbre</dc:creator>
      <dc:date>2017-09-06T09:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: create a new Dataset for every unique Country and it should have data of that specific country</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393486#M94767</link>
      <description>&lt;P&gt;yes i know&lt;/P&gt;&lt;P&gt;but what if i dont know the countries . in that case what would be the solution&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 09:41:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393486#M94767</guid>
      <dc:creator>Karan_Dumbre</dc:creator>
      <dc:date>2017-09-06T09:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: create a new Dataset for every unique Country and it should have data of that specific country</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393487#M94768</link>
      <description>&lt;P&gt;My first question is going to be why. &amp;nbsp;Its rarely, if ever a good idea to split data into separate datasets - consider if you then want to print them, you have to write code to proc print each dataset - whereas with one dataset you can use by groups. &amp;nbsp;Just one example of why one dataset is better than many.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The second quesiton is going to be, how do you know that Canada should go out to Canada and no CA, as some have two letter codes others do not - no consitency.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Third question, do you know all the combinations, what about countries you haven't though of - again this ties in with splitting data, by grouping you don't need to know this up front.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally for multiple ifs, select may be simpler:&lt;/P&gt;
&lt;PRE&gt;data au canada...;
  set myhome.product;
  select (country);
    when ("Australia") output au;
    when ("Canada") output canada;
    ...
    otherwise;
  end;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Sep 2017 09:41:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393487#M94768</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-09-06T09:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: create a new Dataset for every unique Country and it should have data of that specific country</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393490#M94770</link>
      <description>&lt;P&gt;It sounds like your definition of "efficient" means easy for you to write, not code that runs faster.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We can always find a way to make the programming easier, but the program will become more complex and might take longer to run. &amp;nbsp;If that's your objective, start by creating a SAS data set that contains two variables: &amp;nbsp;the country (such as "United States") and the data set name you want to use for that country (such as "US"). &amp;nbsp;Then we can worry about how to automate creation of the IF/THEN statements.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 09:46:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393490#M94770</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-09-06T09:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: create a new Dataset for every unique Country and it should have data of that specific country</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393491#M94771</link>
      <description>&lt;P&gt;actually u didnt get my point, what i m trying to tell u that in this case i know the name of countries in advance that my data set have this this countries. what if i dont know the countries and a that time i have to create separate data set for each country&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 09:49:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393491#M94771</guid>
      <dc:creator>Karan_Dumbre</dc:creator>
      <dc:date>2017-09-06T09:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: create a new Dataset for every unique Country and it should have data of that specific country</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393492#M94772</link>
      <description>&lt;P&gt;I agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&amp;nbsp;- having a seperate file for each country isn't a good strategy and in the long run will lead to more complications than it resolves. However if you don't know which countries are in your file you find out as follows&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	create table countries
	as select distinct country
	from product;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Once you have that file you COULD, if you absolutely need to, write a macro to generate one file for each country using that as a control file but I'd strongly advise against it.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 09:54:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393492#M94772</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2017-09-06T09:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: create a new Dataset for every unique Country and it should have data of that specific country</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393584#M94812</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/158265"&gt;@Karan_Dumbre&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;yes i know&lt;/P&gt;
&lt;P&gt;but what if i dont know the countries . in that case what would be the solution&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Do you imply that you want to do the same thing for every country in the data? The typical approach for that is to use BY group processing.&lt;/P&gt;
&lt;P&gt;Something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc sort data=product;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; by country;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc Print data=product;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; by country;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Almost every report or analysis procedure supports BY groups and it is much easier (and "efficient") in general to use By groups for analysis in one data set and then split the results to different pages of a report or similar based on the by groups as the last step.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 14:48:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393584#M94812</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-09-06T14:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: create a new Dataset for every unique Country and it should have data of that specific country</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393588#M94814</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/158265"&gt;@Karan_Dumbre&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;actually u didnt get my point, what i m trying to tell u that in this case i know the name of countries in advance that my data set have this this countries. what if i dont know the countries and a that time i have to create separate data set for each country&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I agree with what others have said, and I repeat their advice much more loudly: USE ONE DATASET, PROCESS USING BY GROUPS&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 14:56:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393588#M94814</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-09-06T14:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: create a new Dataset for every unique Country and it should have data of that specific country</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393704#M94832</link>
      <description>&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/Macro_CallText" target="_self"&gt;Macro_CallText&lt;/A&gt; has code for this in section 3.3 &lt;A href="http://www.sascommunity.org/wiki/Macro_CallText#Splitting_a_Data_Set" target="_self"&gt;Splitting_a_Data_Set&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 20:15:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393704#M94832</guid>
      <dc:creator>Ron_MacroMaven</dc:creator>
      <dc:date>2017-09-06T20:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: create a new Dataset for every unique Country and it should have data of that specific country</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393706#M94833</link>
      <description>&lt;P&gt;I have to agree with lots of others that splitting a data set for perceived efficiency is usually not needed. &amp;nbsp;But, sometimes we don't get to choose our tasks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This &lt;A href="http://blogs.sas.com/content/sasdummy/2015/01/26/how-to-split-one-data-set-into-many/" target="_self"&gt;blog post presents a few lines of code that uses PROC SQL to generate the DATA steps&lt;/A&gt; that will split your data. &amp;nbsp;It's not the most efficient in performance, but it requires almost no additional planning or data prep. &amp;nbsp;Other experts chimed in on the comments with their own ideas.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* define which libname.member table, and by which column */
%let TABLE=sashelp.cars;
%let COLUMN=origin;
 
proc sql noprint;
/* build a mini program for each value */
/* create a table with valid chars from data value */
select distinct 
   cat("DATA out_",compress(&amp;amp;COLUMN.,,'kad'),
   "; set &amp;amp;TABLE.(where=(&amp;amp;COLUMN.='", &amp;amp;COLUMN.,
   "')); run;") length=500 into :allsteps separated by ';' 
  from &amp;amp;TABLE.;
quit;
 
/* macro that includes the program we just generated */
%macro runSteps;
 &amp;amp;allsteps.;
%mend;
 
/* and...run the macro when ready */
%runSteps;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2017 14:54:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393706#M94833</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2017-09-08T14:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: create a new Dataset for every unique Country and it should have data of that specific country</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393720#M94837</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/158265"&gt;@Karan_Dumbre&lt;/a&gt;&amp;nbsp; &amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;To your question- "what if i dont know the countries . in that case what would be the solution?".&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Are you comfortable with Hashes? If yes, here you go-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*This is super simple and &lt;STRONG&gt;fully dynamic&lt;/STRONG&gt;*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;sort&lt;/STRONG&gt; data=product;&lt;/P&gt;&lt;P&gt;by country;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; _null_;&lt;/P&gt;&lt;P&gt;if _n_=&lt;STRONG&gt;1&lt;/STRONG&gt; then do;&lt;/P&gt;&lt;P&gt;if &lt;STRONG&gt;0&lt;/STRONG&gt; then set product;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; declare hash h(dataset:'&lt;SPAN&gt;product&lt;/SPAN&gt;(obs=0)',multidata:'yes' );&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; h.defineKey('country');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; h.defineData(all:'yes');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; h.defineDone();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; end;&lt;/P&gt;&lt;P&gt;set &lt;SPAN&gt;product&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;by country;&lt;/P&gt;&lt;P&gt;if first.country then h.clear();&lt;/P&gt;&lt;P&gt;h.add();&lt;/P&gt;&lt;P&gt;if last.country then h.output(dataset:'country'||compress(country));&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 06:04:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/393720#M94837</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-09-07T06:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: create a new Dataset for every unique Country and it should have data of that specific country</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/394230#M94972</link>
      <description>&lt;P&gt;warning: fragile code!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select cat(...)  %*fragile!;
into :mvar&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger&lt;/a&gt;, remember that the cat* functions create text whose default length is $200&lt;/P&gt;&lt;P&gt;and when truncation occurs --- you stuffed tooooo much text into the function call ---&lt;/P&gt;&lt;P&gt;no warning is given&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ron Fehd&amp;nbsp; been burned by this very trick maven&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2017 14:52:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/394230#M94972</guid>
      <dc:creator>Ron_MacroMaven</dc:creator>
      <dc:date>2017-09-08T14:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: create a new Dataset for every unique Country and it should have data of that specific country</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/394234#M94974</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/22720"&gt;@Ron_MacroMaven&lt;/a&gt;&amp;nbsp;- correct, as usual! I edited to add a LENGTH= option for insurance.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2017 14:56:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/394234#M94974</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2017-09-08T14:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: create a new Dataset for every unique Country and it should have data of that specific country</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/394342#M95002</link>
      <description>&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;sql&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;select distinct country into :list separated by ','&lt;/P&gt;&lt;P&gt;from have;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM&gt;op_wants_datasets_split;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;%let num=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %let dsname=%scan(%bquote(&amp;amp;list),&amp;amp;num,',');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %do %while(&amp;amp;dsname ne);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data %sysfunc(compress(&amp;amp;dsname));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; where country="&amp;amp;dsname";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let num=%eval(&amp;amp;num+1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let dsname=%scan(%bquote(&amp;amp;list),&amp;amp;num,',');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt; op_wants_datasets_split;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%&lt;STRONG&gt;&lt;EM&gt;op_wants_datasets_split&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2017 20:49:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/394342#M95002</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-09-08T20:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: create a new Dataset for every unique Country and it should have data of that specific country</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/849314#M335794</link>
      <description>proc sort data=work.sales out=work.unique (keep=Country)&lt;BR /&gt;nodupkey;&lt;BR /&gt;by country;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data _null_;&lt;BR /&gt;set work.unique;&lt;BR /&gt;call execute('data ' !! compress(Country) !! '; set work.sales; where Country = "' !! Country !! '"; run;');&lt;BR /&gt;run;</description>
      <pubDate>Tue, 13 Dec 2022 04:39:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-Dataset-for-every-unique-Country-and-it-should-have/m-p/849314#M335794</guid>
      <dc:creator>ParamKatkar</dc:creator>
      <dc:date>2022-12-13T04:39:48Z</dc:date>
    </item>
  </channel>
</rss>

