<?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: Need to arrange the position of MCX and PSG using below set of rule in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-to-arrange-the-position-of-MCX-and-PSG-using-below-set-of/m-p/843897#M333625</link>
    <description>&lt;P&gt;So the Input step will look like this and the o/p data is above&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-11-12 103324.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77230iF752C7FEB144B5CB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2022-11-12 103324.png" alt="Screenshot 2022-11-12 103324.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
    <pubDate>Sat, 12 Nov 2022 05:04:49 GMT</pubDate>
    <dc:creator>animesh123</dc:creator>
    <dc:date>2022-11-12T05:04:49Z</dc:date>
    <item>
      <title>Need to arrange the position of MCX and PSG using below set of rule</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-arrange-the-position-of-MCX-and-PSG-using-below-set-of/m-p/843779#M333576</link>
      <description>&lt;P&gt;DATA output;&lt;/P&gt;&lt;P&gt;set input;&lt;/P&gt;&lt;P&gt;if mCX_Tier=1 then default_plan=ceil(4/tgt_cnt);&lt;BR /&gt;else if mCX_Tier=2 then default_plan=ceil(3/tgt_cnt);&lt;BR /&gt;else if mCX_Tier=3 then default_plan=ceil(1/tgt_cnt);&lt;BR /&gt;else IF mCX_Tier=4 THEN default_plan=0;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if pSG_Tier=1 then default_plan=plan(3/tgt_cnt);&lt;BR /&gt;else if pSG_Tier=2 then default_plan=ceil(2/tgt_cnt);&lt;BR /&gt;else if pSG_Tier=3 then default_plan=ceil(1/tgt_cnt);&lt;BR /&gt;else IF pSG_Tier=4 THEN default_plan=0;&lt;/P&gt;&lt;P&gt;run;&lt;BR /&gt;here tgt_cnt is 1&lt;/P&gt;&lt;P&gt;So this code is not working for me As tier is getting overlapped e.g- mCX_Tier=1 is getting overlapped with pSG_Tier=3&lt;BR /&gt;What I am trying to do is then there is two column p1 and p2 and also we required minimum tier other than below conditon&lt;/P&gt;&lt;P&gt;MCX FALLS IN 1/2 then P1 should have MCX and PSG should get into P2&lt;BR /&gt;and&lt;BR /&gt;PSG falls in 3 and MCX FALLS in 4 THEN P1 will get TSG and P2 get SCX&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 13:19:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-arrange-the-position-of-MCX-and-PSG-using-below-set-of/m-p/843779#M333576</guid>
      <dc:creator>animesh123</dc:creator>
      <dc:date>2022-11-11T13:19:59Z</dc:date>
    </item>
    <item>
      <title>I need to arrange the postion of MCX and PSG using set of rule</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-arrange-the-position-of-MCX-and-PSG-using-below-set-of/m-p/843774#M333702</link>
      <description>&lt;P&gt;DATA output;&lt;/P&gt;&lt;P&gt;set input;&lt;/P&gt;&lt;P&gt;if mCX_Tier=1 then default_plan=ceil(4/tgt_cnt);&lt;BR /&gt;else if mCX_Tier=2 then default_plan=ceil(3/tgt_cnt);&lt;BR /&gt;else if mCX_Tier=3 then default_plan=ceil(1/tgt_cnt);&lt;BR /&gt;else IF mCX_Tier=4 THEN default_plan=0;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if pSG_Tier=1 then default_plan=plan(3/tgt_cnt);&lt;BR /&gt;else if pSG_Tier=2 then default_plan=ceil(2/tgt_cnt);&lt;BR /&gt;else if pSG_Tier=3 then default_plan=ceil(1/tgt_cnt);&lt;BR /&gt;else IF pSG_Tier=4 THEN default_plan=0;&lt;/P&gt;&lt;P&gt;run;&lt;BR /&gt;here tgt_cnt is 1&lt;/P&gt;&lt;P&gt;So this code is not working for me As tier is getting overlapped e.g- mCX_Tier=1 is getting overlapped with pSG_Tier=3&lt;BR /&gt;What I am trying to do is then there is two column p1 and p2 and also we required minimum tier other than below conditon&lt;/P&gt;&lt;P&gt;MCX FALLS IN 1/2 then P1 should have MCX and PSG should get into P2&lt;BR /&gt;and&lt;BR /&gt;PSG falls in 3 and MCX FALLS in 4 THEN P1 will get TSG and P2 get SCX&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 12:55:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-arrange-the-position-of-MCX-and-PSG-using-below-set-of/m-p/843774#M333702</guid>
      <dc:creator>animesh123</dc:creator>
      <dc:date>2022-11-11T12:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: Need to arrange the position of MCX and PSG using below set of rule</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-arrange-the-position-of-MCX-and-PSG-using-below-set-of/m-p/843794#M333577</link>
      <description>&lt;P&gt;Read your post multiple times, but still it is not clear what you expect as result. Please post some data and the expected results.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 14:14:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-arrange-the-position-of-MCX-and-PSG-using-below-set-of/m-p/843794#M333577</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-11-11T14:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Need to arrange the position of MCX and PSG using below set of rule</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-arrange-the-position-of-MCX-and-PSG-using-below-set-of/m-p/843806#M333582</link>
      <description>&lt;P&gt;the data look like this and the ouput data too&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-11-11 202659.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77213i0DC532521054CEA2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2022-11-11 202659.png" alt="Screenshot 2022-11-11 202659.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 14:58:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-arrange-the-position-of-MCX-and-PSG-using-below-set-of/m-p/843806#M333582</guid>
      <dc:creator>animesh123</dc:creator>
      <dc:date>2022-11-11T14:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need to arrange the position of MCX and PSG using below set of rule</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-arrange-the-position-of-MCX-and-PSG-using-below-set-of/m-p/843807#M333583</link>
      <description>So the code which is up there is totally wrong .I am also working on creating on new code which follows the codition</description>
      <pubDate>Fri, 11 Nov 2022 15:04:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-arrange-the-position-of-MCX-and-PSG-using-below-set-of/m-p/843807#M333583</guid>
      <dc:creator>animesh123</dc:creator>
      <dc:date>2022-11-11T15:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need to arrange the position of MCX and PSG using below set of rule</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-arrange-the-position-of-MCX-and-PSG-using-below-set-of/m-p/843836#M333598</link>
      <description>&lt;P&gt;Please provide example data in the form of data step code. It is extremely hard to write code against pictures. Do not mix "input" with output data as we still don't know where you are starting from.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 17:48:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-arrange-the-position-of-MCX-and-PSG-using-below-set-of/m-p/843836#M333598</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-11-11T17:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need to arrange the position of MCX and PSG using below set of rule</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-arrange-the-position-of-MCX-and-PSG-using-below-set-of/m-p/843897#M333625</link>
      <description>&lt;P&gt;So the Input step will look like this and the o/p data is above&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-11-12 103324.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77230iF752C7FEB144B5CB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2022-11-12 103324.png" alt="Screenshot 2022-11-12 103324.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Sat, 12 Nov 2022 05:04:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-arrange-the-position-of-MCX-and-PSG-using-below-set-of/m-p/843897#M333625</guid>
      <dc:creator>animesh123</dc:creator>
      <dc:date>2022-11-12T05:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: I need to arrange the postion of MCX and PSG using set of rule</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-arrange-the-position-of-MCX-and-PSG-using-below-set-of/m-p/843930#M333703</link>
      <description>&lt;P&gt;I can't say I really understand the rules here, but clearly the outcome depends on the combo of two factors and the second IF-THEN block can undo the logic of the first IF-THEN block.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd try to rearrange to evaluate the two items together and apply the precedence rules. So a single IF-THEN-ELSE block that evaluates the conditions together, or alternatively SELECT WHEN (may be easier to read in this case, but functionally the same).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;DATA output(drop=factor);
	set input;
	length factor 8;
	factor = 0;
	
    /* only first WHEN condition that is true will apply */
    select;
     when (mCX_Tier=1) factor=4;
     when (mCX_Tier=2 or pSG_Tier=1) factor=3;
     when (mCX_Tier=3 or pSG_Tier=3) factor=1;
     when (mCX_Tier=4 or pSG_Tier=4) factor=0;     
    end;
   
	/* assuming tgt_cnt is never 0 */
	default_plan = ceil(factor/tgt_cnt);

run;&lt;/LI-CODE&gt;
&lt;P&gt;(Also not sure why you need the ceil function, but maybe you have cases where the numbers aren't integers.)&lt;/P&gt;</description>
      <pubDate>Sat, 12 Nov 2022 14:22:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-arrange-the-position-of-MCX-and-PSG-using-below-set-of/m-p/843930#M333703</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2022-11-12T14:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need to arrange the position of MCX and PSG using below set of rule</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-arrange-the-position-of-MCX-and-PSG-using-below-set-of/m-p/844048#M333700</link>
      <description>&lt;P&gt;Impossible to understand what you have and what you want. Please post data in usable form: a data step using datalines.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 06:42:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-arrange-the-position-of-MCX-and-PSG-using-below-set-of/m-p/844048#M333700</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-11-14T06:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: I need to arrange the postion of MCX and PSG using set of rule</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-arrange-the-position-of-MCX-and-PSG-using-below-set-of/m-p/844051#M333704</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/430763"&gt;@animesh123&lt;/a&gt; Please don't repeat questions, this causes confusion only.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 07:03:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-arrange-the-position-of-MCX-and-PSG-using-below-set-of/m-p/844051#M333704</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-11-14T07:03:03Z</dc:date>
    </item>
  </channel>
</rss>

