<?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: Using data step how can I use the IF then like SQl join in SAS Enterprise guide in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-data-step-how-can-I-use-the-IF-then-like-SQl-join-in-SAS/m-p/450223#M29111</link>
    <description>&lt;P&gt;thanks Tom&lt;/P&gt;&lt;P&gt;It helped me to solve my coding issue..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sourav&lt;/P&gt;</description>
    <pubDate>Sun, 01 Apr 2018 04:18:08 GMT</pubDate>
    <dc:creator>Sourav_sas</dc:creator>
    <dc:date>2018-04-01T04:18:08Z</dc:date>
    <item>
      <title>Using data step how can I use the IF then like SQl join in SAS Enterprise guide</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-data-step-how-can-I-use-the-IF-then-like-SQl-join-in-SAS/m-p/450108#M29107</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can I get a quick solution on this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using Inner join in the following code,&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
		CREATE Table WORK.TECH1 AS 
			SELECT 	a.*						,
				B.IP_SICSID  				,
				b.MAIN_CURRISOALPHA3_ID		,
			 	CASE WHEN b.LEVEL_OF_BUS_ID = "IAB" THEN "inward"	
					 WHEN b.LEVEL_OF_BUS_ID = "ORP" THEN "outward"
	                 ELSE '' 
				END as inw_outw format $10. ,
			 	b.BUS_ID					,
			    b.TYPE_OF_BUS_ID			,
			 	b.BUS_TTL					,
				%IF &amp;amp;PROFIT_CENTER = Y %THEN %DO;
					b.PRFT_CENT_TTL         ,
				%END;
		/* DWH-2811 Change starts */
				%IF &amp;amp;INSURED_ID_TTL = Y %THEN %DO;
					b.INS_ID                ,
					b.INS_TTL               ,
				%END;
				%IF &amp;amp;IP_FROM_TO = Y %THEN %DO;
					b.IP_FROM               ,
					b.IP_TO                 ,
				%END;
				b.PAYM_PARTN_ID             ,
				b.PAYM_PARTN_TTL            ,
				b.ACCOUNT_GROUP_ID          ,
				b.LEVEL_OF_BUS_ID 			,
				b.BUS_PARTN_ID_BOOK			,
				b.ORIG_CDNT_ID				,
				b.ORIG_CDNT_TTL 			,
				b.ORIG_CDNT_COUNTRY			 
			FROM WORK.AGING_TECHNICAL1 a INNER JOIN 
				WORK.IP_SECT_SMALL b on
				a.SECTION_SICSID=b.SECT_SICSID 
	;
	QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here all '&amp;amp;' variables are parameter macro variable, if the value of that variable is the defined value inside quote, then we will get that column,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to use this join inside a data step, merge statement,&lt;/P&gt;&lt;P&gt;I am using the code like&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc sort data= AGING_TECHNICAL1;
By SECTION_SICSID;
Run;

Proc Sort Data=  IP_SECT_SMALL;
By SECT_SICSID;
Run;

	Data IP_SECT_SMALL
	 (Rename= (SECT_SICSID=SECTION_SICSID )
					    );
	Set IP_SECT_SMALL;
	Drop RETROCESS_ID CDNT_ID;
	Run;

Data Tech;
		Attrib inw_outw Length= $10.;
		Set Tech1;
		Select;
		When (LEVEL_OF_BUS_ID = "IAB") inw_outw= "inward";
		When (LEVEL_OF_BUS_ID = "ORP") inw_outw= "outward";
		End;
	Run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But I am not able to define the if then logic from the SQL join in the data step,&amp;nbsp; for example this part&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%IF &amp;amp;PROFIT_CENTER = Y %THEN %DO;
					b.PRFT_CENT_TTL         ,
				%END;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How can I define this one, because I need to call this variable based on that sort parameter (&amp;amp;PROFIT_CENTER) is Y,&lt;/P&gt;&lt;P&gt;Can you please help me to construct this code on Data step or merge statement.&lt;/P&gt;&lt;P&gt;I am in little bit hurry.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sourav&lt;/P&gt;</description>
      <pubDate>Sat, 31 Mar 2018 04:58:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-data-step-how-can-I-use-the-IF-then-like-SQl-join-in-SAS/m-p/450108#M29107</guid>
      <dc:creator>Sourav_sas</dc:creator>
      <dc:date>2018-03-31T04:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using data step how can I use the IF then like SQl join in SAS Enterprise guide</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-data-step-how-can-I-use-the-IF-then-like-SQl-join-in-SAS/m-p/450112#M29108</link>
      <description>If anyone can help me here, then come up with some solution. As I really need that here to complete my coding. It is bit urgent here.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Regards&lt;BR /&gt;Sourav</description>
      <pubDate>Sat, 31 Mar 2018 08:12:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-data-step-how-can-I-use-the-IF-then-like-SQl-join-in-SAS/m-p/450112#M29108</guid>
      <dc:creator>Sourav_sas</dc:creator>
      <dc:date>2018-03-31T08:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using data step how can I use the IF then like SQl join in SAS Enterprise guide</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-data-step-how-can-I-use-the-IF-then-like-SQl-join-in-SAS/m-p/450128#M29109</link>
      <description>&lt;P&gt;If you want to determine which variables are included in the output dataset the use a KEEP (or DROP) statement.&lt;/P&gt;
&lt;P&gt;So you might do it this way.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%IF NOT (&amp;amp;PROFIT_CENTER = Y) %THEN %DO;
  DROP PRFT_CENT_TTL  ;
%END;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 31 Mar 2018 13:25:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-data-step-how-can-I-use-the-IF-then-like-SQl-join-in-SAS/m-p/450128#M29109</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-03-31T13:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using data step how can I use the IF then like SQl join in SAS Enterprise guide</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-data-step-how-can-I-use-the-IF-then-like-SQl-join-in-SAS/m-p/450223#M29111</link>
      <description>&lt;P&gt;thanks Tom&lt;/P&gt;&lt;P&gt;It helped me to solve my coding issue..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sourav&lt;/P&gt;</description>
      <pubDate>Sun, 01 Apr 2018 04:18:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-data-step-how-can-I-use-the-IF-then-like-SQl-join-in-SAS/m-p/450223#M29111</guid>
      <dc:creator>Sourav_sas</dc:creator>
      <dc:date>2018-04-01T04:18:08Z</dc:date>
    </item>
  </channel>
</rss>

