<?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 why one of the variable did not show up in the file in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/why-one-of-the-variable-did-not-show-up-in-the-file/m-p/781126#M31724</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am new to SAS SQL. somebody wrote a proc sql sas code and i just try to modify it by adding one more variables (orgname) in the code but some reasons it doesn't work. there is no any error message in the log window. so i can't figure out where has been wrong. the only one i added is the 'OrgName' but it did not show up in the output table1. the variable 'OrgName' is in the table C. I appreciate your help to take a look at the code:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table output.table1 as&lt;BR /&gt;select distinct&lt;BR /&gt;a.clientreportid&lt;BR /&gt;,a.clientuci&lt;BR /&gt;,a.sexatbirthid&lt;BR /&gt;,2020-birthyear as Age&lt;BR /&gt;,a.providerid&lt;BR /&gt;from&amp;nbsp; A&lt;/P&gt;
&lt;P&gt;,(select distinct&lt;BR /&gt;clientreportid&lt;BR /&gt;,providerid&lt;BR /&gt;,case when count(*) gt 1 then 7 else raceid end as newrace /*Find multi race clients*/&lt;BR /&gt;from B &lt;BR /&gt;group by providerid, clientreportid)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;,(select distinct&lt;BR /&gt;orgid as Providerid&lt;BR /&gt;,stateid&lt;BR /&gt;,&lt;FONT face="arial black,avant garde"&gt;orgName&lt;/FONT&gt;&lt;BR /&gt;from C&lt;BR /&gt;where a.providerid eq b.providerid and a.clientreportid eq b.clientreportid and a.providerid eq c.providerid&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Nov 2021 20:37:57 GMT</pubDate>
    <dc:creator>juliajulia</dc:creator>
    <dc:date>2021-11-18T20:37:57Z</dc:date>
    <item>
      <title>why one of the variable did not show up in the file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/why-one-of-the-variable-did-not-show-up-in-the-file/m-p/781126#M31724</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am new to SAS SQL. somebody wrote a proc sql sas code and i just try to modify it by adding one more variables (orgname) in the code but some reasons it doesn't work. there is no any error message in the log window. so i can't figure out where has been wrong. the only one i added is the 'OrgName' but it did not show up in the output table1. the variable 'OrgName' is in the table C. I appreciate your help to take a look at the code:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table output.table1 as&lt;BR /&gt;select distinct&lt;BR /&gt;a.clientreportid&lt;BR /&gt;,a.clientuci&lt;BR /&gt;,a.sexatbirthid&lt;BR /&gt;,2020-birthyear as Age&lt;BR /&gt;,a.providerid&lt;BR /&gt;from&amp;nbsp; A&lt;/P&gt;
&lt;P&gt;,(select distinct&lt;BR /&gt;clientreportid&lt;BR /&gt;,providerid&lt;BR /&gt;,case when count(*) gt 1 then 7 else raceid end as newrace /*Find multi race clients*/&lt;BR /&gt;from B &lt;BR /&gt;group by providerid, clientreportid)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;,(select distinct&lt;BR /&gt;orgid as Providerid&lt;BR /&gt;,stateid&lt;BR /&gt;,&lt;FONT face="arial black,avant garde"&gt;orgName&lt;/FONT&gt;&lt;BR /&gt;from C&lt;BR /&gt;where a.providerid eq b.providerid and a.clientreportid eq b.clientreportid and a.providerid eq c.providerid&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 20:37:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/why-one-of-the-variable-did-not-show-up-in-the-file/m-p/781126#M31724</guid>
      <dc:creator>juliajulia</dc:creator>
      <dc:date>2021-11-18T20:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: why one of the variable did not show up in the file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/why-one-of-the-variable-did-not-show-up-in-the-file/m-p/781127#M31725</link>
      <description>&lt;P&gt;This can't work at all because your parentheses are not matched.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Show us the log anyway ... all of it for this PROC SQL including the code and all NOTEs, WARNINGs and ERRORs.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 20:41:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/why-one-of-the-variable-did-not-show-up-in-the-file/m-p/781127#M31725</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-11-18T20:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: why one of the variable did not show up in the file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/why-one-of-the-variable-did-not-show-up-in-the-file/m-p/781131#M31726</link>
      <description>&lt;P&gt;this is the log file:&lt;/P&gt;
&lt;P&gt;139 proc sql;&lt;BR /&gt;140 create table1&amp;nbsp; as&lt;BR /&gt;141 select distinct&lt;BR /&gt;142 a.clientreportid&lt;BR /&gt;143 ,a.clientuci&lt;BR /&gt;144 ,a.sexatbirthid&lt;BR /&gt;145 ,2020-birthyear as Age&lt;BR /&gt;146 ,a.transgenderid&lt;BR /&gt;147 ,a.providerid&lt;BR /&gt;148 ,a.povertylevelpercent&lt;BR /&gt;149 ,a.HousingStatusId&lt;BR /&gt;150 ,stateid format=st.&lt;BR /&gt;151 ,birthyear&lt;BR /&gt;152 ,case&lt;BR /&gt;153 when ethnicityid eq 1 then 6&lt;BR /&gt;154 when ethnicityid ne 1 then newrace else .&lt;BR /&gt;155 end as racenew&lt;BR /&gt;156 ,case when genderid in(6,7,8) then 3&lt;BR /&gt;157 when genderid in(4,5) then . else genderid end as Gender3&lt;BR /&gt;158 ,a.ethnicityid&lt;BR /&gt;159 ,a.genderid&lt;BR /&gt;160 from&amp;nbsp; A&lt;BR /&gt;161&lt;BR /&gt;162 ,(select distinct&lt;BR /&gt;163 clientreportid&lt;BR /&gt;164 ,providerid&lt;BR /&gt;165 ,case when count(*) gt 1 then 7 else raceid end as newrace /*Find multi race clients*/&lt;BR /&gt;166 from clientreportrace&lt;BR /&gt;167 group by providerid, clientreportid) as B&lt;BR /&gt;168&lt;BR /&gt;169 ,(select distinct&lt;BR /&gt;170 orgid as Providerid&lt;BR /&gt;171 ,stateid&lt;BR /&gt;172 ,orgName&lt;BR /&gt;173 from report) as C&lt;BR /&gt;174 where a.providerid eq b.providerid and a.clientreportid eq b.clientreportid and a.providerid&lt;BR /&gt;174! eq c.providerid&lt;BR /&gt;175 ;&lt;BR /&gt;NOTE: The query requires remerging summary statistics back with the original data.&lt;BR /&gt;NOTE: Table Table created, with 744103 rows and 14 columns.&lt;/P&gt;
&lt;P&gt;176 quit;&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 2:38.51&lt;BR /&gt;cpu time 4.79 seconds&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 21:07:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/why-one-of-the-variable-did-not-show-up-in-the-file/m-p/781131#M31726</guid>
      <dc:creator>juliajulia</dc:creator>
      <dc:date>2021-11-18T21:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: why one of the variable did not show up in the file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/why-one-of-the-variable-did-not-show-up-in-the-file/m-p/781134#M31727</link>
      <description>Which table has ORGNAME and where do you want it to be included?&lt;BR /&gt;&lt;BR /&gt;Please show the working query from before you modified it, this looks to have syntax issues.</description>
      <pubDate>Thu, 18 Nov 2021 21:21:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/why-one-of-the-variable-did-not-show-up-in-the-file/m-p/781134#M31727</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-11-18T21:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: why one of the variable did not show up in the file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/why-one-of-the-variable-did-not-show-up-in-the-file/m-p/781139#M31729</link>
      <description>&lt;P&gt;The query didn't add ORGNAME to the SELECT it only joined with the file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add it to the SELECT statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql;
	create table1 as 
	select distinct 
	a.clientreportid
 , a.clientuci
 , a.sexatbirthid
 , 2020-birthyear as Age
 , a.transgenderid
 , a.providerid
 , a.povertylevelpercent
 , a.HousingStatusId
 , stateid format=st.
 , birthyear
&lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt; ,c.orgName&lt;/STRONG&gt;&lt;/FONT&gt;
 , case when ethnicityid eq 1 then 6 when ethnicityid ne 1 then newrace else .
 end as racenew
 , case when genderid in(6, 7, 8) then 3 when genderid in(4, 5) then . else 
		genderid end as Gender3
 , a.ethnicityid
 , a.genderid 
 
 from A

 , (select distinct clientreportid
 , providerid
 , case when count(*) gt 1 then 7 else raceid end as 
		newrace /*Find multi race clients*/
		from clientreportrace group by providerid, clientreportid) as B

 , (select distinct orgid as Providerid
 , stateid
 , orgName from report) as C 
 
 where a.providerid eq b.providerid and 
		a.clientreportid eq b.clientreportid and a.providerid eq c.providerid;
quit;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Nov 2021 18:12:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/why-one-of-the-variable-did-not-show-up-in-the-file/m-p/781139#M31729</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-11-19T18:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: why one of the variable did not show up in the file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/why-one-of-the-variable-did-not-show-up-in-the-file/m-p/781334#M31760</link>
      <description>&lt;P&gt;I see. i appreciate your help. I am still learning.&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 17:43:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/why-one-of-the-variable-did-not-show-up-in-the-file/m-p/781334#M31760</guid>
      <dc:creator>juliajulia</dc:creator>
      <dc:date>2021-11-19T17:43:49Z</dc:date>
    </item>
  </channel>
</rss>

