<?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: ERROR: A lock is not available for ED.ALL_MRN.DATA. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-lock-is-not-available-for-ED-ALL-MRN-DATA/m-p/747946#M234839</link>
    <description>&lt;P&gt;There is no need to do a left join on ALL_MRM when you only want patients in this table. Simplifying your query may help.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
CREATE TABLE all_mrn AS 
SELECT *
FROM epicfin.HospitalAccount a
LEFT JOIN EPICPAT.Identity I on a.PatientID = I.PatientID 
INNER JOIN ed.all_mrn m on I.PatientIdentityID  = m.mrn
;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Jun 2021 20:02:51 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2021-06-14T20:02:51Z</dc:date>
    <item>
      <title>ERROR: A lock is not available for ED.ALL_MRN.DATA.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-lock-is-not-available-for-ED-ALL-MRN-DATA/m-p/747815#M234783</link>
      <description>&lt;P&gt;Hello all&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried running this code and got an error I have never seen before. I looked at the posts here about it but none of the responses given seemed to have the similar scenario. I ran this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
CREATE TABLE all_mrn AS 
SELECT *
FROM epicfin.HospitalAccount a
LEFT JOIN EPICPAT.Identity I on a.PatientID = I.PatientID 
LEFT JOIN ed.all_mrn m on I.PatientIdentityID  = m.mrn
WHERE PatientIdentityID IN (SELECT mrn FROM ed.all_mrn)
;QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and got this error&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;34         PROC SQL;
35         CREATE TABLE all_mrn AS
36         SELECT *
37         FROM epicfin.HospitalAccount a
38         LEFT JOIN EPICPAT.Identity I on a.PatientID = I.PatientID
39         LEFT JOIN ed.all_mrn m on I.PatientIdentityID  = m.mrn
40         WHERE PatientIdentityID IN (SELECT mrn FROM ed.all_mrn)
41         ;
ERROR: A lock is not available for ED.ALL_MRN.DATA.
ERROR: A lock is not available for ED.ALL_MRN.DATA.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What I am trying to do is extract all the rows and columns from the&amp;nbsp;epicfin.HospitalAccount table that corresponds with information&amp;nbsp;on&amp;nbsp;the&amp;nbsp;ed.all_mrn&amp;nbsp;table. The ed.all_mrn&amp;nbsp;table only has one column and that column is MRN. The epicfin.HospitalAccount does not have that column so I had to join it with the EPICPAT.Identity that has the PatientIdentityID column which is the equivalent to MRN. Can anyone assist me on this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 14:27:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-lock-is-not-available-for-ED-ALL-MRN-DATA/m-p/747815#M234783</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2021-06-14T14:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A lock is not available for ED.ALL_MRN.DATA.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-lock-is-not-available-for-ED-ALL-MRN-DATA/m-p/747822#M234788</link>
      <description>&lt;P&gt;It seems that someone/a process has openb that tbale in update mode, thus not allowing you to read it.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 14:39:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-lock-is-not-available-for-ED-ALL-MRN-DATA/m-p/747822#M234788</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2021-06-14T14:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A lock is not available for ED.ALL_MRN.DATA.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-lock-is-not-available-for-ED-ALL-MRN-DATA/m-p/747856#M234810</link>
      <description>&lt;P&gt;Thanks Linus. I did not get the error message this time when i ran the code, however, I am now getting these warnings and error:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;34         PROC SQL;
35         CREATE TABLE all_mrn AS
36         SELECT *
37         FROM epicfin.HospitalAccount a
38         LEFT JOIN EPICPAT.Identity I on a.PatientID = I.PatientID
39         LEFT JOIN ed.all_mrn m on I.PatientIdentityID  = m.mrn
40         WHERE PatientIdentityID IN (SELECT mrn FROM ed.all_mrn)
41         ;
WARNING: Variable PatientID already exists on file WORK.ALL_MRN.
WARNING: Variable CommunityPhysicalOwnerID already exists on file WORK.ALL_MRN.
WARNING: Variable CommunityLogicalOwnerID already exists on file WORK.ALL_MRN.
2                                                          The SAS System                                11:24 Monday, June 14, 2021

WARNING: Variable PartnersEDWLastModifiedDTS already exists on file WORK.ALL_MRN.
WARNING: Variable EDWLastModifiedDTS already exists on file WORK.ALL_MRN.
ERROR: Sort execution failure.

NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
41       !  QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Jun 2021 16:03:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-lock-is-not-available-for-ED-ALL-MRN-DATA/m-p/747856#M234810</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2021-06-14T16:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A lock is not available for ED.ALL_MRN.DATA.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-lock-is-not-available-for-ED-ALL-MRN-DATA/m-p/747946#M234839</link>
      <description>&lt;P&gt;There is no need to do a left join on ALL_MRM when you only want patients in this table. Simplifying your query may help.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
CREATE TABLE all_mrn AS 
SELECT *
FROM epicfin.HospitalAccount a
LEFT JOIN EPICPAT.Identity I on a.PatientID = I.PatientID 
INNER JOIN ed.all_mrn m on I.PatientIdentityID  = m.mrn
;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 20:02:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-lock-is-not-available-for-ED-ALL-MRN-DATA/m-p/747946#M234839</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-06-14T20:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A lock is not available for ED.ALL_MRN.DATA.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-lock-is-not-available-for-ED-ALL-MRN-DATA/m-p/747961#M234844</link>
      <description>&lt;P&gt;Thanks SASKiwi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried your suggestion but still get this error:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;34         PROC SQL;
35         CREATE TABLE all_mrn AS
36         SELECT *
37         FROM epicfin.HospitalAccount a
38         LEFT JOIN EPICPAT.Identity I on a.PatientID = I.PatientID
39         INNER JOIN ed.all_mrn m on I.PatientIdentityID  = m.mrn
40         ;
WARNING: Variable PatientID already exists on file WORK.ALL_MRN.
WARNING: Variable CommunityPhysicalOwnerID already exists on file WORK.ALL_MRN.
WARNING: Variable CommunityLogicalOwnerID already exists on file WORK.ALL_MRN.
WARNING: Variable PartnersEDWLastModifiedDTS already exists on file WORK.ALL_MRN.
2                                                          The SAS System                                11:24 Monday, June 14, 2021

WARNING: Variable EDWLastModifiedDTS already exists on file WORK.ALL_MRN.
ERROR: Sort execution failure.

NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
41         QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 20:48:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-lock-is-not-available-for-ED-ALL-MRN-DATA/m-p/747961#M234844</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2021-06-14T20:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A lock is not available for ED.ALL_MRN.DATA.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-lock-is-not-available-for-ED-ALL-MRN-DATA/m-p/747969#M234850</link>
      <description>&lt;P&gt;Sort execution failures tend to indicate that the volume of data being selected is too large. Are you running this on a PC or a remote SAS server? Try simplifying your query by having just one join and see how you get on. It's possible that your join criteria needs to change but without knowing what your input data looks like I can't offer any advice.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 21:21:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-lock-is-not-available-for-ED-ALL-MRN-DATA/m-p/747969#M234850</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-06-14T21:21:44Z</dc:date>
    </item>
  </channel>
</rss>

