<?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: Convert text file data into sas dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-text-file-data-into-sas-dataset/m-p/801330#M315367</link>
    <description>&lt;P&gt;Looks like you need this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data f_filkes.maturity_invets;
infile
  '/SAS/data/RiskDataManagement/data/NWOW/data/VBM/Data/MATURITY_INVEST.TXT'
  dlm = '|'
  dsd
  truncover
  firstobs=2
;
length
  account_no $9
  serial $3
  maturity_d 4
  opened_date 4
  closed_date 4
;
informat maturity_d opened_date closed_date yymmdd10.;
format maturity_d opened_date closed_date yymmdd10.;
input
  account_no
  serial
  maturity_d
  opened_date
  closed_date
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Untested; for tested code, supply the text in a code box opened with this button:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54552i914D97BE1B0F21E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;or attach the file.&lt;/P&gt;</description>
    <pubDate>Thu, 10 Mar 2022 14:33:14 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2022-03-10T14:33:14Z</dc:date>
    <item>
      <title>Convert text file data into sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-text-file-data-into-sas-dataset/m-p/801274#M315338</link>
      <description>&lt;P&gt;&lt;SPAN&gt;good day expects&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have a text file that contains data that looks like below:-&lt;BR /&gt;&lt;/SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rixile106_1-1646907379834.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69316i21B2AE0EE17394E7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Rixile106_1-1646907379834.png" alt="Rixile106_1-1646907379834.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But I want to convert the data into Sas dataset, used the below script&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;DATA F_FILES.MATURITY_INVEST;
	LENGTH
		'ACCOUNT NO|SERIAL|MATURITY D|OPE'n $ 47;
	LABEL
		'ACCOUNT NO|SERIAL|MATURITY D|OPE'n = "ACCOUNT NO|SERIAL|MATURITY D|OPENED DATE|CLOSED DATE";
	FORMAT
		'ACCOUNT NO|SERIAL|MATURITY D|OPE'n $CHAR47.;
	INFORMAT
		'ACCOUNT NO|SERIAL|MATURITY D|OPE'n $CHAR47.;
	INFILE '/SAS/data/RiskDataManagement/data/NWOW/data/VBM/Data/MATURITY_INVEST.TXT'
		LRECL=47
		ENCODING="LATIN1"
		TERMSTR=CRLF
		DLM='7F'x
		MISSOVER
		DSD;
	INPUT
		'ACCOUNT NO|SERIAL|MATURITY D|OPE'n : $CHAR47.;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;LI-SPOILER&gt;&lt;SPAN&gt;however am not getting the expected results. i can only see the headings from the output,&lt;/SPAN&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rixile106_2-1646907563633.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69317i0746883F320BDB43/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Rixile106_2-1646907563633.png" alt="Rixile106_2-1646907563633.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please assist&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 10:21:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-text-file-data-into-sas-dataset/m-p/801274#M315338</guid>
      <dc:creator>Rixile106</dc:creator>
      <dc:date>2022-03-10T10:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text file data into sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-text-file-data-into-sas-dataset/m-p/801304#M315349</link>
      <description>&lt;P&gt;Please post the sample data either in the code window or as a text file so that somebody can help.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 12:57:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-text-file-data-into-sas-dataset/m-p/801304#M315349</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2022-03-10T12:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text file data into sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-text-file-data-into-sas-dataset/m-p/801330#M315367</link>
      <description>&lt;P&gt;Looks like you need this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data f_filkes.maturity_invets;
infile
  '/SAS/data/RiskDataManagement/data/NWOW/data/VBM/Data/MATURITY_INVEST.TXT'
  dlm = '|'
  dsd
  truncover
  firstobs=2
;
length
  account_no $9
  serial $3
  maturity_d 4
  opened_date 4
  closed_date 4
;
informat maturity_d opened_date closed_date yymmdd10.;
format maturity_d opened_date closed_date yymmdd10.;
input
  account_no
  serial
  maturity_d
  opened_date
  closed_date
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Untested; for tested code, supply the text in a code box opened with this button:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54552i914D97BE1B0F21E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;or attach the file.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 14:33:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-text-file-data-into-sas-dataset/m-p/801330#M315367</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-03-10T14:33:14Z</dc:date>
    </item>
  </channel>
</rss>

