<?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: Syntax Error for proc import? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Syntax-Error-for-proc-import/m-p/404589#M279058</link>
    <description>&lt;P&gt;Did your data source provide a key for why it contains ** for some variables that are generally numeric? I would expect a document from the source says something like "Values that cannot be reliably estimated are shown as ** in the data sets." or similar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example &lt;A href="http://www2.census.gov/programs-surveys/acs/tech_docs/data_suppression/ACSO_Data_Suppression.pdf" target="_blank"&gt;http://www2.census.gov/programs-surveys/acs/tech_docs/data_suppression/ACSO_Data_Suppression.pdf&lt;/A&gt; is a document for why certain values from the American Community Survey suppresses data in some tables.&lt;/P&gt;
&lt;P&gt;You don't specify that you are working with ACS data but your path name and example data is suggestive.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Likely you will want the ** to be missing for final analysis but documentation may provide more details that you can include in your analysis or final report.&lt;/P&gt;</description>
    <pubDate>Mon, 16 Oct 2017 20:17:58 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-10-16T20:17:58Z</dc:date>
    <item>
      <title>Syntax Error for proc import?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-Error-for-proc-import/m-p/404464#M279053</link>
      <description>&lt;P&gt;Hello:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found syntax error was shown when I use proc import.&amp;nbsp;&amp;nbsp; I think it's because of double * in the dataline.&amp;nbsp;&amp;nbsp; Please advise how to fix it.&amp;nbsp; Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; State=CA;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Year=2009;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;IMPORT&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;OUT&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=Education&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;state&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;amp;year &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;DATAFILE&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"\\abc.org\project\Share\ACS\&amp;amp;state\&amp;amp;year\Education&amp;amp;year..csv"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;DBMS&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=CSV REPLACE;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;GETNAMES&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=YES;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;DATAROW&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;183 PROC IMPORT OUT=Education&amp;amp;state.&amp;amp;year&lt;/P&gt;
&lt;P&gt;SYMBOLGEN: Macro variable STATE resolves to CA&lt;/P&gt;
&lt;P&gt;SYMBOLGEN: Macro variable YEAR resolves to 2009&lt;/P&gt;
&lt;P&gt;184 DATAFILE= "\\abc.org\project\Share\ACS&lt;/P&gt;
&lt;P&gt;184! data\&amp;amp;state\&amp;amp;year\Education&amp;amp;year..csv"&lt;/P&gt;
&lt;P&gt;SYMBOLGEN: Macro variable STATE resolves to CA&lt;/P&gt;
&lt;P&gt;SYMBOLGEN: Macro variable YEAR resolves to 2009&lt;/P&gt;
&lt;P&gt;SYMBOLGEN: Macro variable YEAR resolves to 2009&lt;/P&gt;
&lt;P&gt;185 DBMS=CSV REPLACE;&lt;/P&gt;
&lt;P&gt;186 GETNAMES=YES;&lt;/P&gt;
&lt;P&gt;187 DATAROW=2;&lt;/P&gt;
&lt;P&gt;188 RUN;&lt;/P&gt;
&lt;P&gt;189 /**********************************************************************&lt;/P&gt;
&lt;P&gt;190 * PRODUCT: SAS&lt;/P&gt;
&lt;P&gt;191 * VERSION: 9.4&lt;/P&gt;
&lt;P&gt;192 * CREATOR: External File Interface&lt;/P&gt;
&lt;P&gt;193 * DATE: 16OCT17&lt;/P&gt;
&lt;P&gt;194 * DESC: Generated SAS Datastep Code&lt;/P&gt;
&lt;P&gt;195 * TEMPLATE SOURCE: (None Specified.)&lt;/P&gt;
&lt;P&gt;196 ***********************************************************************/&lt;/P&gt;
&lt;P&gt;197 data WORK.EDUCATIONCA2009 ;&lt;/P&gt;
&lt;P&gt;198 %let _EFIERR_ = 0; /* set the ERROR detection macro variable */&lt;/P&gt;
&lt;P&gt;199 infile '\\abc.org\project\Share\ACS&lt;/P&gt;
&lt;P&gt;199! data\CA\2009\Education2009.csv' delimiter = ',' MISSOVER DSD lrecl=32767 firstobs=2 ;&lt;/P&gt;
&lt;P&gt;200 informat GEO_id $20. ;&lt;/P&gt;
&lt;P&gt;201 informat GEO_id2 best32. ;&lt;/P&gt;
&lt;P&gt;202 informat GEO_display_label $47. ;&lt;/P&gt;
&lt;P&gt;203 informat HC01_EST_VC06 best32. ;&lt;/P&gt;
&lt;P&gt;204 informat HC01_MOE_VC06 best32. ;&lt;/P&gt;
&lt;P&gt;205 informat HC02_EST_VC06 best32. ;&lt;/P&gt;
&lt;P&gt;206 informat HC02_MOE_VC06 best32. ;&lt;/P&gt;
&lt;P&gt;207 informat HC03_EST_VC06 best32. ;&lt;/P&gt;
&lt;P&gt;208 informat HC03_MOE_VC06 best32. ;&lt;/P&gt;
&lt;P&gt;209 informat HC01_EST_VC07 best32. ;&lt;/P&gt;
&lt;P&gt;210 informat HC01_MOE_VC07 best32. ;&lt;/P&gt;
&lt;P&gt;211 informat HC02_EST_VC07 best32. ;&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;233 format GEO_id $20. ;&lt;/P&gt;
&lt;P&gt;234 format GEO_id2 best12. ;&lt;/P&gt;
&lt;P&gt;235 format GEO_display_label $47. ;&lt;/P&gt;
&lt;P&gt;236 format HC01_EST_VC06 best12. ;&lt;/P&gt;
&lt;P&gt;237 format HC01_MOE_VC06 best12. ;&lt;/P&gt;
&lt;P&gt;238 format HC02_EST_VC06 best12. ;&lt;/P&gt;
&lt;P&gt;239 format HC02_MOE_VC06 best12. ;&lt;/P&gt;
&lt;P&gt;240 format HC03_EST_VC06 best12. ;&lt;/P&gt;
&lt;P&gt;241 format HC03_MOE_VC06 best12. ;&lt;/P&gt;
&lt;P&gt;242 format HC01_EST_VC07 best12. ;&lt;/P&gt;
&lt;P&gt;243 format HC01_MOE_VC07 best12. ;&lt;/P&gt;
&lt;P&gt;244 format HC02_EST_VC07 best12. ;&lt;/P&gt;
&lt;P&gt;245 format HC02_MOE_VC07 best12. ;&lt;/P&gt;
&lt;P&gt;233 format GEO_id $20. ;&lt;/P&gt;
&lt;P&gt;234 format GEO_id2 best12. ;&lt;/P&gt;
&lt;P&gt;235 format GEO_display_label $47. ;&lt;/P&gt;
&lt;P&gt;236 format HC01_EST_VC06 best12. ;&lt;/P&gt;
&lt;P&gt;237 format HC01_MOE_VC06 best12. ;&lt;/P&gt;
&lt;P&gt;238 format HC02_EST_VC06 best12. ;&lt;/P&gt;
&lt;P&gt;239 format HC02_MOE_VC06 best12. ;&lt;/P&gt;
&lt;P&gt;240 format HC03_EST_VC06 best12. ;&lt;/P&gt;
&lt;P&gt;241 format HC03_MOE_VC06 best12. ;&lt;/P&gt;
&lt;P&gt;242 format HC01_EST_VC07 best12. ;&lt;/P&gt;
&lt;P&gt;243 format HC01_MOE_VC07 best12. ;&lt;/P&gt;
&lt;P&gt;244 format HC02_EST_VC07 best12. ;&lt;/P&gt;
&lt;P&gt;245 format HC02_MOE_VC07 best12. ;&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;300 ;&lt;/P&gt;
&lt;P&gt;301 if _ERROR_ then call symputx('_EFIERR_',1); /* set ERROR detection macro variable */&lt;/P&gt;
&lt;P&gt;302 run;&lt;/P&gt;
&lt;P&gt;NOTE: Invalid data for HC03_EST_VC07 in line 923 121-121.&lt;/P&gt;
&lt;P&gt;NOTE: Invalid data for HC03_MOE_VC07 in line 923 123-124.&lt;/P&gt;
&lt;P&gt;NOTE: Invalid data for HC03_EST_VC08 in line 923 144-144.&lt;/P&gt;
&lt;P&gt;NOTE: Invalid data for HC03_MOE_VC08 in line 923 146-147.&lt;/P&gt;
&lt;P&gt;NOTE: Invalid data for HC03_EST_VC12 in line 923 165-165.&lt;/P&gt;
&lt;P&gt;NOTE: Invalid data for HC03_MOE_VC12 in line 923 167-168.&lt;/P&gt;
&lt;P&gt;NOTE: Invalid data for HC03_EST_VC13 in line 923 186-186.&lt;/P&gt;
&lt;P&gt;NOTE: Invalid data for HC03_MOE_VC13 in line 923 188-189.&lt;/P&gt;
&lt;P&gt;RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+---&lt;/P&gt;
&lt;P&gt;923 1400000US06029004302,6029004302,"Census Tract 43.02, Kern County, California",4476,277,4&lt;/P&gt;
&lt;P&gt;89 476,277,0,132,10.6,2.5,10.6,2.5,-,**,36.3,4.8,36.3,4.8,-,**,2.1,1.3,2.1,1.3,-,**,0.8,0.9&lt;/P&gt;
&lt;P&gt;177 ,0.8,0.9,-,** 189&lt;/P&gt;
&lt;P&gt;GEO_id=1400000US06029004302 GEO_id2=6029004302&lt;/P&gt;
&lt;P&gt;GEO_display_label=Census Tract 43.02, Kern County, California HC01_EST_VC06=4476 HC01_MOE_VC06=277&lt;/P&gt;
&lt;P&gt;HC02_EST_VC06=4476 HC02_MOE_VC06=277 HC03_EST_VC06=0 HC03_MOE_VC06=132 HC01_EST_VC07=10.6&lt;/P&gt;
&lt;P&gt;HC01_MOE_VC07=2.5 HC02_EST_VC07=10.6 HC02_MOE_VC07=2.5 HC03_EST_VC07=. HC03_MOE_VC07=.&lt;/P&gt;
&lt;P&gt;HC01_EST_VC08=36.3 HC01_MOE_VC08=4.8 HC02_EST_VC08=36.3 HC02_MOE_VC08=4.8 HC03_EST_VC08=.&lt;/P&gt;
&lt;P&gt;HC03_MOE_VC08=. HC01_EST_VC12=2.1 HC01_MOE_VC12=1.3 HC02_EST_VC12=2.1 HC02_MOE_VC12=1.3&lt;/P&gt;
&lt;P&gt;HC03_EST_VC12=. HC03_MOE_VC12=. HC01_EST_VC13=0.8 HC01_MOE_VC13=0.9 HC02_EST_VC13=0.8&lt;/P&gt;
&lt;P&gt;HC02_MOE_VC13=0.9 HC03_EST_VC13=. HC03_MOE_VC13=. _ERROR_=1 _N_=922&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;WARNING: Limit set by ERRORS= option reached. Further errors of this type will not be printed.&lt;/P&gt;
&lt;P&gt;ERROR: Import unsuccessful. See SAS Log for details.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2017 14:30:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-Error-for-proc-import/m-p/404464#M279053</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2017-10-16T14:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Error for proc import?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-Error-for-proc-import/m-p/404468#M279054</link>
      <description>&lt;P&gt;Yes, the proc import procedure is a guessing procedure, so it analyses the data and guesses what the column's type should be, in this case it decides that variable is numeric, and then it hits a data item - ** which is not numeric and not convertible, so throws and error.&amp;nbsp; I suppose first question would be why you have ** in a numeric column - if you want to keep those then make that column character.&amp;nbsp; As for the import, I would only use proc import once, take the code it generates and then modify it to correctly match the data format which you know best, i.e. avoid the guessing.&amp;nbsp; In this case changing that column to a text one should import all the data, however if you want numeric, then either removes these ** items, or read in as character and then create a new numeric variable from the character data.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2017 14:38:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-Error-for-proc-import/m-p/404468#M279054</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-10-16T14:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Error for proc import?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-Error-for-proc-import/m-p/404472#M279055</link>
      <description>&lt;P&gt;This is not a syntax error, as the SAS code is valid. This is a data error, detected because proc import writes code that checks the automatic data step variable _ERROR_ and sets a macro variable if data errors are found:&lt;/P&gt;
&lt;PRE&gt;301 if _ERROR_ then call symputx('_EFIERR_',1); /* set ERROR detection macro variable */&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Oct 2017 14:48:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-Error-for-proc-import/m-p/404472#M279055</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-10-16T14:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Error for proc import?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-Error-for-proc-import/m-p/404480#M279056</link>
      <description>&lt;P&gt;Actually, the proc import program was continue.&amp;nbsp; SAS just automatically assign the&amp;nbsp;dot to replace the '_' and '**'.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2017 15:01:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-Error-for-proc-import/m-p/404480#M279056</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2017-10-16T15:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Error for proc import?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-Error-for-proc-import/m-p/404497#M279057</link>
      <description>&lt;P&gt;On the PROC IMPORT set GUESSINGROWS=MAX so that SAS scans more of the file before it makes the type/format 'guess'.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2017 15:20:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-Error-for-proc-import/m-p/404497#M279057</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-16T15:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Error for proc import?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-Error-for-proc-import/m-p/404589#M279058</link>
      <description>&lt;P&gt;Did your data source provide a key for why it contains ** for some variables that are generally numeric? I would expect a document from the source says something like "Values that cannot be reliably estimated are shown as ** in the data sets." or similar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example &lt;A href="http://www2.census.gov/programs-surveys/acs/tech_docs/data_suppression/ACSO_Data_Suppression.pdf" target="_blank"&gt;http://www2.census.gov/programs-surveys/acs/tech_docs/data_suppression/ACSO_Data_Suppression.pdf&lt;/A&gt; is a document for why certain values from the American Community Survey suppresses data in some tables.&lt;/P&gt;
&lt;P&gt;You don't specify that you are working with ACS data but your path name and example data is suggestive.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Likely you will want the ** to be missing for final analysis but documentation may provide more details that you can include in your analysis or final report.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2017 20:17:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-Error-for-proc-import/m-p/404589#M279058</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-10-16T20:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Error for proc import?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-Error-for-proc-import/m-p/406703#M279059</link>
      <description>&lt;P&gt;Thanks, Ballardw.&amp;nbsp;&amp;nbsp; The file is very helpful information.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 18:53:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-Error-for-proc-import/m-p/406703#M279059</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2017-10-23T18:53:10Z</dc:date>
    </item>
  </channel>
</rss>

