<?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: Unable to read the file via File Reader Transformation in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Unable-to-read-the-file-via-File-Reader-Transformation/m-p/439624#M13546</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;It works for me by just using the code and data you've posted.&amp;nbsp;Ideally post your sample data as attachment and as unchanged as possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One&amp;nbsp;theory why things are not working for you: You're in a Windows environment&amp;nbsp;but your source file comes from a Unix/Linux environment and the end-of-line character is only LF and not CRLF.&lt;/P&gt;
&lt;P&gt;You're using&amp;nbsp;DIS4.2 which means you're still on SAS 9.2&amp;nbsp; ....and that's a bad thing as since SAS 9.3 the INFILE statement has a TERMSTR= option for such cases which makes everything very simple.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it's the LF / CRLF challenge then I'm honestly no more sure how that needs to be approached using SAS9.2. May be the PRINT/NOPRINT option could help?&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000146932.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000146932.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Else you'll have to read the data as byte stream and parse it on your own (which means user written code).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And here the code which I've run successfully:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename mydata temp;
data _null_;
  file mydata;
  put 'Transaction ID,"Policy Number","Plate Number","Client Name","Policy Start Date","Inserted By","Status","Inserted Date","Start Date","End Date"';
  put '1,"900203422","1DKB299","Diur. EEN SANItHTY-TEST",2018-02-21,"BOKT","Policy processed successfully",2018-02-16 08:49:32,2018-02-16 08:49:32,2018-02-16 08:50:30';
  stop;
run;

data work.etls_W6X4DRR5 / view = work.etls_W6X4DRR5 ; 
   infile mydata
          lrecl = 1200
          delimiter = ','
          dsd
          missover
          firstobs = 2; 
   ; 
   attrib TRANSACTION_ID length = 8
      format = 11.
      informat = 11.; 
   attrib POLICY_NUMBER length = $20
      format = $20.
      informat = $20.; 
   attrib PLATE_NUMBER length = $20
      format = $20.
      informat = $20.; 
   attrib CLIENT_NAME length = $50
      format = $50.
      informat = $50.; 
   attrib POLICY_START_DATE length = $20
      format = $20.
      informat = $20.; 
   attrib INSERTED_BY length = $20
      format = $20.
      informat = $20.; 
   attrib STATUS length = $50
      format = $50.
      informat = $50.; 
   attrib INSERTED_DATE length = 8
      format = DATETIME25.6
      informat = anydtdtm24.; 
   attrib START_DATE length = 8
      format = DATETIME25.6
      informat = anydtdtm24.; 
   attrib END_DATE length = 8
      format = DATETIME25.6
      informat = anydtdtm24.; 
   
   input TRANSACTION_ID POLICY_NUMBER PLATE_NUMBER CLIENT_NAME POLICY_START_DATE 
         INSERTED_BY STATUS INSERTED_DATE START_DATE END_DATE; 
   
run; 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 23 Feb 2018 08:39:08 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2018-02-23T08:39:08Z</dc:date>
    <item>
      <title>Unable to read the file via File Reader Transformation</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Unable-to-read-the-file-via-File-Reader-Transformation/m-p/439607#M13545</link>
      <description>&lt;P&gt;I'm trying to read the CSV file via File Reader Transformation in SAS DI Studio 4.2. My CSV file has 10 variables and 3 observations. After executing the&amp;nbsp;&lt;SPAN&gt;File Reader Transformation, I see that blank values are displayed for all the 3 observations and variables. Appreciate if someone of you guide me to resolve the issue.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;My CSV file looks as follows:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Transaction ID,"Policy Number","Plate Number","Client Name","Policy Start Date","Inserted By","Status","Inserted Date","Start Date","End Date"&lt;BR /&gt;1,"900203422","1DKB299","Diur. EEN SANItHTY-TEST",2018-02-21,"BOKT","Policy processed successfully",2018-02-16 08:49:32,2018-02-16 08:49:32,2018-02-16 08:50:30&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Table which I see after running&amp;nbsp;File Reader Transformation:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Blank values.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18772i59B7F212C43F34C7/image-size/large?v=v2&amp;amp;px=999" role="button" title="Blank values.PNG" alt="Blank values.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Code which was being generated in the File Reader Transformation:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data work.etls_W6X4DRR5 / view = work.etls_W6X4DRR5 ; 
   infile "/data/trans/Transaction_*.csv"
          lrecl = 1200
          delimiter = ','
          dsd
          missover
          firstobs = 2; 
   ; 
   attrib TRANSACTION_ID length = 8
      format = 11.
      informat = 11.; 
   attrib POLICY_NUMBER length = $20
      format = $20.
      informat = $20.; 
   attrib PLATE_NUMBER length = $20
      format = $20.
      informat = $20.; 
   attrib CLIENT_NAME length = $50
      format = $50.
      informat = $50.; 
   attrib POLICY_START_DATE length = $20
      format = $20.
      informat = $20.; 
   attrib INSERTED_BY length = $20
      format = $20.
      informat = $20.; 
   attrib STATUS length = $50
      format = $50.
      informat = $50.; 
   attrib INSERTED_DATE length = 8
      format = DATETIME25.6
      informat = anydtdtm24.; 
   attrib START_DATE length = 8
      format = DATETIME25.6
      informat = anydtdtm24.; 
   attrib END_DATE length = 8
      format = DATETIME25.6
      informat = anydtdtm24.; 
   
   input TRANSACTION_ID POLICY_NUMBER PLATE_NUMBER CLIENT_NAME POLICY_START_DATE 
         INSERTED_BY STATUS INSERTED_DATE START_DATE END_DATE; 
   
run; 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Screenshot of my Job window:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FR1.PNG" style="width: 338px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18773i53C929918FE41476/image-size/large?v=v2&amp;amp;px=999" role="button" title="FR1.PNG" alt="FR1.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 07:13:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Unable-to-read-the-file-via-File-Reader-Transformation/m-p/439607#M13545</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-02-23T07:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to read the file via File Reader Transformation</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Unable-to-read-the-file-via-File-Reader-Transformation/m-p/439624#M13546</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;It works for me by just using the code and data you've posted.&amp;nbsp;Ideally post your sample data as attachment and as unchanged as possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One&amp;nbsp;theory why things are not working for you: You're in a Windows environment&amp;nbsp;but your source file comes from a Unix/Linux environment and the end-of-line character is only LF and not CRLF.&lt;/P&gt;
&lt;P&gt;You're using&amp;nbsp;DIS4.2 which means you're still on SAS 9.2&amp;nbsp; ....and that's a bad thing as since SAS 9.3 the INFILE statement has a TERMSTR= option for such cases which makes everything very simple.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it's the LF / CRLF challenge then I'm honestly no more sure how that needs to be approached using SAS9.2. May be the PRINT/NOPRINT option could help?&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000146932.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000146932.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Else you'll have to read the data as byte stream and parse it on your own (which means user written code).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And here the code which I've run successfully:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename mydata temp;
data _null_;
  file mydata;
  put 'Transaction ID,"Policy Number","Plate Number","Client Name","Policy Start Date","Inserted By","Status","Inserted Date","Start Date","End Date"';
  put '1,"900203422","1DKB299","Diur. EEN SANItHTY-TEST",2018-02-21,"BOKT","Policy processed successfully",2018-02-16 08:49:32,2018-02-16 08:49:32,2018-02-16 08:50:30';
  stop;
run;

data work.etls_W6X4DRR5 / view = work.etls_W6X4DRR5 ; 
   infile mydata
          lrecl = 1200
          delimiter = ','
          dsd
          missover
          firstobs = 2; 
   ; 
   attrib TRANSACTION_ID length = 8
      format = 11.
      informat = 11.; 
   attrib POLICY_NUMBER length = $20
      format = $20.
      informat = $20.; 
   attrib PLATE_NUMBER length = $20
      format = $20.
      informat = $20.; 
   attrib CLIENT_NAME length = $50
      format = $50.
      informat = $50.; 
   attrib POLICY_START_DATE length = $20
      format = $20.
      informat = $20.; 
   attrib INSERTED_BY length = $20
      format = $20.
      informat = $20.; 
   attrib STATUS length = $50
      format = $50.
      informat = $50.; 
   attrib INSERTED_DATE length = 8
      format = DATETIME25.6
      informat = anydtdtm24.; 
   attrib START_DATE length = 8
      format = DATETIME25.6
      informat = anydtdtm24.; 
   attrib END_DATE length = 8
      format = DATETIME25.6
      informat = anydtdtm24.; 
   
   input TRANSACTION_ID POLICY_NUMBER PLATE_NUMBER CLIENT_NAME POLICY_START_DATE 
         INSERTED_BY STATUS INSERTED_DATE START_DATE END_DATE; 
   
run; 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Feb 2018 08:39:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Unable-to-read-the-file-via-File-Reader-Transformation/m-p/439624#M13546</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-02-23T08:39:08Z</dc:date>
    </item>
  </channel>
</rss>

