<?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: Conditional Function in Advanced Expression in SAS Data Integration Studio in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/522777#M32728</link>
    <description>&lt;P&gt;Ok, thankyou Mr. Kurt for the explanation..&lt;/P&gt;</description>
    <pubDate>Thu, 20 Dec 2018 03:29:47 GMT</pubDate>
    <dc:creator>wellylly</dc:creator>
    <dc:date>2018-12-20T03:29:47Z</dc:date>
    <item>
      <title>Conditional Function in Advanced Expression in SAS Data Integration Studio</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/521893#M32684</link>
      <description>&lt;P&gt;Hi....&lt;/P&gt;&lt;P&gt;I want to use advanced expression for mapping columns in SAS DI Studio. The data type of the target table is numeric, and the source table is character. I have to map them both with 4 conditions.&amp;nbsp;&lt;BR /&gt;quarterly=1&lt;BR /&gt;semi annual=2&lt;BR /&gt;discounted=3&lt;BR /&gt;monthly=4&lt;BR /&gt;&lt;BR /&gt;Could anyone help me to solve this case?? I even tried 'case when' and 'if' condition in the expression but it does not work.&lt;BR /&gt;Or maybe there's something wrong in my code &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks before..&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 03:03:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/521893#M32684</guid>
      <dc:creator>wellylly</dc:creator>
      <dc:date>2018-12-18T03:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Function in Advanced Expression in SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/521898#M32685</link>
      <description>&lt;P&gt;Use an informat:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
invalue myfmt
  "quarterly"=1
  "semi annual"=2
  "discounted"=3
  "monthly"=4
;
run;

data have;
input oldvar $20.;
cards;
quarterly
semi annual
discounted
monthly
;
run;

data want;
set have;
newvar = input(oldvar,myfmt.);
run;

proc print data=want noobs;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;oldvar         newvar

quarterly         1  
semi annual       2  
discounted        3  
monthly           4  
&lt;/PRE&gt;
&lt;P&gt;As soon as you have the format defined, you can use it in the advanced expression of the query builder.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Dec 2018 13:29:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/521898#M32685</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-17T13:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Function in Advanced Expression in SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/521909#M32687</link>
      <description>&lt;P&gt;Thank you Mr. Kurt for answer my question..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, can I use that code in SAS Data Integration Studio?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ask.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25740i04D93C41824111DE/image-size/large?v=v2&amp;amp;px=999" role="button" title="ask.PNG" alt="ask.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Dec 2018 13:48:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/521909#M32687</guid>
      <dc:creator>wellylly</dc:creator>
      <dc:date>2018-12-17T13:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Function in Advanced Expression in SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/521927#M32689</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input(oldvar,myfmt.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;can be used in the expression text.&lt;/P&gt;
&lt;P&gt;I hope that DI Studio provides a task for creating informats; if not, put the proc format code into user-written code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Dec 2018 14:47:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/521927#M32689</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-17T14:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Function in Advanced Expression in SAS Data Integration Studio</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/521956#M32692</link>
      <description>No, creating informats doesn't come OOTB in Di Studio. Mapping data directly from lookup tables is favoured since it gives better linage using the built in impact analysis.</description>
      <pubDate>Mon, 17 Dec 2018 15:51:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/521956#M32692</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-12-17T15:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Function in Advanced Expression in SAS Data Integration Studio</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/522133#M32693</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13674"&gt;@LinusH&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;No, creating informats doesn't come OOTB in Di Studio. Mapping data directly from lookup tables is favoured since it gives better linage using the built in impact analysis.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Wow. Not even automatic creation from tables (which would facilitate lineage)?&lt;/P&gt;
&lt;P&gt;What a poor cripple (IMHO), given how useful dynamically built custom formats/informats can be.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 08:30:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/522133#M32693</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-18T08:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Function in Advanced Expression in SAS Data Integration Studio</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/522136#M32694</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;I don't know the name of your source table variable, I call it [invar] &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this case expression:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;case&lt;/P&gt;
&lt;P&gt;&amp;nbsp; when [invar] = '&lt;SPAN&gt;quarterly' then 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; when [invar] = 'semi annual' then 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; when [invar] = 'discounted' then 3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; when [invar] = 'monthly' then 4&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; else .&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;end&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;//Fredrik&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 08:41:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/522136#M32694</guid>
      <dc:creator>FredrikE</dc:creator>
      <dc:date>2018-12-18T08:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Function in Advanced Expression in SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/522137#M32695</link>
      <description>&lt;P&gt;Thanks Mr.Kurt..&lt;BR /&gt;But it still doesn't work in DI Studio, and i got some errors..&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 08:50:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/522137#M32695</guid>
      <dc:creator>wellylly</dc:creator>
      <dc:date>2018-12-18T08:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Function in Advanced Expression in SAS Data Integration Studio</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/522140#M32696</link>
      <description>&lt;P&gt;Thanks Mr. Fredrike..&lt;/P&gt;&lt;P&gt;I've tried it, then i got this...&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set DN_EIR.DN_OUTSTANDING_EIR;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;5 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;where case&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;6 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;when Freq_Kupon = 'quarterly' then 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;____&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;76&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, !, !!, &amp;amp;, (, *, **, +, -, /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, ?, AND, BETWEEN, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CONTAINS, EQ, GE, GT, IN, IS, LE, LIKE, LT, NE, NOT, NOTIN, OR, ^, ^=, |, ||, ~, ~=. &amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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="com.PNG" style="width: 576px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25772iE094B2F9D1C9F761/image-size/large?v=v2&amp;amp;px=999" role="button" title="com.PNG" alt="com.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 08:54:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/522140#M32696</guid>
      <dc:creator>wellylly</dc:creator>
      <dc:date>2018-12-18T08:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Function in Advanced Expression in SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/522142#M32697</link>
      <description>&lt;P&gt;Please enable us to follow Maxim 2.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 08:55:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/522142#M32697</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-18T08:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Function in Advanced Expression in SAS Data Integration Studio</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/522143#M32698</link>
      <description>&lt;P&gt;The set startement points to a data step being used, but case/when/else/end is SQL syntax. And it is used in SQL to populate a column, not for where conditions (mostly).&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 08:57:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/522143#M32698</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-18T08:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Function in Advanced Expression in SAS Data Integration Studio</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/522144#M32699</link>
      <description>&lt;P&gt;I always used Data Validation for mapping the tables. I never use lookup. Or maybe next chance because I'm still learning.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2018 03:32:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/522144#M32699</guid>
      <dc:creator>wellylly</dc:creator>
      <dc:date>2018-12-20T03:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Function in Advanced Expression in SAS Data Integration Studio</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/522155#M32700</link>
      <description>&lt;P&gt;Really, what?&lt;/P&gt;
&lt;P&gt;Lineage is built around the traceability of data that flows in jobs/processes.&lt;/P&gt;
&lt;P&gt;Also, ETL as such is built on this premise.&lt;/P&gt;
&lt;P&gt;I guess that SAS &amp;lt;could&amp;gt; build a format generation transformation, but then they need to build some new kind of lineage between a new object type (catalogue entry format and informat),and I'm not convinced that it's worth it, since many use cases can be solved with other (and non-SAS specific) approaches. Like in this case I think a look up table combined with a Join or Lookup transformation would do the job.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 10:18:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/522155#M32700</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-12-18T10:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Function in Advanced Expression in SAS Data Integration Studio</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/522228#M32703</link>
      <description>&lt;P&gt;Looks like the data validation transformation is a bit tricky to get everything correct...&lt;/P&gt;
&lt;P&gt;I would try to use an extract transformation before and in that one create the case/when expression.&lt;/P&gt;
&lt;P&gt;Test the extract until you are satisfied and then add the data validation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//Freedrik&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 14:22:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/522228#M32703</guid>
      <dc:creator>FredrikE</dc:creator>
      <dc:date>2018-12-18T14:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Function in Advanced Expression in SAS Data Integration Studio</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/522777#M32728</link>
      <description>&lt;P&gt;Ok, thankyou Mr. Kurt for the explanation..&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2018 03:29:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/522777#M32728</guid>
      <dc:creator>wellylly</dc:creator>
      <dc:date>2018-12-20T03:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Function in Advanced Expression in SAS Data Integration Studio</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/522780#M32729</link>
      <description>&lt;P&gt;Thank you so much Mr.Fredrike..&lt;BR /&gt;Finally, 'case when' statement is very helpful. I just forgot that the record is case sensitive. The real record is 'Quarterly' not 'quarterly' so that I got the error. So, I change the first&amp;nbsp;alphabets to upper case, then it works &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="answer.PNG" style="width: 585px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25817iF91129298F6F8F3C/image-size/large?v=v2&amp;amp;px=999" role="button" title="answer.PNG" alt="answer.PNG" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2018 03:41:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Conditional-Function-in-Advanced-Expression-in-SAS-Data/m-p/522780#M32729</guid>
      <dc:creator>wellylly</dc:creator>
      <dc:date>2018-12-20T03:41:15Z</dc:date>
    </item>
  </channel>
</rss>

