<?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: Help Reading a text file in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Help-Reading-a-text-file/m-p/514026#M2627</link>
    <description>&lt;P&gt;Paste plain text into a code box opened using the forum's {I} icon to prevent the message windows from reformatting it:&lt;/P&gt;
&lt;PRE&gt;  File: `table_1_201801.sas7bdat'
  Size: 106954752 	Blocks: 131473     IO Block: 131072 regular file
Device: 7bh/123d	Inode: 127058      Links: 1
Access: (0644/-rw-r--r--)  Uid: (9999999/ z123456)   Gid: (  940/  team_id)
Access: 2018-11-05 15:36:54.517252096 -0600
Modify: 2018-11-05 15:37:06.645740950 -0600
Change: 2018-11-05 15:37:06.675385515 -0600
  File: `table_1_201802.sas7bdat'
  Size: 107216896 	Blocks: 133841     IO Block: 131072 regular file
Device: 7bh/123d	Inode: 127066      Links: 1
Access: (0644/-rw-r--r--)  Uid: (9999999/ z123456)   Gid: (  940/  team_id)
Access: 2018-11-05 15:37:28.570265024 -0600
Modify: 2018-11-05 15:37:38.510186494 -0600
Change: 2018-11-05 15:37:38.550049587 -0600
  File: `table_1_201803.sas7bdat'
  Size: 107610112 	Blocks: 131401     IO Block: 131072 regular file
Device: 7bh/123d	Inode: 127073      Links: 1
Access: (0644/-rw-r--r--)  Uid: (9999999/ z123456)   Gid: (  940/  team_id)
Access: 2018-11-05 15:38:02.027723747 -0600
Modify: 2018-11-05 15:38:12.474856957 -0600
Change: 2018-11-05 15:38:12.512025723 -0600&lt;/PRE&gt;
&lt;P&gt;Did the output originally contain those &lt;FONT size="4"&gt;` &lt;FONT size="3"&gt;slanted quotes at the start of the name?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Nov 2018 19:01:22 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-11-16T19:01:22Z</dc:date>
    <item>
      <title>Help Reading a text file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-Reading-a-text-file/m-p/514022#M2626</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a text file on unix server which i obtain using the "stat" command.&lt;/P&gt;&lt;P&gt;I am having difficulty reading in the file in separate columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want separate column for: file, size , blocks, IO Block, device etc.&lt;/P&gt;&lt;P&gt;Can you please help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is how the text file looks(also attached):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;File: `table_1_201801.sas7bdat'&lt;BR /&gt;Size: 106954752 Blocks: 131473 IO Block: 131072 regular file&lt;BR /&gt;Device: 7bh/123d Inode: 127058 Links: 1&lt;BR /&gt;Access: (0644/-rw-r--r--) Uid: (9999999/ z123456) Gid: ( 940/ team_id)&lt;BR /&gt;Access: 2018-11-05 15:36:54.517252096 -0600&lt;BR /&gt;Modify: 2018-11-05 15:37:06.645740950 -0600&lt;BR /&gt;Change: 2018-11-05 15:37:06.675385515 -0600&lt;BR /&gt;File: `table_1_201802.sas7bdat'&lt;BR /&gt;Size: 107216896 Blocks: 133841 IO Block: 131072 regular file&lt;BR /&gt;Device: 7bh/123d Inode: 127066 Links: 1&lt;BR /&gt;Access: (0644/-rw-r--r--) Uid: (9999999/ z123456) Gid: ( 940/ team_id)&lt;BR /&gt;Access: 2018-11-05 15:37:28.570265024 -0600&lt;BR /&gt;Modify: 2018-11-05 15:37:38.510186494 -0600&lt;BR /&gt;Change: 2018-11-05 15:37:38.550049587 -0600&lt;BR /&gt;File: `table_1_201803.sas7bdat'&lt;BR /&gt;Size: 107610112 Blocks: 131401 IO Block: 131072 regular file&lt;BR /&gt;Device: 7bh/123d Inode: 127073 Links: 1&lt;BR /&gt;Access: (0644/-rw-r--r--) Uid: (9999999/ z123456) Gid: ( 940/ team_id)&lt;BR /&gt;Access: 2018-11-05 15:38:02.027723747 -0600&lt;BR /&gt;Modify: 2018-11-05 15:38:12.474856957 -0600&lt;BR /&gt;Change: 2018-11-05 15:38:12.512025723 -0600&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 18:38:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-Reading-a-text-file/m-p/514022#M2626</guid>
      <dc:creator>david27</dc:creator>
      <dc:date>2018-11-16T18:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: Help Reading a text file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-Reading-a-text-file/m-p/514026#M2627</link>
      <description>&lt;P&gt;Paste plain text into a code box opened using the forum's {I} icon to prevent the message windows from reformatting it:&lt;/P&gt;
&lt;PRE&gt;  File: `table_1_201801.sas7bdat'
  Size: 106954752 	Blocks: 131473     IO Block: 131072 regular file
Device: 7bh/123d	Inode: 127058      Links: 1
Access: (0644/-rw-r--r--)  Uid: (9999999/ z123456)   Gid: (  940/  team_id)
Access: 2018-11-05 15:36:54.517252096 -0600
Modify: 2018-11-05 15:37:06.645740950 -0600
Change: 2018-11-05 15:37:06.675385515 -0600
  File: `table_1_201802.sas7bdat'
  Size: 107216896 	Blocks: 133841     IO Block: 131072 regular file
Device: 7bh/123d	Inode: 127066      Links: 1
Access: (0644/-rw-r--r--)  Uid: (9999999/ z123456)   Gid: (  940/  team_id)
Access: 2018-11-05 15:37:28.570265024 -0600
Modify: 2018-11-05 15:37:38.510186494 -0600
Change: 2018-11-05 15:37:38.550049587 -0600
  File: `table_1_201803.sas7bdat'
  Size: 107610112 	Blocks: 131401     IO Block: 131072 regular file
Device: 7bh/123d	Inode: 127073      Links: 1
Access: (0644/-rw-r--r--)  Uid: (9999999/ z123456)   Gid: (  940/  team_id)
Access: 2018-11-05 15:38:02.027723747 -0600
Modify: 2018-11-05 15:38:12.474856957 -0600
Change: 2018-11-05 15:38:12.512025723 -0600&lt;/PRE&gt;
&lt;P&gt;Did the output originally contain those &lt;FONT size="4"&gt;` &lt;FONT size="3"&gt;slanted quotes at the start of the name?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 19:01:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-Reading-a-text-file/m-p/514026#M2627</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-11-16T19:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help Reading a text file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-Reading-a-text-file/m-p/514027#M2628</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;: Sorry for that un-formatted text being pasted. I saw that and that is why I attached the file.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Regarding Quotes&lt;/STRONG&gt;: Yes it is like that.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 19:04:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-Reading-a-text-file/m-p/514027#M2628</guid>
      <dc:creator>david27</dc:creator>
      <dc:date>2018-11-16T19:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: Help Reading a text file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-Reading-a-text-file/m-p/514035#M2629</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/215179"&gt;@david27&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;: Sorry for that un-formatted text being pasted. I saw that and that is why I attached the file.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Regarding Quotes&lt;/STRONG&gt;: Yes it is like that.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Just wondered about the quotes as using the data in a datalines block creates unbalanced quotes and I'm not sure whether that would get read correctly as SAS typically will remove single ' or double " quotes around text when reading files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would expect someone with more recent UNIX experience than mine to have a solution somewhat quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This might get you started for some of the bits:&lt;/P&gt;
&lt;PRE&gt;data have;
   infile 'your file name here';
   informat name $42. 
            device $10.
            Permissions $30.
            Accessdate Modifydate Changedate  yymmdd10.
            Accesstime Modifytime Changetime  time18.9
   ;
   format   Accessdate Modifydate Changedate  yymmdd10.
            Accesstime Modifytime Changetime  time18.9
  ;
   input @'File:' name
        /@' Size: ' size @'Blocks: ' blocks @'IO Block: ' IOBlock
        /@'Device: ' device @'Inode: ' Inode @'Links: ' links
        /@'Access: ' Permissions 
        /@'Access: ' Accessdate Accesstime
        /@'Modify: ' Modifydate Modifytime
        /@'Change: ' Changedate Changetime
   ;
run;&lt;/PRE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/141062"&gt;@the&lt;/a&gt; / tells SAS to read the next line as part of the same record. The @'string' tells SAS to start reading the next value after the text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since your UID and GID bits have spaces imbedded in them there's going to be some finagling to read them properly and I don't have time to get that right now.&lt;/P&gt;
&lt;P&gt;You may need a TRUNCOVER option on the infile.&lt;/P&gt;
&lt;P&gt;If this doesn't work to get the filename then that slanted quote is the likely issue and I haven't got a solution at the moment.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 19:25:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-Reading-a-text-file/m-p/514035#M2629</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-11-16T19:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Help Reading a text file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-Reading-a-text-file/m-p/514036#M2630</link>
      <description>&lt;P&gt;Thank You Very much&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 19:33:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-Reading-a-text-file/m-p/514036#M2630</guid>
      <dc:creator>david27</dc:creator>
      <dc:date>2018-11-16T19:33:02Z</dc:date>
    </item>
  </channel>
</rss>

