<?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 Need help on warning message: variable EXPRSSN already exists on file in PROC SQL in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Need-help-on-warning-message-variable-EXPRSSN-already-exists-on/m-p/633408#M77876</link>
    <description>&lt;P&gt;I am very new to SAS. Anyone can help me with the warning message? The query works fines until I used substr() function three times to extract month, date, and year of a birthdate. The output only shows the column of "Date of birth month"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xliu1_0-1584646835875.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/37056i602C1BEA588E5274/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xliu1_0-1584646835875.png" alt="xliu1_0-1584646835875.png" /&gt;&lt;/span&gt;&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="xliu1_1-1584646902519.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/37057i42556EF31A792E46/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xliu1_1-1584646902519.png" alt="xliu1_1-1584646902519.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Mar 2020 19:44:55 GMT</pubDate>
    <dc:creator>xliu1</dc:creator>
    <dc:date>2020-03-19T19:44:55Z</dc:date>
    <item>
      <title>Need help on warning message: variable EXPRSSN already exists on file in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-help-on-warning-message-variable-EXPRSSN-already-exists-on/m-p/633408#M77876</link>
      <description>&lt;P&gt;I am very new to SAS. Anyone can help me with the warning message? The query works fines until I used substr() function three times to extract month, date, and year of a birthdate. The output only shows the column of "Date of birth month"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xliu1_0-1584646835875.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/37056i602C1BEA588E5274/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xliu1_0-1584646835875.png" alt="xliu1_0-1584646835875.png" /&gt;&lt;/span&gt;&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="xliu1_1-1584646902519.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/37057i42556EF31A792E46/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xliu1_1-1584646902519.png" alt="xliu1_1-1584646902519.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 19:44:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-help-on-warning-message-variable-EXPRSSN-already-exists-on/m-p/633408#M77876</guid>
      <dc:creator>xliu1</dc:creator>
      <dc:date>2020-03-19T19:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on warning message: variable EXPRSSN already exists on file in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-help-on-warning-message-variable-EXPRSSN-already-exists-on/m-p/633413#M77877</link>
      <description>&lt;P&gt;Please post your code as text not images, posting images means to correct your code I have to type it out rather than copy/paste.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You did not give your variables names so you need to add in a name for each variable, not just a label. It'll work fine if you do it with one expression, but if you have multiple expressions without names, the default names is the same and that causes issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;substr(...., 5, 2)&lt;FONT size="4" color="#FF6600"&gt;&lt;STRONG&gt; as BirthMonth&lt;/STRONG&gt; &lt;/FONT&gt;label="date of birth month", &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 20:11:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-help-on-warning-message-variable-EXPRSSN-already-exists-on/m-p/633413#M77877</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-03-19T20:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on warning message: variable EXPRSSN already exists on file in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-help-on-warning-message-variable-EXPRSSN-already-exists-on/m-p/633417#M77878</link>
      <description>&lt;P&gt;Than you very much for your response. I changed my code according to your suggestion, and it works out! see my revised code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql outobs=100;
&amp;nbsp; &amp;nbsp; create table NPSAS20_Enrollment as
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; select P.UID label='Student ID',
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; P.NAME_FIRST label='First Name',
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; P.NAME_MI label='Middle Name',
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; P.NAME_LAST label='Last Name',
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; P.SUFFIX label='Name suffix',
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; P.GENDER label='Sex',
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; substr(P.BIRTH_YYYYMM_DT, 5, 2) as MonthofBirth label='Date of birth month',
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; substr(P.BIRTH_YYYYMM_DT, 7, 2) as DateofBirth label='Date of birth day',
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; substr(P.BIRTH_YYYYMM_DT, 1, 4) as YearofBirth label='Date of birth year'
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; from SID.SID_Person_Demo P
&amp;nbsp; &amp;nbsp; inner join SID.SID_Enrollments_All_Vw E
&amp;nbsp; &amp;nbsp; on P.UID=E.UID
Where E.TERMID IN ('201905','201908','202001')
and E.BENCH='B';

select * from NPSAS20_Enrollment;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Mar 2020 08:41:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-help-on-warning-message-variable-EXPRSSN-already-exists-on/m-p/633417#M77878</guid>
      <dc:creator>xliu1</dc:creator>
      <dc:date>2020-03-20T08:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on warning message: variable EXPRSSN already exists on file in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-help-on-warning-message-variable-EXPRSSN-already-exists-on/m-p/633500#M77891</link>
      <description>&lt;P&gt;Hi and welcome!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you're new here, see these hints:&lt;/P&gt;
&lt;P&gt;The forum provides means for posting text that comes from data or code, they are the seventh and eighth icons in the toolbar right on top of the "Body" posting window. The &amp;lt;/&amp;gt; button is good for text data from external files, logs and the like. The "little running man" right next to it is meant to be used for SAS code. Using these subwindows makes it very easy for others to copy/paste the text into their environments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I took the liberty to edit your answer accordingly, to show you the effect.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 08:42:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-help-on-warning-message-variable-EXPRSSN-already-exists-on/m-p/633500#M77891</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-20T08:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on warning message: variable EXPRSSN already exists on file in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-help-on-warning-message-variable-EXPRSSN-already-exists-on/m-p/633573#M77904</link>
      <description>&lt;P&gt;Thanks for your information.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 13:08:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-help-on-warning-message-variable-EXPRSSN-already-exists-on/m-p/633573#M77904</guid>
      <dc:creator>xliu1</dc:creator>
      <dc:date>2020-03-20T13:08:40Z</dc:date>
    </item>
  </channel>
</rss>

