<?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: How to read this matrix in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-read-this-matrix/m-p/64884#M18458</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Could you please clarify what input data do you have?&lt;BR /&gt;
&lt;BR /&gt;
Is it like a matrix? (If so, is the 4th observation in 1st row missing so that it would be (3X4) matrix. Or do you just want to make data set like below from no initial data?</description>
    <pubDate>Fri, 05 Mar 2010 06:53:36 GMT</pubDate>
    <dc:creator>ieva</dc:creator>
    <dc:date>2010-03-05T06:53:36Z</dc:date>
    <item>
      <title>How to read this matrix</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-read-this-matrix/m-p/64883#M18457</link>
      <description>I don't remember which function to use to read a matrix like following into the format I want:&lt;BR /&gt;
&lt;BR /&gt;
matrix:&lt;BR /&gt;
&lt;BR /&gt;
            y1          y2             y3&lt;BR /&gt;
x1       z11        z12           z13&lt;BR /&gt;
x2       z21        z22           z23&lt;BR /&gt;
&lt;BR /&gt;
desired format&lt;BR /&gt;
&lt;BR /&gt;
x1     y1    z11&lt;BR /&gt;
x1    y2     z12&lt;BR /&gt;
x1    y3     z13&lt;BR /&gt;
x2    y1     z21&lt;BR /&gt;
x2    y2     z22&lt;BR /&gt;
x2    y3     z23&lt;BR /&gt;
&lt;BR /&gt;
Thanks for any help in advance!</description>
      <pubDate>Thu, 04 Mar 2010 21:17:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-read-this-matrix/m-p/64883#M18457</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-03-04T21:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to read this matrix</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-read-this-matrix/m-p/64884#M18458</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Could you please clarify what input data do you have?&lt;BR /&gt;
&lt;BR /&gt;
Is it like a matrix? (If so, is the 4th observation in 1st row missing so that it would be (3X4) matrix. Or do you just want to make data set like below from no initial data?</description>
      <pubDate>Fri, 05 Mar 2010 06:53:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-read-this-matrix/m-p/64884#M18458</guid>
      <dc:creator>ieva</dc:creator>
      <dc:date>2010-03-05T06:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to read this matrix</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-read-this-matrix/m-p/64885#M18459</link>
      <description>This should get you started.&lt;BR /&gt;
Please read the doc to understand what it does.&lt;BR /&gt;
[pre]&lt;BR /&gt;
data t;&lt;BR /&gt;
  retain COL1-COL3 ;             * remember column names;&lt;BR /&gt;
  if _N_=1 then &lt;BR /&gt;
    input (COL1-COL3) ($);       * read column names;&lt;BR /&gt;
  else do; &lt;BR /&gt;
    input (ROW VAL1-VAL3) ($);   * read row name and values;&lt;BR /&gt;
    put ROW COL1 VAL1;           * print out in desired format;&lt;BR /&gt;
    put ROW COL2 VAL2; &lt;BR /&gt;
    put ROW COL3 VAL3; &lt;BR /&gt;
  end;&lt;BR /&gt;
cards;&lt;BR /&gt;
    y1  y2  y3&lt;BR /&gt;
x1 z11 z12 z13&lt;BR /&gt;
x2 z21 z22 z23&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 08 Mar 2010 02:57:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-read-this-matrix/m-p/64885#M18459</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2010-03-08T02:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to read this matrix</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-read-this-matrix/m-p/64886#M18460</link>
      <description>Thanks for the help. The specific .csv files I am trying to convert have hundreds of columns and thousands of rows. I was hoping there is a way to do it other than the "cards".</description>
      <pubDate>Tue, 09 Mar 2010 19:25:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-read-this-matrix/m-p/64886#M18460</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-03-09T19:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to read this matrix</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-read-this-matrix/m-p/64887#M18461</link>
      <description>the data are saved in .csv files. "X's" are company names, "Y's" are dates, and "Z's" are the value of a variable for company X on date Y. I have quite a number of these files, each recording one specific variable, and each containing a large number of entries. &lt;BR /&gt;
&lt;BR /&gt;
the first raw is missing one (the first) observation.&lt;BR /&gt;
&lt;BR /&gt;
Thanks.</description>
      <pubDate>Tue, 09 Mar 2010 19:30:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-read-this-matrix/m-p/64887#M18461</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-03-09T19:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to read this matrix</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-read-this-matrix/m-p/64888#M18462</link>
      <description>"Cards" isn't needed but is useful in developing and testing code.  For your actual data look into using an infile statement.</description>
      <pubDate>Tue, 09 Mar 2010 19:38:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-read-this-matrix/m-p/64888#M18462</guid>
      <dc:creator>RickM</dc:creator>
      <dc:date>2010-03-09T19:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to read this matrix</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-read-this-matrix/m-p/64889#M18463</link>
      <description>This isn't a place where people will write code to specs for free, especially if the specs are given piecemeal.&lt;BR /&gt;
It is however a place where people will give you pointers so you can learn.&lt;BR /&gt;
&lt;BR /&gt;
If the column names aren't in the data, remove the first 3 lines of the data step.&lt;BR /&gt;
&lt;BR /&gt;
If the data is in a file, use    infile   instead of    cards    as has been pointed out.&lt;BR /&gt;
&lt;BR /&gt;
And use the doc and the internet to find out how to modify the example to suit your precise needs.&lt;BR /&gt;
&lt;BR /&gt;
Good learning!  &lt;span class="lia-unicode-emoji" title=":monkey_face:"&gt;🐵&lt;/span&gt;</description>
      <pubDate>Tue, 09 Mar 2010 21:13:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-read-this-matrix/m-p/64889#M18463</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2010-03-09T21:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to read this matrix</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-read-this-matrix/m-p/64890#M18464</link>
      <description>The reason I gave general specs in the first post is EXACTLY that I want to learn. I think it is very common to want to undertake a task as I described in the first thread and I am sure I will need to do it over and over again in the future. That is why I didn't give all the specs in the first place because that way I would be asking for a free code that won't work on future needs.</description>
      <pubDate>Tue, 16 Mar 2010 17:01:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-read-this-matrix/m-p/64890#M18464</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-03-16T17:01:23Z</dc:date>
    </item>
  </channel>
</rss>

