<?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: Match variable to a variable in excel file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Match-variable-to-a-variable-in-excel-file/m-p/795781#M255275</link>
    <description>&lt;P&gt;Check the proc content output of your XLSX file after imported and specifically the variable name.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there were leading spaces sometimes it ends up as _patientID or maybe it was Patient_ID?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc content data=shp_flu;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you still have issues, please post the results of the proc content here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may run into other issues - for example if one file has leading zeroes and the other doesn't or if one file has the variable as character rather than numeric.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/290946"&gt;@bhca60&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm getting an error when trying to match patient id - not sure why since it is called Patient ID in the excel file but it is called memberno in the dataset I'm trying to link to so that it brings in those patients only who have the codes specified (error at the bottom):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc import&lt;BR /&gt;datafile="&amp;amp;qr./Patient List for Flu Data Dive - PY 2021.xlsx"&lt;BR /&gt;dbms=xlsx&lt;BR /&gt;out=shp_flu&lt;BR /&gt;replace;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table flu&lt;BR /&gt;as select *&lt;BR /&gt;from x.personImmunization&lt;BR /&gt;where (cpt in&lt;BR /&gt;("90630" "90653" "90654" "90655" "90656" "90657" "90658" "90661" "90662" "90666" "90667" "90668" "90673" "90674" "90682" "90685" "90686" "90687" "90688" "90756"&lt;BR /&gt;"G0008" "Q2034" "Q2035" "Q2036" "Q2037" "Q2038" "Q2039"))&lt;BR /&gt;and sourceSystem="xxxx" and Date between "2020-08-01" and "2021-03-31";&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;/*get a list of the patients that are in the vaccination list so that we only select their proc codes*/&lt;BR /&gt;proc sql;&lt;BR /&gt;create table members&lt;BR /&gt;as select *&lt;BR /&gt;from x.personAttribution&lt;BR /&gt;where memberNo in (select patient_id from shp_flu);&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;22 GOPTIONS ACCESSIBLE;&lt;BR /&gt;23 proc sql;&lt;BR /&gt;24 create table members&lt;BR /&gt;25 as select distinct memberNo&lt;BR /&gt;26 from x.personAttribution&lt;BR /&gt;27 where memberNo in (select patient_id from shp_flu);&lt;BR /&gt;ERROR: The following columns were not found in the contributing tables: patient_id.&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;28 quit;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.13 seconds&lt;BR /&gt;cpu time 0.03 seconds&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Feb 2022 20:53:55 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2022-02-11T20:53:55Z</dc:date>
    <item>
      <title>Match variable to a variable in excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-variable-to-a-variable-in-excel-file/m-p/795780#M255274</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm getting an error when trying to match patient id - not sure why since it is called Patient ID in the excel file but it is called memberno in the dataset I'm trying to link to so that it brings in those patients only who have the codes specified (error at the bottom):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc import&lt;BR /&gt;datafile="&amp;amp;qr./Patient List for Flu Data Dive - PY 2021.xlsx"&lt;BR /&gt;dbms=xlsx&lt;BR /&gt;out=shp_flu&lt;BR /&gt;replace;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table flu&lt;BR /&gt;as select *&lt;BR /&gt;from x.personImmunization&lt;BR /&gt;where (cpt in&lt;BR /&gt;("90630" "90653" "90654" "90655" "90656" "90657" "90658" "90661" "90662" "90666" "90667" "90668" "90673" "90674" "90682" "90685" "90686" "90687" "90688" "90756"&lt;BR /&gt;"G0008" "Q2034" "Q2035" "Q2036" "Q2037" "Q2038" "Q2039"))&lt;BR /&gt;and sourceSystem="xxxx" and Date between "2020-08-01" and "2021-03-31";&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/*get a list of the patients that are in the vaccination list so that we only select their proc codes*/&lt;BR /&gt;proc sql;&lt;BR /&gt;create table members&lt;BR /&gt;as select *&lt;BR /&gt;from x.personAttribution&lt;BR /&gt;where memberNo in (select patient_id from shp_flu);&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;22 GOPTIONS ACCESSIBLE;&lt;BR /&gt;23 proc sql;&lt;BR /&gt;24 create table members&lt;BR /&gt;25 as select distinct memberNo&lt;BR /&gt;26 from x.personAttribution&lt;BR /&gt;27 where memberNo in (select patient_id from shp_flu);&lt;BR /&gt;ERROR: The following columns were not found in the contributing tables: patient_id.&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;28 quit;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.13 seconds&lt;BR /&gt;cpu time 0.03 seconds&lt;/P&gt;</description>
      <pubDate>Fri, 11 Feb 2022 20:45:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-variable-to-a-variable-in-excel-file/m-p/795780#M255274</guid>
      <dc:creator>bhca60</dc:creator>
      <dc:date>2022-02-11T20:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Match variable to a variable in excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-variable-to-a-variable-in-excel-file/m-p/795781#M255275</link>
      <description>&lt;P&gt;Check the proc content output of your XLSX file after imported and specifically the variable name.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there were leading spaces sometimes it ends up as _patientID or maybe it was Patient_ID?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc content data=shp_flu;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you still have issues, please post the results of the proc content here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may run into other issues - for example if one file has leading zeroes and the other doesn't or if one file has the variable as character rather than numeric.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/290946"&gt;@bhca60&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm getting an error when trying to match patient id - not sure why since it is called Patient ID in the excel file but it is called memberno in the dataset I'm trying to link to so that it brings in those patients only who have the codes specified (error at the bottom):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc import&lt;BR /&gt;datafile="&amp;amp;qr./Patient List for Flu Data Dive - PY 2021.xlsx"&lt;BR /&gt;dbms=xlsx&lt;BR /&gt;out=shp_flu&lt;BR /&gt;replace;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table flu&lt;BR /&gt;as select *&lt;BR /&gt;from x.personImmunization&lt;BR /&gt;where (cpt in&lt;BR /&gt;("90630" "90653" "90654" "90655" "90656" "90657" "90658" "90661" "90662" "90666" "90667" "90668" "90673" "90674" "90682" "90685" "90686" "90687" "90688" "90756"&lt;BR /&gt;"G0008" "Q2034" "Q2035" "Q2036" "Q2037" "Q2038" "Q2039"))&lt;BR /&gt;and sourceSystem="xxxx" and Date between "2020-08-01" and "2021-03-31";&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;/*get a list of the patients that are in the vaccination list so that we only select their proc codes*/&lt;BR /&gt;proc sql;&lt;BR /&gt;create table members&lt;BR /&gt;as select *&lt;BR /&gt;from x.personAttribution&lt;BR /&gt;where memberNo in (select patient_id from shp_flu);&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;22 GOPTIONS ACCESSIBLE;&lt;BR /&gt;23 proc sql;&lt;BR /&gt;24 create table members&lt;BR /&gt;25 as select distinct memberNo&lt;BR /&gt;26 from x.personAttribution&lt;BR /&gt;27 where memberNo in (select patient_id from shp_flu);&lt;BR /&gt;ERROR: The following columns were not found in the contributing tables: patient_id.&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;28 quit;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.13 seconds&lt;BR /&gt;cpu time 0.03 seconds&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Feb 2022 20:53:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-variable-to-a-variable-in-excel-file/m-p/795781#M255275</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-02-11T20:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: Match variable to a variable in excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-variable-to-a-variable-in-excel-file/m-p/795782#M255276</link>
      <description>Hmm, it's saying proc content not found??&lt;BR /&gt;&lt;BR /&gt;36 proc import&lt;BR /&gt;37 datafile="&amp;amp;qr./Patient List for Flu Data Dive - PY 2021.xlsx"&lt;BR /&gt;38 dbms=xlsx&lt;BR /&gt;39 out=shp_flu&lt;BR /&gt;40 replace;&lt;BR /&gt;41 run;&lt;BR /&gt;&lt;BR /&gt;NOTE: One or more variables were converted because the data type is not supported by the V9 engine. For more details, run with&lt;BR /&gt;options MSGLEVEL=I.&lt;BR /&gt;NOTE: The import data set has 616 observations and 16 variables.&lt;BR /&gt;NOTE: WORK.SHP_FLU data set was successfully created.&lt;BR /&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;BR /&gt;real time 0.19 seconds&lt;BR /&gt;cpu time 0.16 seconds&lt;BR /&gt;2 The SAS System 12:36 Friday, February 11, 2022&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;42&lt;BR /&gt;43 proc content data=shp_flu;&lt;BR /&gt;ERROR: Procedure CONTENT not found.&lt;BR /&gt;44 run;&lt;BR /&gt;</description>
      <pubDate>Fri, 11 Feb 2022 21:00:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-variable-to-a-variable-in-excel-file/m-p/795782#M255276</guid>
      <dc:creator>bhca60</dc:creator>
      <dc:date>2022-02-11T21:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Match variable to a variable in excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-variable-to-a-variable-in-excel-file/m-p/795784#M255277</link>
      <description>Sorry, it's PROC CONTENTS - missed the S.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 11 Feb 2022 21:02:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-variable-to-a-variable-in-excel-file/m-p/795784#M255277</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-02-11T21:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: Match variable to a variable in excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-variable-to-a-variable-in-excel-file/m-p/795787#M255278</link>
      <description>It's a character $11 and is written as "Patient ID" but even when I type it as "patient id" it gives an error but it's a different type of error this time so maybe I'm getting close:&lt;BR /&gt;21&lt;BR /&gt;22 GOPTIONS ACCESSIBLE;&lt;BR /&gt;23 /*get a list of the patients that are in the vaccination list so that we only select their proc codes*/&lt;BR /&gt;24 proc sql;&lt;BR /&gt;25 create table members&lt;BR /&gt;26 as select *&lt;BR /&gt;27 from x.personAttribution&lt;BR /&gt;28 where memberNo in (select patient id from shp_flu);&lt;BR /&gt;__&lt;BR /&gt;22&lt;BR /&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, AS,&lt;BR /&gt;CONTAINS, EQ, EQT, GE, GET, GT, GTT, LE, LET, LIKE, LT, LTT, NE, NET, OR, ^=, |, ||, ~=.</description>
      <pubDate>Fri, 11 Feb 2022 21:25:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-variable-to-a-variable-in-excel-file/m-p/795787#M255278</guid>
      <dc:creator>bhca60</dc:creator>
      <dc:date>2022-02-11T21:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: Match variable to a variable in excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-variable-to-a-variable-in-excel-file/m-p/795789#M255279</link>
      <description>If the variable name has a space you need to refer to it in quotes with an N to tell SAS it's a name.&lt;BR /&gt;&lt;BR /&gt;'Patient ID'n &lt;BR /&gt;&lt;BR /&gt;Or add this before PROC IMPORT:&lt;BR /&gt;&lt;BR /&gt;options validvarname=v7;&lt;BR /&gt;&lt;BR /&gt;Reimport your data and the name should be Patient_ID instead, which is easier to work with.</description>
      <pubDate>Fri, 11 Feb 2022 21:31:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-variable-to-a-variable-in-excel-file/m-p/795789#M255279</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-02-11T21:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: Match variable to a variable in excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-variable-to-a-variable-in-excel-file/m-p/795791#M255280</link>
      <description>&lt;P&gt;THANK YOU!!&lt;/P&gt;</description>
      <pubDate>Fri, 11 Feb 2022 21:41:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-variable-to-a-variable-in-excel-file/m-p/795791#M255280</guid>
      <dc:creator>bhca60</dc:creator>
      <dc:date>2022-02-11T21:41:12Z</dc:date>
    </item>
  </channel>
</rss>

