<?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: Dealing with hyphen in field name in SAS EG in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Dealing-with-hyphen-in-field-name-in-SAS-EG/m-p/635809#M35743</link>
    <description>&lt;P&gt;Posting code and log here.&amp;nbsp; Please note the issue does not appear to be with the data within the field - it appears to be with the field name itself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 The SAS System 09:33 Monday, March 30, 2020&lt;/P&gt;&lt;P&gt;1 ;*';*";*/;quit;run;&lt;BR /&gt;2 OPTIONS PAGENO=MIN;&lt;BR /&gt;3 %LET _CLIENTTASKLABEL='Program (4)';&lt;BR /&gt;4 %LET _CLIENTPROCESSFLOWNAME='Process Flow';&lt;BR /&gt;5 %LET _CLIENTPROJECTPATH='\\EFS-1SMB001\team9\MAO\Workspace\Campaign Team\Josh\Latimer_Detail.egp';&lt;BR /&gt;6 %LET _CLIENTPROJECTPATHHOST='PCVPTWX6OP08348';&lt;BR /&gt;7 %LET _CLIENTPROJECTNAME='Latimer_Detail.egp';&lt;BR /&gt;8 %LET _SASPROGRAMFILE='';&lt;BR /&gt;9 %LET _SASPROGRAMFILEHOST='';&lt;BR /&gt;10&lt;BR /&gt;11 ODS _ALL_ CLOSE;&lt;BR /&gt;12 OPTIONS DEV=PNG;&lt;BR /&gt;13 GOPTIONS XPIXELS=0 YPIXELS=0;&lt;BR /&gt;14 FILENAME EGSR TEMP;&lt;BR /&gt;15 ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR&lt;BR /&gt;16 STYLE=HtmlBlue&lt;BR /&gt;17 STYLESHEET=(URL="file:///C:/Program%20Files/SASHome/SASEnterpriseGuide/7.1/Styles/HtmlBlue.css")&lt;BR /&gt;18 NOGTITLE&lt;BR /&gt;19 NOGFOOTNOTE&lt;BR /&gt;20 GPATH=&amp;amp;sasworklocation&lt;BR /&gt;21 ENCODING=UTF8&lt;BR /&gt;22 options(rolap="on")&lt;BR /&gt;23 ;&lt;BR /&gt;NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR&lt;BR /&gt;24&lt;BR /&gt;25 GOPTIONS ACCESSIBLE;&lt;BR /&gt;26 options validvarname=any;&lt;BR /&gt;27&lt;BR /&gt;28 proc sql;&lt;BR /&gt;29&lt;BR /&gt;30 create table work.com_base as&lt;BR /&gt;31 select distinct a.web_id as pid,&lt;BR /&gt;32 a.email_address as email,&lt;BR /&gt;32 !&lt;BR /&gt;33 b.ERM_PN_Name as PN_customer_name,&lt;BR /&gt;34 b.ERM_RPN_Name as RPN_customer_name,&lt;BR /&gt;35 b.ERM_Contact_Title as job_title,&lt;BR /&gt;36 b.ERM_Contact_First_Name as first_name,&lt;BR /&gt;37 b.ERM_Contact_Middle_Name as middle_name,&lt;BR /&gt;38 b.ERM_Contact_Last_Name as last_name,&lt;BR /&gt;39 c.'ERM_PN_Customer/Prospect_Status'n as status,&lt;BR /&gt;40 d.ERM_PAO_Segment as line_of_business,&lt;BR /&gt;41 case when d.ERM_Managed_Client_Flag = 'Yes' then 'Y' else 'N' end as managed_flag,&lt;BR /&gt;42 case when d.ERM_Managed_Client_Flag = 'Yes' then d.ERM_PAO_Name_Last_First else 'N/A' end as Relationship_Manager,&lt;BR /&gt;43 b.ERM_PN as profile_number,&lt;BR /&gt;44 b.ERM_RPN as relationship_profile_number&lt;BR /&gt;45 from work.mailfile a&lt;BR /&gt;46 left join COMMDAST.CDS_ts_ERMD_Contact_Details b&lt;BR /&gt;47 on a.Email_Address = upcase(b.'ERM_Contact_E-mail'n)&lt;BR /&gt;48 left join COMMDAST.CDS_ts_ERMD_Profile_Details c&lt;BR /&gt;49 on b.ERM_PN = c.ERM_PN&lt;BR /&gt;50 left join COMMDAST.CDS_ts_ERMD_Relationship_Details d&lt;BR /&gt;51 on c.ERM_RPN = d.ERM_RPN&lt;BR /&gt;52 where a.creative_type = 'COM'&lt;BR /&gt;53 ;&lt;BR /&gt;ERROR: CLI describe error: [SAS][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]Invalid column name 'ERM_Contact_E'. :&lt;BR /&gt;[SAS][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]Invalid column name 'mail'. : [SAS][ODBC SQL Server Wire&lt;BR /&gt;Protocol driver][Microsoft SQL Server]The batch could not be analyzed because of compile errors.&lt;BR /&gt;2 The SAS System 09:33 Monday, March 30, 2020&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;54&lt;BR /&gt;55 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.40 seconds&lt;BR /&gt;cpu time 0.34 seconds&lt;BR /&gt;&lt;BR /&gt;56&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;57 proc sql;&lt;BR /&gt;58&lt;BR /&gt;59 create table work.com_list as&lt;BR /&gt;60 select upcase('ERM_Contact_E-mail'n) as Email_Address,&lt;BR /&gt;61 ERM_PN_Name as PN_customer_name,&lt;BR /&gt;62 ERM_RPN_Name as RPN_customer_name,&lt;BR /&gt;63 ERM_Contact_Title as job_title,&lt;BR /&gt;64 ERM_Contact_First_Name as first_name,&lt;BR /&gt;65 ERM_Contact_Middle_Name as middle_name,&lt;BR /&gt;66 ERM_Contact_Last_Name as last_name,&lt;BR /&gt;67 ERM_PN as profile_number,&lt;BR /&gt;68 ERM_RPN as relationship_profile_number&lt;BR /&gt;69 from COMMDAST.CDS_ts_ERMD_Contact_Details&lt;BR /&gt;70 where upcase('ERM_Contact_E-mail'n) in (select Email_Address from work.mailfile where creative_type = 'COM');&lt;BR /&gt;ERROR: CLI describe error: [SAS][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]Invalid column name 'ERM_Contact_E'. :&lt;BR /&gt;[SAS][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]Invalid column name 'mail'. : [SAS][ODBC SQL Server Wire&lt;BR /&gt;Protocol driver][Microsoft SQL Server]The batch could not be analyzed because of compile errors.&lt;/P&gt;&lt;P&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;71&lt;BR /&gt;72 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.05 seconds&lt;BR /&gt;cpu time 0.05 seconds&lt;BR /&gt;&lt;BR /&gt;73&lt;BR /&gt;74 GOPTIONS NOACCESSIBLE;&lt;BR /&gt;75 %LET _CLIENTTASKLABEL=;&lt;BR /&gt;76 %LET _CLIENTPROCESSFLOWNAME=;&lt;BR /&gt;77 %LET _CLIENTPROJECTPATH=;&lt;BR /&gt;78 %LET _CLIENTPROJECTPATHHOST=;&lt;BR /&gt;79 %LET _CLIENTPROJECTNAME=;&lt;BR /&gt;80 %LET _SASPROGRAMFILE=;&lt;BR /&gt;81 %LET _SASPROGRAMFILEHOST=;&lt;BR /&gt;82&lt;BR /&gt;83 ;*';*";*/;quit;run;&lt;BR /&gt;84 ODS _ALL_ CLOSE;&lt;BR /&gt;85&lt;BR /&gt;86&lt;BR /&gt;87 QUIT; RUN;&lt;BR /&gt;88&lt;/P&gt;</description>
    <pubDate>Mon, 30 Mar 2020 13:40:00 GMT</pubDate>
    <dc:creator>J_Yetman</dc:creator>
    <dc:date>2020-03-30T13:40:00Z</dc:date>
    <item>
      <title>Dealing with hyphen in field name in SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Dealing-with-hyphen-in-field-name-in-SAS-EG/m-p/635068#M35732</link>
      <description>&lt;P&gt;I'm trying to work with data where there is a field named E-mail_Address.&amp;nbsp; The hyphen in the field name is causing SAS to look at the field as if it is two different fields, as I get an error telling me that 'E' and 'mail_Address' are invalid field names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Neither encasing the field in the text qualifier (such as 'E-mail_Address'n) nor using options validvarname=ANY resolves the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 15:55:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Dealing-with-hyphen-in-field-name-in-SAS-EG/m-p/635068#M35732</guid>
      <dc:creator>J_Yetman</dc:creator>
      <dc:date>2020-03-26T15:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with hyphen in field name in SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Dealing-with-hyphen-in-field-name-in-SAS-EG/m-p/635070#M35733</link>
      <description>&lt;P&gt;1) show an example value, need not be real but similar to the one you are using&lt;/P&gt;
&lt;P&gt;2) post the code or clearly describe what operation you are doing to the variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are a number of functions that could be doing that and how to fix requires more details, likely telling the function optionally which delimiters to use explicitly such as period and @ instead using default word delimiters which will include many punctuation characters.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 16:03:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Dealing-with-hyphen-in-field-name-in-SAS-EG/m-p/635070#M35733</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-03-26T16:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with hyphen in field name in SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Dealing-with-hyphen-in-field-name-in-SAS-EG/m-p/635080#M35734</link>
      <description>&lt;P&gt;I was sure it would be fine, and I was right...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data abc;
length 'E-mail_Address'n $5;
'E-mail_Address'n = "def"; output;
'E-mail_Address'n = "ghi"; output;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;24         
25         data abc;
26         length 'E-mail_Address'n $5;
27         'E-mail_Address'n = "def"; output;
28         'E-mail_Address'n = "ghi"; output;
29         run;

NOTE: The data set WORK.ABC has 2 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.00 seconds
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Mar 2020 16:19:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Dealing-with-hyphen-in-field-name-in-SAS-EG/m-p/635080#M35734</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2020-03-26T16:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with hyphen in field name in SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Dealing-with-hyphen-in-field-name-in-SAS-EG/m-p/635809#M35743</link>
      <description>&lt;P&gt;Posting code and log here.&amp;nbsp; Please note the issue does not appear to be with the data within the field - it appears to be with the field name itself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 The SAS System 09:33 Monday, March 30, 2020&lt;/P&gt;&lt;P&gt;1 ;*';*";*/;quit;run;&lt;BR /&gt;2 OPTIONS PAGENO=MIN;&lt;BR /&gt;3 %LET _CLIENTTASKLABEL='Program (4)';&lt;BR /&gt;4 %LET _CLIENTPROCESSFLOWNAME='Process Flow';&lt;BR /&gt;5 %LET _CLIENTPROJECTPATH='\\EFS-1SMB001\team9\MAO\Workspace\Campaign Team\Josh\Latimer_Detail.egp';&lt;BR /&gt;6 %LET _CLIENTPROJECTPATHHOST='PCVPTWX6OP08348';&lt;BR /&gt;7 %LET _CLIENTPROJECTNAME='Latimer_Detail.egp';&lt;BR /&gt;8 %LET _SASPROGRAMFILE='';&lt;BR /&gt;9 %LET _SASPROGRAMFILEHOST='';&lt;BR /&gt;10&lt;BR /&gt;11 ODS _ALL_ CLOSE;&lt;BR /&gt;12 OPTIONS DEV=PNG;&lt;BR /&gt;13 GOPTIONS XPIXELS=0 YPIXELS=0;&lt;BR /&gt;14 FILENAME EGSR TEMP;&lt;BR /&gt;15 ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR&lt;BR /&gt;16 STYLE=HtmlBlue&lt;BR /&gt;17 STYLESHEET=(URL="file:///C:/Program%20Files/SASHome/SASEnterpriseGuide/7.1/Styles/HtmlBlue.css")&lt;BR /&gt;18 NOGTITLE&lt;BR /&gt;19 NOGFOOTNOTE&lt;BR /&gt;20 GPATH=&amp;amp;sasworklocation&lt;BR /&gt;21 ENCODING=UTF8&lt;BR /&gt;22 options(rolap="on")&lt;BR /&gt;23 ;&lt;BR /&gt;NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR&lt;BR /&gt;24&lt;BR /&gt;25 GOPTIONS ACCESSIBLE;&lt;BR /&gt;26 options validvarname=any;&lt;BR /&gt;27&lt;BR /&gt;28 proc sql;&lt;BR /&gt;29&lt;BR /&gt;30 create table work.com_base as&lt;BR /&gt;31 select distinct a.web_id as pid,&lt;BR /&gt;32 a.email_address as email,&lt;BR /&gt;32 !&lt;BR /&gt;33 b.ERM_PN_Name as PN_customer_name,&lt;BR /&gt;34 b.ERM_RPN_Name as RPN_customer_name,&lt;BR /&gt;35 b.ERM_Contact_Title as job_title,&lt;BR /&gt;36 b.ERM_Contact_First_Name as first_name,&lt;BR /&gt;37 b.ERM_Contact_Middle_Name as middle_name,&lt;BR /&gt;38 b.ERM_Contact_Last_Name as last_name,&lt;BR /&gt;39 c.'ERM_PN_Customer/Prospect_Status'n as status,&lt;BR /&gt;40 d.ERM_PAO_Segment as line_of_business,&lt;BR /&gt;41 case when d.ERM_Managed_Client_Flag = 'Yes' then 'Y' else 'N' end as managed_flag,&lt;BR /&gt;42 case when d.ERM_Managed_Client_Flag = 'Yes' then d.ERM_PAO_Name_Last_First else 'N/A' end as Relationship_Manager,&lt;BR /&gt;43 b.ERM_PN as profile_number,&lt;BR /&gt;44 b.ERM_RPN as relationship_profile_number&lt;BR /&gt;45 from work.mailfile a&lt;BR /&gt;46 left join COMMDAST.CDS_ts_ERMD_Contact_Details b&lt;BR /&gt;47 on a.Email_Address = upcase(b.'ERM_Contact_E-mail'n)&lt;BR /&gt;48 left join COMMDAST.CDS_ts_ERMD_Profile_Details c&lt;BR /&gt;49 on b.ERM_PN = c.ERM_PN&lt;BR /&gt;50 left join COMMDAST.CDS_ts_ERMD_Relationship_Details d&lt;BR /&gt;51 on c.ERM_RPN = d.ERM_RPN&lt;BR /&gt;52 where a.creative_type = 'COM'&lt;BR /&gt;53 ;&lt;BR /&gt;ERROR: CLI describe error: [SAS][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]Invalid column name 'ERM_Contact_E'. :&lt;BR /&gt;[SAS][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]Invalid column name 'mail'. : [SAS][ODBC SQL Server Wire&lt;BR /&gt;Protocol driver][Microsoft SQL Server]The batch could not be analyzed because of compile errors.&lt;BR /&gt;2 The SAS System 09:33 Monday, March 30, 2020&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;54&lt;BR /&gt;55 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.40 seconds&lt;BR /&gt;cpu time 0.34 seconds&lt;BR /&gt;&lt;BR /&gt;56&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;57 proc sql;&lt;BR /&gt;58&lt;BR /&gt;59 create table work.com_list as&lt;BR /&gt;60 select upcase('ERM_Contact_E-mail'n) as Email_Address,&lt;BR /&gt;61 ERM_PN_Name as PN_customer_name,&lt;BR /&gt;62 ERM_RPN_Name as RPN_customer_name,&lt;BR /&gt;63 ERM_Contact_Title as job_title,&lt;BR /&gt;64 ERM_Contact_First_Name as first_name,&lt;BR /&gt;65 ERM_Contact_Middle_Name as middle_name,&lt;BR /&gt;66 ERM_Contact_Last_Name as last_name,&lt;BR /&gt;67 ERM_PN as profile_number,&lt;BR /&gt;68 ERM_RPN as relationship_profile_number&lt;BR /&gt;69 from COMMDAST.CDS_ts_ERMD_Contact_Details&lt;BR /&gt;70 where upcase('ERM_Contact_E-mail'n) in (select Email_Address from work.mailfile where creative_type = 'COM');&lt;BR /&gt;ERROR: CLI describe error: [SAS][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]Invalid column name 'ERM_Contact_E'. :&lt;BR /&gt;[SAS][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]Invalid column name 'mail'. : [SAS][ODBC SQL Server Wire&lt;BR /&gt;Protocol driver][Microsoft SQL Server]The batch could not be analyzed because of compile errors.&lt;/P&gt;&lt;P&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;71&lt;BR /&gt;72 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.05 seconds&lt;BR /&gt;cpu time 0.05 seconds&lt;BR /&gt;&lt;BR /&gt;73&lt;BR /&gt;74 GOPTIONS NOACCESSIBLE;&lt;BR /&gt;75 %LET _CLIENTTASKLABEL=;&lt;BR /&gt;76 %LET _CLIENTPROCESSFLOWNAME=;&lt;BR /&gt;77 %LET _CLIENTPROJECTPATH=;&lt;BR /&gt;78 %LET _CLIENTPROJECTPATHHOST=;&lt;BR /&gt;79 %LET _CLIENTPROJECTNAME=;&lt;BR /&gt;80 %LET _SASPROGRAMFILE=;&lt;BR /&gt;81 %LET _SASPROGRAMFILEHOST=;&lt;BR /&gt;82&lt;BR /&gt;83 ;*';*";*/;quit;run;&lt;BR /&gt;84 ODS _ALL_ CLOSE;&lt;BR /&gt;85&lt;BR /&gt;86&lt;BR /&gt;87 QUIT; RUN;&lt;BR /&gt;88&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 13:40:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Dealing-with-hyphen-in-field-name-in-SAS-EG/m-p/635809#M35743</guid>
      <dc:creator>J_Yetman</dc:creator>
      <dc:date>2020-03-30T13:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with hyphen in field name in SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Dealing-with-hyphen-in-field-name-in-SAS-EG/m-p/635831#M35747</link>
      <description>Looks like an SQL Server issue.  What does PROC CONTENTS show as the names of the variables in the table you are referencing from SAS as COMMDAST.CDS_ts_ERMD_Contact_Details.</description>
      <pubDate>Mon, 30 Mar 2020 14:57:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Dealing-with-hyphen-in-field-name-in-SAS-EG/m-p/635831#M35747</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-03-30T14:57:30Z</dc:date>
    </item>
  </channel>
</rss>

