<?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 quick solution on this condition in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Need-quick-solution-on-this-condition/m-p/442871#M28586</link>
    <description>&lt;P&gt;You only set value6 when the condition is met, in other cases it stays missing. Add an "else" branch to your if statement that deals with those other cases.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Mar 2018 13:33:11 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-03-06T13:33:11Z</dc:date>
    <item>
      <title>Need quick solution on this condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Need-quick-solution-on-this-condition/m-p/442744#M28564</link>
      <description>&lt;P&gt;Suppose I have this following table&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="table.PNG" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18993iD53E76DF806BB23F/image-size/large?v=v2&amp;amp;px=999" role="button" title="table.PNG" alt="table.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here Name is character variable and rest of the two (Value1 and Value2) are numeric variable. I have one condition where Value1 is "Ult" then value2 should be "Ult" also, else the value of Value2 will be as it is... Can anyone give me one quick solution?.. Very urgent.. Regards Sourav&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 05:59:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Need-quick-solution-on-this-condition/m-p/442744#M28564</guid>
      <dc:creator>Sourav_sas</dc:creator>
      <dc:date>2018-03-06T05:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: Need quick solution on this condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Need-quick-solution-on-this-condition/m-p/442751#M28566</link>
      <description>Someone please look in to this issue.. Little bit urgent this one.</description>
      <pubDate>Tue, 06 Mar 2018 06:22:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Need-quick-solution-on-this-condition/m-p/442751#M28566</guid>
      <dc:creator>Sourav_sas</dc:creator>
      <dc:date>2018-03-06T06:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Need quick solution on this condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Need-quick-solution-on-this-condition/m-p/442761#M28567</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/148042"&gt;@Sourav_sas&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Suppose I have this following table&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="table.PNG" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18993iD53E76DF806BB23F/image-size/large?v=v2&amp;amp;px=999" role="button" title="table.PNG" alt="table.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here Name is character variable and rest of the two (Value1 and Value2) are numeric variable. I have one condition where Value1 is "Ult" then value2 should be "Ult" also, else the value of Value2 will be as it is... Can anyone give me one quick solution?.. Very urgent.. Regards Sourav&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Can't be. 'Ult' and 'Valt' are strings, and the values are left-aligned, which is the norm for &lt;EM&gt;character&lt;/EM&gt; variables.&lt;/P&gt;
&lt;P&gt;Please post example data in a data step with datalines, setting the correct types and formats.&lt;/P&gt;
&lt;P&gt;Or use the macro provided in&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; to convert your dataset to a data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 06:58:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Need-quick-solution-on-this-condition/m-p/442761#M28567</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-03-06T06:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: Need quick solution on this condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Need-quick-solution-on-this-condition/m-p/442767#M28568</link>
      <description>&lt;P&gt;Hi Kurt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank for your reply. I know the situation is kind of this right now. But there may be some way, I can fulfill the condition as I mentioned, or I can not do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sourav&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 07:10:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Need-quick-solution-on-this-condition/m-p/442767#M28568</guid>
      <dc:creator>Sourav_sas</dc:creator>
      <dc:date>2018-03-06T07:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Need quick solution on this condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Need-quick-solution-on-this-condition/m-p/442775#M28569</link>
      <description>&lt;P&gt;Since value2 is numeric, you can't set it to a character value.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 07:44:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Need-quick-solution-on-this-condition/m-p/442775#M28569</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-03-06T07:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need quick solution on this condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Need-quick-solution-on-this-condition/m-p/442791#M28573</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 194px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18998i16FBA473335F3BD3/image-dimensions/194x120?v=v2" width="194" height="120" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I got your point. If the table looks like the above table, and only for Value1 Ult we need Value2 Ult, rest of the Value2 will be same, then what would we follow, can suggest me for that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sourav&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 08:37:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Need-quick-solution-on-this-condition/m-p/442791#M28573</guid>
      <dc:creator>Sourav_sas</dc:creator>
      <dc:date>2018-03-06T08:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Need quick solution on this condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Need-quick-solution-on-this-condition/m-p/442794#M28575</link>
      <description>&lt;P&gt;That's a simple if - then statement, very easy to do. You won't need help with that.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 08:44:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Need-quick-solution-on-this-condition/m-p/442794#M28575</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-03-06T08:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: Need quick solution on this condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Need-quick-solution-on-this-condition/m-p/442796#M28576</link>
      <description>&lt;P&gt;If you want tested code as answer then you should post the sample data as a working data step creating such data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for your question something as below should do (not tested as no data provided):&lt;/P&gt;
&lt;PRE&gt;if value1='Ult' then value2=value1;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Mar 2018 08:46:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Need-quick-solution-on-this-condition/m-p/442796#M28576</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-03-06T08:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need quick solution on this condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Need-quick-solution-on-this-condition/m-p/442846#M28579</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;If you want tested code as answer then you should post the sample data as a working data step creating such data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As for your question something as below should do (not tested as no data provided):&lt;/P&gt;&lt;PRE&gt;if value1='Ult' then value2=value1;&lt;/PRE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;I know this is very easy code, but my concern is in there from numeric to character,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the following sample code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Upload;
	Input Name $ 1-2 Value1 $ 3-7 Value2;
	
	Input (Value2, $4.);
	Datalines;
	A Ult   1
	B Valt  3
	C Ult   2
	D Valt  5
	;
	Run;

	Data Upload3;
		Set Upload;
Value5 = Put (Value2, 1.);
Value6 = Input (Value5, $1.);
Drop Value2 Value5;
Run;



	Data Upload2;
		Set Upload;
		If Value1 = 'Ult' then Value6 = Value1;
		Run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here I can convert the numeric to character value. In the last data step some how I am losing the value. The output is looking like&amp;nbsp;as following screenshot.&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="Capture_New.JPG" style="width: 393px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/19002iA79EBA0231DB747A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture_New.JPG" alt="Capture_New.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know this is very easy solution. Can I have that? As I am not able to do that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 11:59:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Need-quick-solution-on-this-condition/m-p/442846#M28579</guid>
      <dc:creator>Sourav_sas</dc:creator>
      <dc:date>2018-03-06T11:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need quick solution on this condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Need-quick-solution-on-this-condition/m-p/442871#M28586</link>
      <description>&lt;P&gt;You only set value6 when the condition is met, in other cases it stays missing. Add an "else" branch to your if statement that deals with those other cases.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 13:33:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Need-quick-solution-on-this-condition/m-p/442871#M28586</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-03-06T13:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need quick solution on this condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Need-quick-solution-on-this-condition/m-p/443722#M28685</link>
      <description>&lt;P&gt;Thanks guys for your help,,,,,, I am using this sort of sample code now, I am getting my output as expected....&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Upload;
	Input Name $ 1-2 Value1 $ 3-7 Value2;
	Datalines;
	A Ult   1
	B Valt  3
	C Ult   2
	D Valt  5
	;
	Run;

	Data Upload;
		Set Upload;
Value5 = Put (Value2, 5. -l);
Value6 = Input (Value5, $10.);
If Value1 = 'Ult' then Value6 = Value1;
Else Value6 = Value5;
Drop Value2 Value5;
Run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Output looks like....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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="Output.JPG" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/19044i406B3E80E0C843C1/image-size/small?v=v2&amp;amp;px=200" role="button" title="Output.JPG" alt="Output.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you, thanks a lot for your support...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sourav&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2018 12:05:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Need-quick-solution-on-this-condition/m-p/443722#M28685</guid>
      <dc:creator>Sourav_sas</dc:creator>
      <dc:date>2018-03-08T12:05:58Z</dc:date>
    </item>
  </channel>
</rss>

