<?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 format a date within proc transpose statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-format-a-date-within-proc-transpose-statement/m-p/294408#M61425</link>
    <description>&lt;P&gt;I tried it. Its not exactly what I am looking for. I don't need the dates as row headers. I would like an array like how mentioned in my initial code which is how I need the data organized. I just need each admit date to format as a date and not as Number. How can I do that using the prefix statement as an array to separate the admit dates in the code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc transpose data=temp&lt;BR /&gt;out=analysis&lt;BR /&gt;prefix=admitDate;&lt;BR /&gt;format admitDate yymmdd10.;&lt;BR /&gt;by patientId;&lt;BR /&gt;var age systolic procedure1 procedure2 procedure3 procedure4 procedure5 diagnosis1 diagnosis2 diagnosis3 diagnosis4 diagnosis5;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Aug 2016 14:42:03 GMT</pubDate>
    <dc:creator>malikah_sph</dc:creator>
    <dc:date>2016-08-26T14:42:03Z</dc:date>
    <item>
      <title>How to format a date within proc transpose statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-format-a-date-within-proc-transpose-statement/m-p/294402#M61422</link>
      <description>&lt;P&gt;I need help trying to keep the variable admitDate formatted in the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc transpose data=temp&lt;BR /&gt;out=analysis&lt;BR /&gt;prefix=admitDate;&lt;BR /&gt;format admitDate yymmdd10.;&lt;BR /&gt;by patientId;&lt;BR /&gt;var age systolic procedure1 procedure2 procedure3 procedure4 procedure5 diagnosis1 diagnosis2 diagnosis3 diagnosis4 diagnosis5;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;**When I run it it gives the date as numbers. Is there a better way to do this?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 14:22:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-format-a-date-within-proc-transpose-statement/m-p/294402#M61422</guid>
      <dc:creator>malikah_sph</dc:creator>
      <dc:date>2016-08-26T14:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to format a date within proc transpose statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-format-a-date-within-proc-transpose-statement/m-p/294404#M61423</link>
      <description>&lt;P&gt;Well, the best way is not to put data as column names. &amp;nbsp;Column names are there for your programming benefit, to ake your coding simpler and easier. &amp;nbsp;Creating columsn with numbers/dates or anything else will just make your life harder. &amp;nbsp;Prefix option is there give you a constant prefeix for all the data in the array, so you can refer to things via shorthand:&lt;/P&gt;
&lt;P&gt;procedure:&lt;/P&gt;
&lt;P&gt;You can't use that if the prefix changes each time. &amp;nbsp;That is one simple example, but there are many other reason why not to do it. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now variable label is a different matter - that is not used in programming, it is purely for display. &amp;nbsp;That can be anything you like. &amp;nbsp;You can set a label by:&lt;/P&gt;
&lt;PRE&gt;proc transpose data=temp out=analysis;
  format admitDate yymmdd10.;
  by patientId;
  var age systolic procedure1 procedure2 procedure3 procedure4 procedure5 diagnosis1 diagnosis2 diagnosis3 diagnosis4 diagnosis5;
  idlabel admitdate;
  id admitdate;
run;&lt;/PRE&gt;
&lt;P&gt;Note, I haven't tested if that is valid syntax as you have not provided any test data (form of datastep) or required output.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 14:29:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-format-a-date-within-proc-transpose-statement/m-p/294404#M61423</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-08-26T14:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to format a date within proc transpose statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-format-a-date-within-proc-transpose-statement/m-p/294407#M61424</link>
      <description>Thank you. I will try it and see if it works.</description>
      <pubDate>Fri, 26 Aug 2016 14:37:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-format-a-date-within-proc-transpose-statement/m-p/294407#M61424</guid>
      <dc:creator>malikah_sph</dc:creator>
      <dc:date>2016-08-26T14:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to format a date within proc transpose statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-format-a-date-within-proc-transpose-statement/m-p/294408#M61425</link>
      <description>&lt;P&gt;I tried it. Its not exactly what I am looking for. I don't need the dates as row headers. I would like an array like how mentioned in my initial code which is how I need the data organized. I just need each admit date to format as a date and not as Number. How can I do that using the prefix statement as an array to separate the admit dates in the code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc transpose data=temp&lt;BR /&gt;out=analysis&lt;BR /&gt;prefix=admitDate;&lt;BR /&gt;format admitDate yymmdd10.;&lt;BR /&gt;by patientId;&lt;BR /&gt;var age systolic procedure1 procedure2 procedure3 procedure4 procedure5 diagnosis1 diagnosis2 diagnosis3 diagnosis4 diagnosis5;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 14:42:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-format-a-date-within-proc-transpose-statement/m-p/294408#M61425</guid>
      <dc:creator>malikah_sph</dc:creator>
      <dc:date>2016-08-26T14:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to format a date within proc transpose statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-format-a-date-within-proc-transpose-statement/m-p/294448#M61435</link>
      <description>&lt;P&gt;Then please show what you do require. &amp;nbsp;Provide test data in the form of a datastep, and what the output should look like.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 15:57:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-format-a-date-within-proc-transpose-statement/m-p/294448#M61435</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-08-26T15:57:56Z</dc:date>
    </item>
  </channel>
</rss>

