<?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 Simplify bloc of conditioons in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590422#M15037</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm new to Sas and was wondering if this code could be simplified:&lt;/P&gt;&lt;P&gt;I'm basically adding a column for the person's age range (5 year range), for other functional procedures i add afterwards, but this is the part that takes longest to process in my program (plus my god how ugly :D)&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA tranches1;
	set DEMO;
	if Age &amp;lt; 18 then
		TraLibelle = "Moins de 18 ans";
	else if 18 &amp;lt; AGE &amp;lt;= 24 then
		TraLibelle = "De 18 à 24 ans";
	else if 24 &amp;lt; AGE &amp;lt;= 29 then
		TraLibelle = "De 25 à 29 ans";
	else if 29 &amp;lt; AGE &amp;lt;= 34 then
		TraLibelle = "De 30 à 34 ans";
	else if 34 &amp;lt; AGE &amp;lt;= 39 then
		TraLibelle = "De 35 à 39 ans";
	else if 39 &amp;lt; AGE &amp;lt;= 44 then
		TraLibelle = "De 40 à 44 ans";
	else if 44 &amp;lt; AGE &amp;lt;= 49 then
		TraLibelle = "De 45 à 49 ans";
	else if 49 &amp;lt; AGE &amp;lt;= 54 then
		TraLibelle = "De 50 à 54 ans";
	else if 54 &amp;lt; AGE &amp;lt;= 59 then
		TraLibelle = "De 55 à 59 ans";
	else if 59 &amp;lt; AGE &amp;lt;= 64 then
		TraLibelle = "De 60 à 64 ans";
	else
		TraLibelle = "65 ans et plus";
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 20 Sep 2019 14:44:34 GMT</pubDate>
    <dc:creator>polpel</dc:creator>
    <dc:date>2019-09-20T14:44:34Z</dc:date>
    <item>
      <title>Simplify bloc of conditioons</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590422#M15037</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm new to Sas and was wondering if this code could be simplified:&lt;/P&gt;&lt;P&gt;I'm basically adding a column for the person's age range (5 year range), for other functional procedures i add afterwards, but this is the part that takes longest to process in my program (plus my god how ugly :D)&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA tranches1;
	set DEMO;
	if Age &amp;lt; 18 then
		TraLibelle = "Moins de 18 ans";
	else if 18 &amp;lt; AGE &amp;lt;= 24 then
		TraLibelle = "De 18 à 24 ans";
	else if 24 &amp;lt; AGE &amp;lt;= 29 then
		TraLibelle = "De 25 à 29 ans";
	else if 29 &amp;lt; AGE &amp;lt;= 34 then
		TraLibelle = "De 30 à 34 ans";
	else if 34 &amp;lt; AGE &amp;lt;= 39 then
		TraLibelle = "De 35 à 39 ans";
	else if 39 &amp;lt; AGE &amp;lt;= 44 then
		TraLibelle = "De 40 à 44 ans";
	else if 44 &amp;lt; AGE &amp;lt;= 49 then
		TraLibelle = "De 45 à 49 ans";
	else if 49 &amp;lt; AGE &amp;lt;= 54 then
		TraLibelle = "De 50 à 54 ans";
	else if 54 &amp;lt; AGE &amp;lt;= 59 then
		TraLibelle = "De 55 à 59 ans";
	else if 59 &amp;lt; AGE &amp;lt;= 64 then
		TraLibelle = "De 60 à 64 ans";
	else
		TraLibelle = "65 ans et plus";
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Sep 2019 14:44:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590422#M15037</guid>
      <dc:creator>polpel</dc:creator>
      <dc:date>2019-09-20T14:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify bloc of conditioons</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590425#M15039</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/291423"&gt;@polpel&lt;/a&gt;&amp;nbsp; IF THEN ELSE for your task is rather boring and tedious. Please take a look at USER DEFINED FORMATS aka PROC FORMAT. Do a simple search on the net, you will get gazillion examples.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2019 14:48:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590425#M15039</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-20T14:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify bloc of conditioons</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590428#M15040</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/291423"&gt;@polpel&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try SELECT-WHEN statement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) nice blog post by DO-LOOP:&amp;nbsp;&lt;A href="https://blogs.sas.com/content/iml/2016/06/20/select-when-sas-data-step.html" target="_blank" rel="noopener"&gt;https://blogs.sas.com/content/iml/2016/06/20/select-when-sas-data-step.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;2) documentation:&amp;nbsp;&lt;A href="https://documentation.sas.com/?docsetId=lestmtsref&amp;amp;docsetTarget=p09213s9jc2t99n1vx0omk2rh9ps.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=lestmtsref&amp;amp;docsetTarget=p09213s9jc2t99n1vx0omk2rh9ps.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the best&lt;/P&gt;&lt;P&gt;Bart;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA tranches1;
	set DEMO;
  select ;
  	when ( Age &amp;lt;  18 ) TraLibelle = "Moins de 18 ans";
  	when ( AGE &amp;lt;= 24 ) TraLibelle = "De 18 à 24 ans";
  	when ( AGE &amp;lt;= 29 ) TraLibelle = "De 25 à 29 ans";
  	when ( AGE &amp;lt;= 34 ) TraLibelle = "De 30 à 34 ans";
  	when ( AGE &amp;lt;= 39 ) TraLibelle = "De 35 à 39 ans";
  	when ( AGE &amp;lt;= 44 ) TraLibelle = "De 40 à 44 ans";
  	when ( AGE &amp;lt;= 49 ) TraLibelle = "De 45 à 49 ans";
  	when ( AGE &amp;lt;= 54 ) TraLibelle = "De 50 à 54 ans";
  	when ( AGE &amp;lt;= 59 ) TraLibelle = "De 55 à 59 ans";
  	when ( AGE &amp;lt;= 64 ) TraLibelle = "De 60 à 64 ans";
  	otherwise TraLibelle = "65 ans et plus";
  end;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Sep 2019 15:10:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590428#M15040</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2019-09-20T15:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify bloc of conditioons</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590429#M15041</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/291423"&gt;@polpel&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One more approach would be double array and do-loop. But treat it more like "extra SAS tutorial" rather than real use case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the best&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Demo;
do Age = 7 to 77 by 3;
  output;
end;
run ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA tranches2;
	set DEMO;

  array A[0:11] _temporary_ (0 18 24 29 34 39 44 49 54 59 64 999);
  array T[  11] $ 20 _temporary_ (
                    "Moins de 18 ans"
                    "De 18 à 24 ans"
                    "De 25 à 29 ans"
                    "De 30 à 34 ans"
                    "De 35 à 39 ans"
                    "De 40 à 44 ans"
                    "De 45 à 49 ans"
                    "De 50 à 54 ans"
                    "De 55 à 59 ans"
                    "De 60 à 64 ans"
                    "65 ans et plus"
                    );

  do _N_ = 1 to 11;
    if A[_N_-1] &amp;lt; Age &amp;lt;= A[_N_] then
      do;
        TraLibelle =  T[_N_] ;
        leave;
      end;
  end;

RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2019 15:02:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590429#M15041</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2019-09-20T15:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify bloc of conditioons</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590434#M15044</link>
      <description>&lt;P&gt;hi, thanks for the quick response.&lt;/P&gt;&lt;P&gt;I already have a format set so that i can later order by ascending age range, here's the code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC FORMAT;
	value $tranche_age
		"Moins de 18 ans"=01
		"De 18 à 24 ans"=02
		"De 25 à 29 ans"=03
		"De 30 à 34 ans"=04
		"De 35 à 39 ans"=05
		"De 40 à 44 ans"=06
		"De 45 à 49 ans"=07
		"De 50 à 54 ans"=08
		"De 55 à 59 ans"=09
		"De 60 à 64 ans"=10
		"65 ans et plus"=11
	;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;could i possibly use this to implement what i'm looking to do?&lt;/P&gt;&lt;P&gt;right now i was able to change my code to this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA tranches1;
	set DEMO;
	select;
	when (Age &amp;lt; 18)					TraLibelle = "Moins de 18 ans";
	when (18 &amp;lt;= Age &amp;lt;= 24)			TraLibelle = "De 18 à 24 ans";
	when (24 &amp;lt;= Age &amp;lt;= 29)			TraLibelle = "De 25 à 29 ans";
	when (29 &amp;lt;= Age &amp;lt;= 34)			TraLibelle = "De 30 à 34 ans";
	when (34 &amp;lt;= Age &amp;lt;= 39)			TraLibelle = "De 35 à 39 ans";
	when (39 &amp;lt;= Age &amp;lt;=44)			TraLibelle = "De 40 à 44 ans";
	when (44 &amp;lt;= Age &amp;lt;=49)			TraLibelle = "De 45 à 49 ans";
	when (49 &amp;lt;= Age &amp;lt;=54)			TraLibelle = "De 50 à 54 ans";
	when (54 &amp;lt;= Age &amp;lt;=59)			TraLibelle = "De 55 à 59 ans";
	when (59 &amp;lt;= Age &amp;lt;=64)			TraLibelle = "De 60 à 64 ans";
	otherwise						TraLibelle = "65 ans et plus";
	end;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Sep 2019 15:12:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590434#M15044</guid>
      <dc:creator>polpel</dc:creator>
      <dc:date>2019-09-20T15:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify bloc of conditioons</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590437#M15045</link>
      <description>hey!&lt;BR /&gt;this works, but only for ages 18 and above, age range from 0 to 18 doesnt appear in result table...</description>
      <pubDate>Fri, 20 Sep 2019 15:16:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590437#M15045</guid>
      <dc:creator>polpel</dc:creator>
      <dc:date>2019-09-20T15:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify bloc of conditioons</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590444#M15049</link>
      <description>&lt;P&gt;strange, I have the following output in both cases (select+when and arrays):&lt;/P&gt;&lt;PRE&gt;Obs    Age      TraLibelle

  1      7    Moins de 18 ans
  2     10    Moins de 18 ans
  3     13    Moins de 18 ans
  4     16    Moins de 18 ans
  5     19    De 18 Ă&amp;nbsp; 24 ans
  6     22    De 18 Ă&amp;nbsp; 24 ans
  7     25    De 25 Ă&amp;nbsp; 29 ans
  8     28    De 25 Ă&amp;nbsp; 29 ans
  9     31    De 30 Ă&amp;nbsp; 34 ans
 10     34    De 30 Ă&amp;nbsp; 34 ans
 11     37    De 35 Ă&amp;nbsp; 39 ans
 12     40    De 40 Ă&amp;nbsp; 44 ans
 13     43    De 40 Ă&amp;nbsp; 44 ans
 14     46    De 45 Ă&amp;nbsp; 49 ans
 15     49    De 45 Ă&amp;nbsp; 49 ans
 16     52    De 50 Ă&amp;nbsp; 54 ans
 17     55    De 55 Ă&amp;nbsp; 59 ans
 18     58    De 55 Ă&amp;nbsp; 59 ans
 19     61    De 60 Ă&amp;nbsp; 64 ans
 20     64    De 60 Ă&amp;nbsp; 64 ans
 21     67    65 ans et plus
 22     70    65 ans et plus
 23     73    65 ans et plus
 24     76    65 ans et plus&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2019 15:35:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590444#M15049</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2019-09-20T15:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify bloc of conditioons</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590459#M15056</link>
      <description>&lt;P&gt;Five year grouping is made for age 25 to 64. It can be used for fun as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;
	do i = 1 to 20;
		age = int(99 * uniform(123));
		output;
	end;
drop i;
run;


data want;
array T[11] $ 20 _temporary_ (
                    "Moins de 18 ans"
                    "De 18 à 24 ans"
                    "De 25 à 29 ans"
                    "De 30 à 34 ans"
                    "De 35 à 39 ans"
                    "De 40 à 44 ans"
                    "De 45 à 49 ans"
                    "De 50 à 54 ans"
                    "De 55 à 59 ans"
                    "De 60 à 64 ans"
                    "65 ans et plus"
                    );
	set have;
	if age &amp;lt; 18 then i = 1;
	else if age &amp;lt; 25 then i = 2;
	else if age &amp;gt; 64 then i = 11;
	else i = 2 + ceil((age - 24) / 5);
	TraLibelle = T[i];
drop i;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Sep 2019 15:59:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590459#M15056</guid>
      <dc:creator>KachiM</dc:creator>
      <dc:date>2019-09-20T15:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify bloc of conditioons</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590465#M15058</link>
      <description>&lt;P&gt;A format approach:&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
value agegrp
 0 - 18		= "Moins de 18 ans"
18 &amp;lt;- 24		= "De 18 à 24 ans"
24 &amp;lt;- 29		= "De 25 à 29 ans"
29 &amp;lt;- 34		= "De 30 à 34 ans"
34 &amp;lt;- 39		= "De 35 à 39 ans"
39 &amp;lt;- 44		= "De 40 à 44 ans"
44 &amp;lt;- 49		= "De 45 à 49 ans"
49 &amp;lt;- 54		= "De 50 à 54 ans"
54 &amp;lt;- 59		= "De 55 à 59 ans"
59 &amp;lt;- 64		= "De 60 à 64 ans"
65 -high 	= "65 ans et plus"
;

RUN ;

proc freq data=demo;
  tables age;
  format age agegrp.;
run;&lt;/PRE&gt;
&lt;P&gt;Formats have an advantage that you do not need to create additional variables, just a new format with different rules and apply in analysis, report or graphing procedure.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2019 16:37:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590465#M15058</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-09-20T16:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify bloc of conditioons</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590849#M15122</link>
      <description>&lt;P&gt;hi, thanks for response,&lt;/P&gt;&lt;P&gt;only i don't understand what you're doing in the first step...&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 08:50:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590849#M15122</guid>
      <dc:creator>polpel</dc:creator>
      <dc:date>2019-09-23T08:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify bloc of conditioons</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590855#M15123</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;BR /&gt;data want;
array T[11] $ 20 _temporary_ (
                    "Moins de 18 ans"
                    "De 18 à 24 ans"
                    "De 25 à 29 ans"
                    "De 30 à 34 ans"
                    "De 35 à 39 ans"
                    "De 40 à 44 ans"
                    "De 45 à 49 ans"
                    "De 50 à 54 ans"
                    "De 55 à 59 ans"
                    "De 60 à 64 ans"
                    "65 ans et plus"
                    );
	set have;
	if age &amp;lt; 18 then i = 1;
	else if age &amp;lt; 25 then i = 2;
	else if age &amp;gt; 64 then i = 11;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I am not sure what you mean by "-----&amp;nbsp;&lt;SPAN&gt;i don't understand what you're doing in the first step...".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;However, I will explain the logic used.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You require grouping of ages - a total of 11 groups. Each group is labelled and stored in an array T[ ]. Ages 25 to 64 need be grouped into 5-year widths which means 8 intervals(i=3 to i=10). Ages 18 to 24 has a width of 6 years. Rest of the years are falling in open intervals.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;First interval i = 1 takes ages below 18 years.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Ages 18 to 24, 6-year width, will be placed in 2nd interval (i = 2).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Ages 65+ will be placed in i = 11.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Ages 25 to 64 takes intervals as said above. The corresponding i (i=3, ...,10) is computed using:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;else i = 2 + ceil((age - 24) / 5);&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Hope this clarifies your query.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;DataSP&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 09:45:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590855#M15123</guid>
      <dc:creator>KachiM</dc:creator>
      <dc:date>2019-09-23T09:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify bloc of conditioons</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590878#M15125</link>
      <description>&lt;P&gt;Hello again and thanks for the quick answers!&lt;/P&gt;&lt;P&gt;I was able to use your method but I get an error at the end...&lt;/P&gt;&lt;P&gt;Here's the complete code&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA calc;
	array T[11] $ 20 _temporary_ (
                    "Moins de 18 ans"
                    "De 18 à 24 ans"
                    "De 25 à 29 ans"
                    "De 30 à 34 ans"
                    "De 35 à 39 ans"
                    "De 40 à 44 ans"
                    "De 45 à 49 ans"
                    "De 50 à 54 ans"
                    "De 55 à 59 ans"
                    "De 60 à 64 ans"
                    "65 ans et plus"
                    );
	Lotdeselection = &amp;amp;NUM_CTR.;
	set DEMO (where=(type_ben = "Adhérent"));
	if age &amp;lt; 18 then i = 1;
	else if age &amp;lt; 25 then i = 2;
	else if age &amp;gt; 64 then i = 11;
	else i = 2 + ceil((age - 24) / 5);
	TraLibelle = T[i];
drop i;
RUN;

proc tabulate data=calc /*format=Z3.1*/out=tbdN /*style=[1]*/; 
	class TraLibelle sexe LotdeSelection; 
	var prorata; 
	table TraLibelle*LotdeSelection,sexe*(prorata)*(sum /*colpctsum*F=7.2*/); 
run; 
ODS SELECT ALL ;  
proc sort data=tbdN (drop=_page_ _TYPE_ _TABLE_); 
	by  TraLibelle; 
run; 
proc transpose data=tbdN out=T_; 
	by TraLibelle LotdeSelection; 
	var prorata_Sum;
	id SEXE; 
run; 
proc sql; 
	create table tbd5 as 
		select LotdeSelection, 
			TraLibelle,/*put(TraLibelle,$tranche_age.) as test,*/ 
			round(Homme,1) as NbhFinsurv,
			round(Femme,1) as NbfFinsurv 
		from T_ 
			ORDER BY put(TraLibelle,$tranche_age.); 
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and the problem is that whenever someone is less than eighteen, it displays a "." instead of "Moins de 18 ans". Is it because there are only 4 under 18 women and no under 18 men?&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 11:35:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590878#M15125</guid>
      <dc:creator>polpel</dc:creator>
      <dc:date>2019-09-23T11:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify bloc of conditioons</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590883#M15126</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/291423"&gt;@polpel&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is NONE having age &amp;lt; 18, you will get a missing Value which I thought it is legal value. If you want that such missing value to be handled in your way, let me know.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 12:01:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590883#M15126</guid>
      <dc:creator>KachiM</dc:creator>
      <dc:date>2019-09-23T12:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify bloc of conditioons</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590885#M15127</link>
      <description>&lt;P&gt;well, i have one value that is inexistent for men, but there are 4 women who are under 18.&lt;/P&gt;&lt;P&gt;if no one is under 18 (men or women), the "Moins de 18 ans" range shouldn't be displayed, but this isn't the case...&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 12:31:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Simplify-bloc-of-conditioons/m-p/590885#M15127</guid>
      <dc:creator>polpel</dc:creator>
      <dc:date>2019-09-23T12:31:29Z</dc:date>
    </item>
  </channel>
</rss>

