<?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 65-58: Name 'AMCOHORTS_01MAY2019_31MAR2020_MEDICAL' is too long for a SAS name in this con in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/ERROR-65-58-Name-AMCOHORTS-01MAY2019-31MAR2020-MEDICAL-is-too/m-p/668113#M23076</link>
    <description>&lt;P&gt;I presume you're trying to&amp;nbsp;&lt;EM&gt;import&amp;nbsp;&lt;/EM&gt;that Excel file in a SAS dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like&amp;nbsp;&lt;EM&gt;AMCohorts_01May2019_31Mar2020_medical.xlsx&amp;nbsp;&lt;/EM&gt;is the name of the Excel file, and&amp;nbsp;&lt;EM&gt;AMCohorts_01May2019_31Mar2020_m&amp;nbsp;&lt;/EM&gt;is the name of the sheet/tab in the Excel file? If so, then here are two different approaches that should work for importing your Excel file:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Excel file: AMCohorts_01May2019_31Mar2020_medical.xlsx  */
/* Sheet name: AMCohorts_01May2019_31Mar2020_m   */

/* Approach 1 - using a LIBNAME */
libname clmFile xlsx 'path\AMCohorts_01May2019_31Mar2020_medical.xlsx';
/* (note that clmFile must be no longer than 8 characters for a LIBNAME) */

proc sql;
    create table work.import1 as
    select *
    from clmFile.AMCohorts_01May2019_31Mar2020_m
    ;
quit;

/* Approach 2 - using PROC IMPORT*/
proc import datafile='path\AMCohorts_01May2019_31Mar2020_medical.xlsx'
    out=work.import2
    dbms=xlsx
    replace;
    sheet='AMCohorts_01May2019_31Mar2020_m';
quit;&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, 09 Jul 2020 17:37:09 GMT</pubDate>
    <dc:creator>mklangley</dc:creator>
    <dc:date>2020-07-09T17:37:09Z</dc:date>
    <item>
      <title>ERROR 65-58: Name 'AMCOHORTS_01MAY2019_31MAR2020_MEDICAL' is too long for a SAS name in this context</title>
      <link>https://communities.sas.com/t5/New-SAS-User/ERROR-65-58-Name-AMCOHORTS-01MAY2019-31MAR2020-MEDICAL-is-too/m-p/668091#M23074</link>
      <description>&lt;P&gt;Good afternoon&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to export an excel file into SAS EG and I keep getting the above mentioned error message. Can anyone assist me? This is the code I am using.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* claims file name from AM From payer directory */
%LET claimsFile= \\Cifs2\pop_lab$\P4P\BCBSMA\FY20\Actively Managed\From BCBSMA\AMCohorts_01May2019_31Mar2020_medical.xlsx;
%LET claimsFileType= XLSX; 		/* Options: DLM, XLSX */
%LET claimsSheetname= AMCohorts_01May2019_31Mar2020_m;

LIBNAME EPICPAT odbc complete="driver=SQL Server; database=EPIC; server=PHSSQL2195" schema=PATIENT; /* dev server */

/*Cohort period*/
%let Beg_dt= '01MAY2019'D;
%LET End_dt = '30APR2020'D;
%LET HCPCS = hcpcs_proc_cd IN ('99281',' 99282', '99283', '99284', '99285');
%LET REV = revenue_cd IN ('450','451','452','456','459','981');

proc sql;
create table AMCohort as select
distinct *
from claimsfile.AMCohorts_01May2019_31Mar2020_medical
where &amp;amp;REV
and &amp;amp;HCPCS
;quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Jul 2020 16:40:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/ERROR-65-58-Name-AMCOHORTS-01MAY2019-31MAR2020-MEDICAL-is-too/m-p/668091#M23074</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2020-07-09T16:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 65-58: Name 'AMCOHORTS_01MAY2019_31MAR2020_MEDICAL' is too long for a SAS name in this con</title>
      <link>https://communities.sas.com/t5/New-SAS-User/ERROR-65-58-Name-AMCOHORTS-01MAY2019-31MAR2020-MEDICAL-is-too/m-p/668113#M23076</link>
      <description>&lt;P&gt;I presume you're trying to&amp;nbsp;&lt;EM&gt;import&amp;nbsp;&lt;/EM&gt;that Excel file in a SAS dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like&amp;nbsp;&lt;EM&gt;AMCohorts_01May2019_31Mar2020_medical.xlsx&amp;nbsp;&lt;/EM&gt;is the name of the Excel file, and&amp;nbsp;&lt;EM&gt;AMCohorts_01May2019_31Mar2020_m&amp;nbsp;&lt;/EM&gt;is the name of the sheet/tab in the Excel file? If so, then here are two different approaches that should work for importing your Excel file:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Excel file: AMCohorts_01May2019_31Mar2020_medical.xlsx  */
/* Sheet name: AMCohorts_01May2019_31Mar2020_m   */

/* Approach 1 - using a LIBNAME */
libname clmFile xlsx 'path\AMCohorts_01May2019_31Mar2020_medical.xlsx';
/* (note that clmFile must be no longer than 8 characters for a LIBNAME) */

proc sql;
    create table work.import1 as
    select *
    from clmFile.AMCohorts_01May2019_31Mar2020_m
    ;
quit;

/* Approach 2 - using PROC IMPORT*/
proc import datafile='path\AMCohorts_01May2019_31Mar2020_medical.xlsx'
    out=work.import2
    dbms=xlsx
    replace;
    sheet='AMCohorts_01May2019_31Mar2020_m';
quit;&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, 09 Jul 2020 17:37:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/ERROR-65-58-Name-AMCOHORTS-01MAY2019-31MAR2020-MEDICAL-is-too/m-p/668113#M23076</guid>
      <dc:creator>mklangley</dc:creator>
      <dc:date>2020-07-09T17:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 65-58: Name 'AMCOHORTS_01MAY2019_31MAR2020_MEDICAL' is too long for a SAS name in this con</title>
      <link>https://communities.sas.com/t5/New-SAS-User/ERROR-65-58-Name-AMCOHORTS-01MAY2019-31MAR2020-MEDICAL-is-too/m-p/668117#M23077</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/114971"&gt;@wheddingsjr&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Good afternoon&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to export an excel file into SAS EG and I keep getting the above mentioned error message. Can anyone assist me? This is the code I am using.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* claims file name from AM From payer directory */
%LET claimsFile= \\Cifs2\pop_lab$\P4P\BCBSMA\FY20\Actively Managed\From BCBSMA\AMCohorts_01May2019_31Mar2020_medical.xlsx;
%LET claimsFileType= XLSX; 		/* Options: DLM, XLSX */
%LET claimsSheetname= AMCohorts_01May2019_31Mar2020_m;

LIBNAME EPICPAT odbc complete="driver=SQL Server; database=EPIC; server=PHSSQL2195" schema=PATIENT; /* dev server */

/*Cohort period*/
%let Beg_dt= '01MAY2019'D;
%LET End_dt = '30APR2020'D;
%LET HCPCS = hcpcs_proc_cd IN ('99281',' 99282', '99283', '99284', '99285');
%LET REV = revenue_cd IN ('450','451','452','456','459','981');

proc sql;
create table AMCohort as select
distinct *
from claimsfile.AMCohorts_01May2019_31Mar2020_medical
where &amp;amp;REV
and &amp;amp;HCPCS
;quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I do not see any code in that posted that attempts to use the XLSX file in any way.&lt;/P&gt;
&lt;P&gt;The way you use&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;from claimsfile.AMCohorts_01May2019_31Mar2020_medical&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is telling SAS to look for that way-too-long name AMCohorts_01May2019_31Mar2020_medical in the library named Claimsfile. Library names are limited to &lt;STRONG&gt;8&lt;/STRONG&gt; characters, so "Claimsfile" at 10 characters is invalid, the data set names are limited to 32 characters and that at 37 characters is too long.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if you meant to use the text in that macro variable as a data source you need to do something else to establish a link with the file. A libname statement or task to connect to the file.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 17:41:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/ERROR-65-58-Name-AMCOHORTS-01MAY2019-31MAR2020-MEDICAL-is-too/m-p/668117#M23077</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-09T17:41:43Z</dc:date>
    </item>
  </channel>
</rss>

