<?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: Read in data with '*&amp;quot; in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Read-in-data-with-quot/m-p/485457#M126135</link>
    <description>&lt;P&gt;What does your import agreement state?&amp;nbsp; If col4 is supposed to be a time variable and your getting * in there, then that is a data fail and the data should be returned to the sender.&amp;nbsp; The same for date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Avoid using proc import, it is a guessing procedure - i.e. it tries to guess your data.&amp;nbsp; In this case it is assuming that those variables are dates, or times respectively, and thus when it encounters a * it falls over - correctly as dates/times cannot be *.&amp;nbsp; You could write a datastep to import this data, setting the formats of those two variables to character, but then you would either have them as character or need to convert to numeric data or time.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And as you will respond with "I have no data agreement", trying to fix it will lead you in circles, maybe next time it will be . rather than *, or maybe something else - this is why an agreement is so important.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Aug 2018 13:08:56 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-08-09T13:08:56Z</dc:date>
    <item>
      <title>Read in data with '*"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-in-data-with-quot/m-p/485451#M126131</link>
      <description>&lt;P&gt;Dear community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Part of the CSV file looks like below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;9001&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&l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P&gt;11003&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;no&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2018-04-19&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;8:28&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;multiphase or dynamic&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;11004&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;no&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2018-04-19&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;13:23&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;multiphase or dynamic&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;import&lt;/STRONG&gt; datafile="C:\Users\sasuser\sam.csv"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; out=aolc dbms=csv replace ; getnames=yes;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Log show the message below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: Invalid data for prstdtc_cta_time in line 169 56-56.&lt;/P&gt;&lt;P&gt;RULE:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+&lt;/P&gt;&lt;P&gt;169&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; incomplete,2,1824R0089007,30,8,2,09006,no,,,2018/05/02,*,single phase,left,Unchecked,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 86&amp;nbsp; Unchecked,Unchecked,Checked,Unchecked,Unchecked,Unchecked,Unchecked,Unchecked,Uncheck&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 171&amp;nbsp; ed,Unchecked,Unchecked,good,Help,incomplete,18/06/13 13:30:56,18/07/12 16:09:41, 250&lt;/P&gt;&lt;P&gt;DFSTATUS=incom DFVALID=2 DFRASTER=1824R0089007 DFSTUDY=30 DFPLATE=8 DFSEQ=2 usubjid=9006&lt;/P&gt;&lt;P&gt;proccur_mrascan=no prstdtc_dt=&amp;nbsp; prstdtc_time=&amp;nbsp; prstdtc_cta_dt=2018-05-02 prstdtc_cta_time=.&lt;/P&gt;&lt;P&gt;prtrt_cta=single phase prlat_occluson=left faloc_icat=Unchecked faloc_ical=Unchecked&lt;/P&gt;&lt;P&gt;faloc_m3distal=Unchecked faloc_proximal=Checked faloc_bothm2=Unchecked faloc_vrtbrslr=Unchecked&lt;/P&gt;&lt;P&gt;faloc_distalm1=Unchecked faloc_oneofm2=Unchecked faloc_aca=Unchecked faloc_midm1=Unchecked&lt;/P&gt;&lt;P&gt;faloc_trifrctn=Unchecked faloc_pca=Unchecked faorres_colatrls=good Help=Help DFSCREEN=incom&lt;/P&gt;&lt;P&gt;DFCREATE=18JUN13:13:30:56 DFMODIFY=18JUL12:16:09:41 VAR32=&amp;nbsp; _ERROR_=1 _N_=168&lt;/P&gt;&lt;P&gt;NOTE: Invalid data for prstdtc_cta_dt in line 173 45-45.&lt;/P&gt;&lt;P&gt;173&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; incomplete,1,1821R006R007,30,8,2,10003,no,,,*,,*,*,Unchecked,Unchecked,Unchecked,Unch&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 86&amp;nbsp; ecked,Unchecked,Unchecked,Unchecked,Unchecked,Unchecked,Unchecked,Unchecked,Unchecked&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 171&amp;nbsp; ,*,Help,incomplete,18/05/26 15:14:59,18/07/19 07:51:55, 225&lt;/P&gt;&lt;P&gt;DFSTATUS=incom DFVALID=1 DFRASTER=1821R006R007 DFSTUDY=30 DFPLATE=8 DFSEQ=2 usubjid=10003&lt;/P&gt;&lt;P&gt;proccur_mrascan=no prstdtc_dt=&amp;nbsp; prstdtc_time=&amp;nbsp; prstdtc_cta_dt=. prstdtc_cta_time=. prtrt_cta=*&lt;/P&gt;&lt;P&gt;prlat_occluson=* faloc_icat=Unchecked faloc_ical=Unchecked faloc_m3distal=Unchecked&lt;/P&gt;&lt;P&gt;faloc_proximal=Unchecked faloc_bothm2=Unchecked faloc_vrtbrslr=Unchecked&lt;/P&gt;&lt;P&gt;faloc_distalm1=Unchecked faloc_oneofm2=Unchecked faloc_aca=Unchecked faloc_midm1=Unchecked&lt;/P&gt;&lt;P&gt;faloc_trifrctn=Unchecked faloc_pca=Unchecked faorres_colatrls=* Help=Help DFSCREEN=incom&lt;/P&gt;&lt;P&gt;DFCREATE=18MAY26:15:14:59 DFMODIFY=18JUL19:07:51:55 VAR32=&amp;nbsp; _ERROR_=1 _N_=172&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: Import unsuccessful.&amp;nbsp; See SAS Log for details.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IS there a way to fix this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 12:56:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-in-data-with-quot/m-p/485451#M126131</guid>
      <dc:creator>zimcom</dc:creator>
      <dc:date>2018-08-09T12:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: Read in data with '*"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-in-data-with-quot/m-p/485453#M126133</link>
      <description>&lt;P&gt;There aren't a lot of options in PROC IMPORT. I think the easiest fix is to use a text editor and change the CSV file so that the asterisk is changed to a space. Or write your own data step to read the file instead of PROC IMPORT (which is more complicated, but is also more general if you are going to be getting a lot of these CSV files with asterisks)&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 13:04:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-in-data-with-quot/m-p/485453#M126133</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-08-09T13:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: Read in data with '*"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-in-data-with-quot/m-p/485457#M126135</link>
      <description>&lt;P&gt;What does your import agreement state?&amp;nbsp; If col4 is supposed to be a time variable and your getting * in there, then that is a data fail and the data should be returned to the sender.&amp;nbsp; The same for date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Avoid using proc import, it is a guessing procedure - i.e. it tries to guess your data.&amp;nbsp; In this case it is assuming that those variables are dates, or times respectively, and thus when it encounters a * it falls over - correctly as dates/times cannot be *.&amp;nbsp; You could write a datastep to import this data, setting the formats of those two variables to character, but then you would either have them as character or need to convert to numeric data or time.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And as you will respond with "I have no data agreement", trying to fix it will lead you in circles, maybe next time it will be . rather than *, or maybe something else - this is why an agreement is so important.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 13:08:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-in-data-with-quot/m-p/485457#M126135</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-08-09T13:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: Read in data with '*"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-in-data-with-quot/m-p/485463#M126138</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Thank you both!&lt;/P&gt;&lt;P&gt;In the database whenever the value was removed/deleted, the value changed to ' * ', which I don't have much control over it.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 13:20:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-in-data-with-quot/m-p/485463#M126138</guid>
      <dc:creator>zimcom</dc:creator>
      <dc:date>2018-08-09T13:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Read in data with '*"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-in-data-with-quot/m-p/485465#M126139</link>
      <description>&lt;P&gt;then you really need to write your own DATA step import code to handle asterisks and other types of invalid data&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 13:22:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-in-data-with-quot/m-p/485465#M126139</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-08-09T13:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Read in data with '*"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-in-data-with-quot/m-p/485511#M126152</link>
      <description>&lt;P&gt;Nothing you show would actually cause the import to "fail".&lt;/P&gt;
&lt;P&gt;Since you don't show data with commas, you are not actually displaying CSV for your&amp;nbsp; example but almost certainly a spreadsheet interpretation of your source. That really isn't that helpful.&lt;/P&gt;
&lt;P&gt;Did the log contain the data step that proc import should create to read a CSV file?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might try copying that data step into the editor and examining the code closely for details or posting it here, preferably in a code box opened using the {i} or "running man" icons.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is extremely likely that the informat assigned for your date variable was a date informat and * is invalid data for dates or numeric values, which is what generates the invalid data message. That is normal and expected for such.&lt;/P&gt;
&lt;P&gt;You could modify the data step code to use a custom informat that you would have to create to explicity assign * to missing to avoid those messages.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like:&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
invalue dateasterisk
'*'= .
other= [yymmdd10.]
;
invalue timeasterisk
'*'=.
other = [time6.]
;
run;

data example;
   informat id $5. a $3. date dateasterisk. time timeasterisk.;
   format date yymmdd10. time time6.;
   input id a date time;
datalines;
9001 no 2018-01-23 *
9002 yes *   16:49
;
run;&lt;/PRE&gt;
&lt;P&gt;Actually every time I run into data with values like no/yes, Y/N, T/F or similar I create a custom format to read that into numeric 1/0 where 1 is Yes, Y, T, True etc. as analysis is much cleaner in general.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 15:22:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-in-data-with-quot/m-p/485511#M126152</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-09T15:22:13Z</dc:date>
    </item>
  </channel>
</rss>

