<?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: Thousands of multiple columns into one single column in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80727#M23257</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Trying to change it to handle dates.&amp;nbsp; This is the best I could come up with, but the format isn't working...&amp;nbsp; Any thoughts?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data &amp;amp;varName(keep=DS_Code Pos &amp;amp;varName);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile myCSV dsd missover firstobs=2 eov=skip lrecl=156000;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; length amountc DS_Code $12;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input DS_Code $ @;&lt;/P&gt;&lt;P&gt;if skip then skip=0;&lt;/P&gt;&lt;P&gt;else do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do Pos = 1 to 20000 until(missing(amountc));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; input amountc $ @;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if not missing(amountc) then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;varName = input(amountc, mmddyy10.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Mar 2013 03:32:43 GMT</pubDate>
    <dc:creator>yeaforme</dc:creator>
    <dc:date>2013-03-21T03:32:43Z</dc:date>
    <item>
      <title>Thousands of multiple columns into one single column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80718#M23248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Having a few issues with moving data I collected in Excel into SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first problem is that the data in Excel is on a massive scale (about 66,000 observations across 10 variables where each variable captures a non-chronologically sorted time series.&amp;nbsp; The way I collected the data, I set up each variable into a folder of spreadsheets [so 10 folders] where each folder contains 66 workbooks [1,000 observations per each workbook]).&amp;nbsp; This isn't too big of a problem because once I find a good way to get a single workbook into SAS I can easily just create a for loop and automate the rest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second (and biggest) problem is the way the data is structured.&amp;nbsp; As a reference, the data looks like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Amount&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;140011&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;451&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;140012&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;167&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;153&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;34&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;N/A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;43&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;193&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;14002C&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;N/A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;140031&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;142&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;45&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the format I need it to be in is the following:&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Amount&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;140011&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;451&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;140012&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;167&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;140012&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;153&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;140012&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;34&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;140012&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;N/A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;140012&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;43&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;140012&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;193&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;14002C&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;N/A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;140031&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;142&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;140031&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;45&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A few things to note:&lt;/P&gt;&lt;P&gt;1 - In the first table, a blank means the time series ends.&lt;/P&gt;&lt;P&gt;2 - In the first table, N/A means that the data point for that specific point in time is missing, however, I need to keep it intact so that when I combine it with the other 9 variables I can get the time series' lined up correctly (and the variable may not be missing for the other 9 variables).&amp;nbsp; There is an exception to this though.&amp;nbsp; If the first column is N/A (for example, 14002C) then it might mean that there is no information at all (across any of the variables), or it could also mean that only the information for this specific variable is missing.&amp;nbsp; In other words, if an ID just has no data in the database then the Amount column will show N/A in only that column.&amp;nbsp; However, if an ID has only one piece of data but that data is missing for this variable, then the Amount column will also show N/A in only that column.&lt;/P&gt;&lt;P&gt;3 - The scale is massive - some of the time series have upwards of 12,000 data points (i.e., data in 12,000 Excel columns), while others have none.&amp;nbsp; I've tried importing directly from Excel but had little luck as SAS seems to limit Excel imports to the first 255 columns, which is an obvious issue.&lt;/P&gt;&lt;P&gt;4 - There are only two column headings in the original data - one for the ID and another for the first column of the non-sorted time series data.&amp;nbsp; Any more data in the time series shows up in un-labeled, subsequent columns.&lt;/P&gt;&lt;P&gt;5 - Some of the 10 variables are numeric (amounts), some are characters (names), and same are dates - so any code needs to be easily changeable or robust enough to accommodate different variable types.&lt;/P&gt;&lt;P&gt;6 - The relative order of the data needs to be retained when it moves from one row to one column as it needs to line up correctly with 9 other variables (only one of which is the date)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any code-heads with thoughts or solutions?&amp;nbsp; I've attached an example of the data (it is in .csv format, though, not the native .xlsx as the site wouldn't let me upload a .xlsx file) in the event it might help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 00:23:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80718#M23248</guid>
      <dc:creator>yeaforme</dc:creator>
      <dc:date>2013-03-19T00:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Thousands of multiple columns into one single column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80719#M23249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IMHO your best bet is to transform your xlsx files into csv and to read them with something like :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;data test(keep=ds_code pos amount);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;infile "&amp;amp;sasforum.\datasets\orig58.csv" dsd missover firstobs=2 lrecl=156000;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;length amountc ds_code $12;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;input ds_code $ @;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;do pos = 1 to 12000 until(missing(amountc));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input amountc $ @;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not missing(amountc) then do;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if anyalpha(amountc) then amount = .;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else amount = input(amountc, 12.);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 02:35:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80719#M23249</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-03-19T02:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: Thousands of multiple columns into one single column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80720#M23250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Correct me if I am wrong, but this code only moves the data into SAS, it does not reformat it, right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 20:17:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80720#M23250</guid>
      <dc:creator>yeaforme</dc:creator>
      <dc:date>2013-03-19T20:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: Thousands of multiple columns into one single column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80721#M23251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It &lt;SPAN style="text-decoration: underline;"&gt;does&lt;/SPAN&gt; reformat the data into three columns: &lt;STRONG&gt;ds_code&lt;/STRONG&gt;,&lt;STRONG&gt; pos&lt;/STRONG&gt; (optional), and &lt;STRONG&gt;amount&lt;/STRONG&gt;. - PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 21:15:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80721#M23251</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-03-19T21:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Thousands of multiple columns into one single column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80722#M23252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks PG - the code works like a charm!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What's the best way to augment it to read in 66 csv files (named orig1 through orig 66) for each of the 10 variables?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2013 05:10:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80722#M23252</guid>
      <dc:creator>yeaforme</dc:creator>
      <dc:date>2013-03-20T05:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: Thousands of multiple columns into one single column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80723#M23253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I came up with the following based upon PG's code.&amp;nbsp; I'm not nearly the code-wizard as many are here, so if someone could look it over and tell me if there are issues, I'd appreciate it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%Let varName = Prc;&lt;/P&gt;&lt;P&gt;%Let csvPath = C:\Data\Prc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename myCSV "&amp;amp;csvPath\*.csv";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data &amp;amp;varName(keep=DS_Code Pos &amp;amp;varName);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile myCSV dsd missover firstobs=2 lrecl=156000;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; length amountc DS_Code $12;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input DS_Code $ @;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do Pos = 1 to 20000 until(missing(amountc));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input amountc $ @;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not missing(amountc) then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if anyalpha(amountc) then &amp;amp;varName = .;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else &amp;amp;varName = input(amountc, 12.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2013 22:10:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80723#M23253</guid>
      <dc:creator>yeaforme</dc:creator>
      <dc:date>2013-03-20T22:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: Thousands of multiple columns into one single column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80724#M23254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It should work, except for the &lt;STRONG&gt;firstobs&lt;/STRONG&gt; option which would only skip the first line from the first file. Use the &lt;STRONG&gt;eov&lt;/STRONG&gt; option instead, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;%Let varName = Prc;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;%Let csvPath = C:\Data\Prc;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;filename myCSV "&amp;amp;csvPath\*.csv";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;data &amp;amp;varName(keep=DS_Code Pos &amp;amp;varName);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile myCSV dsd missover eov=skip lrecl=156000;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; length amountc DS_Code $12;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input DS_Code $ @;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;if skip then skip=0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;else do;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&amp;nbsp; do Pos = 1 to 20000 until(missing(amountc));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp; input amountc $ @;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp; if not missing(amountc) then do;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if anyalpha(amountc) then &amp;amp;varName = .;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else &amp;amp;varName = input(amountc, 12.);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2013 00:04:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80724#M23254</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-03-21T00:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: Thousands of multiple columns into one single column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80725#M23255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Should I include the firstobs for that first file?&amp;nbsp; If I eliminate it altogether I get one header read in once...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2013 00:31:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80725#M23255</guid>
      <dc:creator>yeaforme</dc:creator>
      <dc:date>2013-03-21T00:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: Thousands of multiple columns into one single column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80726#M23256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry about that. Put it back then. - PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2013 01:26:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80726#M23256</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-03-21T01:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: Thousands of multiple columns into one single column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80727#M23257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Trying to change it to handle dates.&amp;nbsp; This is the best I could come up with, but the format isn't working...&amp;nbsp; Any thoughts?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data &amp;amp;varName(keep=DS_Code Pos &amp;amp;varName);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile myCSV dsd missover firstobs=2 eov=skip lrecl=156000;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; length amountc DS_Code $12;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input DS_Code $ @;&lt;/P&gt;&lt;P&gt;if skip then skip=0;&lt;/P&gt;&lt;P&gt;else do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do Pos = 1 to 20000 until(missing(amountc));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; input amountc $ @;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if not missing(amountc) then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;varName = input(amountc, mmddyy10.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2013 03:32:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80727#M23257</guid>
      <dc:creator>yeaforme</dc:creator>
      <dc:date>2013-03-21T03:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Thousands of multiple columns into one single column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80728#M23258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmmm...hit another snag.&amp;nbsp; Sometimes the data series has blanks in it prior to it terminating - making the &lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;do pos = 1 to 12000 until(missing(amountc)); &lt;/STRONG&gt;line terminate prematurely.&amp;nbsp; Anyway around this?&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Mar 2013 04:01:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80728#M23258</guid>
      <dc:creator>yeaforme</dc:creator>
      <dc:date>2013-03-23T04:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Thousands of multiple columns into one single column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80729#M23259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Remove the UNTIL() clause. It will take longer to execute but will scan the entire line for data. - PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Mar 2013 12:45:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80729#M23259</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-03-23T12:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: Thousands of multiple columns into one single column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80730#M23260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yeaforme&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the run-time is important to you alternative ways exist to recognise the "end-of-data" on a line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The INFILE statement has options LENGTH= and COLUMN= which will give you access to the values SAS maintains for current line length and the pointer for position on the current line where the next INPUT will read data ( you can redirect it with INPUT @nnn,&amp;nbsp; but not in your situation here).&lt;/P&gt;&lt;P&gt;The options LENGTH= and COLUMN= assign variable names to these data values.&lt;/P&gt;&lt;P&gt;Adapting the prototype&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile myCSV dsd missover firstobs=2 eov=skip lrecl=156000&lt;STRONG&gt; length = _len column = _col&lt;/STRONG&gt; ;&lt;/P&gt;&lt;P&gt;and the DO statement would become something like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do&amp;nbsp; until(&lt;STRONG&gt; _col=1 or _col &amp;gt;= _len&lt;/STRONG&gt; );&lt;/P&gt;&lt;P&gt;I'm never quite sure what position will be set for _COL when you have read&amp;nbsp; the final column. So I suggest testing that the next position has been reset to the beginning of the next line as well as beyond the end of the current line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to know from which physical position on the CSV record the data has been read, you could use _COL, or its value before the INPUT is executed, in the loop like&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; do&amp;nbsp; until( _col=1 or _col &amp;gt;= _len );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt; pos = _col ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input amountc $ @;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not missing(amountc) then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;varName = input(amountc, mmddyy12. );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a relative column number (like excel) is more useful than the CSV file text position, assign the POS in the DO statement instead of its own statement, like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; do &lt;STRONG&gt;pos=1 to&lt;/STRONG&gt; _len&amp;nbsp; until( _col=1 or _col &amp;gt;= _len ); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope you'll give it a go.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;peterC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Mar 2013 17:51:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Thousands-of-multiple-columns-into-one-single-column/m-p/80730#M23260</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2013-03-23T17:51:28Z</dc:date>
    </item>
  </channel>
</rss>

