<?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: importing un even data in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/importing-un-even-data/m-p/70004#M20155</link>
    <description>1)  Not going to be done with PROC IMPORT as the input lines do not follow normalized format (= every line must have identically the same format).&lt;BR /&gt;
&lt;BR /&gt;
2)  The example contains 0 (none, nada, zip, zilch) commas in it as delimiters.&lt;BR /&gt;
&lt;BR /&gt;
3)  To read the presented data with SAS, parse it, and put it into a SAS data set can be done, but it will require a DATA step, INFILE, INPUT, '@' and some conditional (IF) statements.&lt;BR /&gt;
&lt;BR /&gt;
Example:&lt;BR /&gt;
&lt;BR /&gt;
example data in file "dummy.txt":&lt;BR /&gt;
&lt;BR /&gt;
This is the first line&lt;BR /&gt;
This is the second line&lt;BR /&gt;
Different format line 1&lt;BR /&gt;
This is the fourth line&lt;BR /&gt;
This is the fifth line&lt;BR /&gt;
Different format line 2&lt;BR /&gt;
&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
data indata;&lt;BR /&gt;
  length first $32;&lt;BR /&gt;
  infile "dummy.txt";&lt;BR /&gt;
  input first $ @;&lt;BR /&gt;
  if first = "Different" then do;&lt;BR /&gt;
    input second $ third $ fourth;&lt;BR /&gt;
  end;&lt;BR /&gt;
  else do;&lt;BR /&gt;
    input remainder $;&lt;BR /&gt;
  end;&lt;BR /&gt;
run;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;/PRE&gt;

Message was edited by: Chuck</description>
    <pubDate>Mon, 19 Jan 2009 15:41:43 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-01-19T15:41:43Z</dc:date>
    <item>
      <title>importing un even data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/importing-un-even-data/m-p/70003#M20154</link>
      <description>Hi,&lt;BR /&gt;
I have a an csv file with the following way. I would like to import into sas with appropriate coumn names and values.&lt;BR /&gt;
my working environment is windows, SAS base,stat and graph&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
												&lt;BR /&gt;
Full Name			Phone	Event	Event Date	Hall	Area	Row	Seats	Price	Price Level	Price Types	&lt;BR /&gt;
&lt;BR /&gt;
Transaction No.		Transaction Date	Transaction Type		User Name:	Status:	Number of Tickets:		Total Amount				&lt;BR /&gt;
&lt;BR /&gt;
361640 		12/04/2008 14:24	Phone		Holland, P	Sales	6 		$95.00 				&lt;BR /&gt;
&lt;BR /&gt;
Smith S			235977	Cinderella 2008	21/12/2008 14:00	The Central Theatre	Balcony	A	32-33	18.5	Band A	Standard	Clearing&lt;BR /&gt;
Smith S			235977	Cinderella 2008	21/12/2008 14:00	The Central Theatre	Balcony	A	34-35	15.5	Band A	Senior Citizen	Clearing&lt;BR /&gt;
Smith S			235977	Cinderella 2008	21/12/2008 14:00	The Central Theatre	Balcony	A	36-37	13.5	Band A	Under 16	Clearing&lt;BR /&gt;
Transaction No.		Transaction Date	Transaction Type		User Name:	Status:	Number of Tickets:		Total Amount				&lt;BR /&gt;
&lt;BR /&gt;
361678 		12/04/2008 17:50	Phone		Lycett, S	Sales	14 		$220.00 				&lt;BR /&gt;
&lt;BR /&gt;
Allen A			07913 037009	Cinderella 2008	24/12/2008 14:00	The Central Theatre	Balcony	A	32-34	15.5	Band A	Senior Citizen	Clearing&lt;BR /&gt;
Allen A			07913 037009	Cinderella 2008	24/12/2008 14:00	The Central Theatre	Balcony	A	35-39	18.5	Band A	Standard	Clearing&lt;BR /&gt;
Allen A			07913 037009	Cinderella 2008	24/12/2008 14:00	The Central Theatre	Balcony	A	40-41	13.5	Band A	Under 16	Clearing&lt;BR /&gt;
Allen A			07913 037009	Cinderella 2008	24/12/2008 14:00	The Central Theatre	Balcony	B	32-35	13.5	Band A	Under 16	Clearing&lt;BR /&gt;
Transaction No.		Transaction Date	Transaction Type		User Name:	Status:	Number of Tickets:		Total Amount				&lt;BR /&gt;
&lt;BR /&gt;
361686 		12/04/2008 18:41	internet		Internet	Sales	3 		$50.50&lt;BR /&gt;
&lt;BR /&gt;
i would like to see&lt;BR /&gt;
Full Name			Phone	Event	Event Date	Hall	Area	Row	Seats	Price	Price Level	Price Types  Transaction No.		Transaction Date	Transaction Type		User Name:	Status:	Number of Tickets:		Total Amount&lt;BR /&gt;
Smith S			235977	Cinderella 2008	21/12/2008 14:00	The Central Theatre	Balcony	A	32-33	18.5	Band A	Standard	Clearing&lt;BR /&gt;
Smith S			235977	Cinderella 2008	21/12/2008 14:00	The Central Theatre	Balcony	A	34-35	15.5	Band A	Senior Citizen	Clearing&lt;BR /&gt;
Smith S			235977	Cinderella 2008	21/12/2008 14:00	The Central Theatre	Balcony	A	36-37	13.5	Band A	Under 16	Clear&lt;BR /&gt;
&lt;BR /&gt;
361640 		12/04/2008 14:24	Phone		Holland, P	Sales	6 		$95.00</description>
      <pubDate>Mon, 19 Jan 2009 13:22:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/importing-un-even-data/m-p/70003#M20154</guid>
      <dc:creator>ssas</dc:creator>
      <dc:date>2009-01-19T13:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: importing un even data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/importing-un-even-data/m-p/70004#M20155</link>
      <description>1)  Not going to be done with PROC IMPORT as the input lines do not follow normalized format (= every line must have identically the same format).&lt;BR /&gt;
&lt;BR /&gt;
2)  The example contains 0 (none, nada, zip, zilch) commas in it as delimiters.&lt;BR /&gt;
&lt;BR /&gt;
3)  To read the presented data with SAS, parse it, and put it into a SAS data set can be done, but it will require a DATA step, INFILE, INPUT, '@' and some conditional (IF) statements.&lt;BR /&gt;
&lt;BR /&gt;
Example:&lt;BR /&gt;
&lt;BR /&gt;
example data in file "dummy.txt":&lt;BR /&gt;
&lt;BR /&gt;
This is the first line&lt;BR /&gt;
This is the second line&lt;BR /&gt;
Different format line 1&lt;BR /&gt;
This is the fourth line&lt;BR /&gt;
This is the fifth line&lt;BR /&gt;
Different format line 2&lt;BR /&gt;
&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
data indata;&lt;BR /&gt;
  length first $32;&lt;BR /&gt;
  infile "dummy.txt";&lt;BR /&gt;
  input first $ @;&lt;BR /&gt;
  if first = "Different" then do;&lt;BR /&gt;
    input second $ third $ fourth;&lt;BR /&gt;
  end;&lt;BR /&gt;
  else do;&lt;BR /&gt;
    input remainder $;&lt;BR /&gt;
  end;&lt;BR /&gt;
run;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;/PRE&gt;

Message was edited by: Chuck</description>
      <pubDate>Mon, 19 Jan 2009 15:41:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/importing-un-even-data/m-p/70004#M20155</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-19T15:41:43Z</dc:date>
    </item>
  </channel>
</rss>

