<?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 DO Loops &amp; Arrays Or Proc Transpose in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21111#M4422</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You never responded to my last post and I really don't have any idea what the file looks like or where the variables come from that you refer to in your code.&amp;nbsp; I saw your post on SAS-L, but didn't respond to it for the same reason.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are following the method I had suggested, the variables you refer to don't exist.&amp;nbsp; Rather, the variables can be renamed and labeled during the same run as they are input, thus requiring only ONE program, and the only things that would have to change are the names of the 7 input files and possibly the station numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, it appears like you went a totally different route and I don't understand your questions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Mar 2012 16:43:46 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2012-03-06T16:43:46Z</dc:date>
    <item>
      <title>DO Loops &amp; Arrays Or Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21098#M4409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an Excel File and i used art's code from last time. It worked for a different requirement, but the requirement has changed. I have put up a model of how the final data should look like. But it is only for one station. I am looking to do it for 7 stations, but this is the code i used last time. If it can be tweaked, please explain it to me. The final data will have 311 variable and 24 observations. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Libname Thomas "C:\Users\tgeorge\Documents\Rulan_Nephrology";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%Macro Import(Sheet);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PROC IMPORT OUT=STATION&amp;amp;Sheet &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;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATAFILE= "C:\Users\tgeorge\Documents\Rulan_Nephrology\OSCE_NEPHRO_01_27_2012.xls" &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;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBMS=EXCEL REPLACE;&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; RANGE="'Station &amp;amp;Sheet.$'"; &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; GETNAMES=YES;&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; MIXED=YES;&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; SCANTEXT=YES;&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; USEDATE=YES;&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; SCANTIME=YES;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RUN;&lt;/P&gt;&lt;P&gt;%Mend Import;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%Import(1)&lt;/P&gt;&lt;P&gt;%Import(2)&lt;/P&gt;&lt;P&gt;%Import(3)&lt;/P&gt;&lt;P&gt;%Import(4)&lt;/P&gt;&lt;P&gt;%Import(5)&lt;/P&gt;&lt;P&gt;%Import(6)&lt;/P&gt;&lt;P&gt;%Import(7)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data station1; &lt;/P&gt;&lt;P&gt;set station1;&lt;/P&gt;&lt;P&gt;rename Response_=Response;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data station1final (keep=st1rot: st1can: st1stan: id_:);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set station1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array st1rotation(9);&lt;/P&gt;&lt;P&gt;&amp;nbsp; array st1canmed(7);&lt;/P&gt;&lt;P&gt;&amp;nbsp; array st1standardized(6);&lt;/P&gt;&lt;P&gt;&amp;nbsp; retain st1rotation: st1canmed: st1standardized:;&lt;/P&gt;&lt;P&gt;&amp;nbsp; select (mod(_n_,22));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; when (0) 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;&amp;nbsp;&amp;nbsp;&amp;nbsp; st1standardized(6)=response;&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; 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; when (1) 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;&amp;nbsp;&amp;nbsp;&amp;nbsp; call missing(of st1rotation(*));&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; call missing(of st1canmed(*));&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; call missing(of st1standardized(*));&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; st1rotation(1)=response;&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; when (2,3,4,5,6,7,8,9) st1rotation(mod(_n_,22))=response;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; when (10,11,12,13,14,15,16) 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; st1canmed(mod(_n_,22)-9)=response;&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; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; otherwise st1standardized(mod(_n_,22)-16)=response;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 21:10:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21098#M4409</guid>
      <dc:creator>ThomasGeorge</dc:creator>
      <dc:date>2012-03-02T21:10:04Z</dc:date>
    </item>
    <item>
      <title>DO Loops &amp; Arrays Or Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21099#M4410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also, can anyone explain the&amp;nbsp; MOD fuunction with the code above?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 21:34:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21099#M4410</guid>
      <dc:creator>ThomasGeorge</dc:creator>
      <dc:date>2012-03-02T21:34:10Z</dc:date>
    </item>
    <item>
      <title>DO Loops &amp; Arrays Or Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21100#M4411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; MOD is the modulo, or remainder, function. For instance, mod( _n_ , 22 ) will return the remainder of the division of _n_ by 22, an integer between 0 and 21.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 21:46:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21100#M4411</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-03-02T21:46:02Z</dc:date>
    </item>
    <item>
      <title>DO Loops &amp; Arrays Or Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21101#M4412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PGStats already answered your question, but I really think you ought to offer you boss two choices: (1) the file that you are planning/trying to create and (2) creating a much narrower spreadsheet with only the 22 questions identified (along with the other information like id, ec.) and an extra field for station.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Making separate fields for each question/station really doesn't make a lot of sense.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Mar 2012 01:19:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21101#M4412</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-03-03T01:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: DO Loops &amp; Arrays Or Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21102#M4413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I talked to the BOSS. She said she does not want two seperate columns for SP and MD, cos when she wants to do a proc means, she cannot use the SP and MD as class variables. I tried convincing her that we can have 2 columns for SP and MD, so that we can stick with just 22 variables of responses and just refer back to the Excel sheet to see the "out of" score. And to do means, and std, we can just do the data step. Having 311 variables with 24 observations, does not make too much sense for me. But as you said art the boss is always right!.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Mar 2012 01:28:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21102#M4413</guid>
      <dc:creator>ThomasGeorge</dc:creator>
      <dc:date>2012-03-03T01:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: DO Loops &amp; Arrays Or Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21103#M4414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wasn't suggesting separate columns for sp and md.&amp;nbsp; Sp and md only appear to identify the questions.&amp;nbsp; I was just suggesting a separate column for station (i.e., one column that shows the station the data is coming from).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, like you said, the BOSS makes the ultimate decision and, if rule two conflicts, refer back to rule #1.&amp;nbsp; Just don't be surprised if you ultimately have to recreate the file the way I had described.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Mar 2012 01:35:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21103#M4414</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-03-03T01:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: DO Loops &amp; Arrays Or Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21104#M4415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I talked to the boss as you asked me too and she said she wants it in the way that is on the Excel sheet. I know for sure she will change her mind, but i have come to understand that is the nature of work. I was thinking from the code you generated, is it better to generate the first data set on where=SP and then another data set on where=MD and then finally append them? Do it for all 7 stations and do a final merge based on ID number and SP/MD variable and it should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Mar 2012 16:18:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21104#M4415</guid>
      <dc:creator>ThomasGeorge</dc:creator>
      <dc:date>2012-03-03T16:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: DO Loops &amp; Arrays Or Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21105#M4416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thomas,&amp;nbsp; I must have missed something because I don't understand the model you posted a couple of days ago.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specifically, I don't understand what differentiates SP and MD values in your breakdown, or the second set of values (i.e., rows 17 thru 28) in your model.&amp;nbsp; Regardless, I think you have already amassed enough tools to be able to put it together yourself.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Mar 2012 16:43:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21105#M4416</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-03-03T16:43:05Z</dc:date>
    </item>
    <item>
      <title>DO Loops &amp; Arrays Or Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21106#M4417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am studying your code. I am learning to expand it. So i wrote the code this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data station1final (keep=st1rot: st1can: st1stan: id_:);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set station1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array st1rotationresp(9);&lt;/P&gt;&lt;P&gt;&amp;nbsp; array st1rotationout (9);&lt;/P&gt;&lt;P&gt;&amp;nbsp; array st1canmedresp(7);&lt;/P&gt;&lt;P&gt;&amp;nbsp; array st1canmedout(7);&lt;/P&gt;&lt;P&gt;&amp;nbsp; array st1standardizedresp(6);&lt;/P&gt;&lt;P&gt;&amp;nbsp; array st1standardizedout(6);&lt;/P&gt;&lt;P&gt;&amp;nbsp; retain st1rotation: st1canmed: st1standardized:;&lt;/P&gt;&lt;P&gt;select (mod(_n_,22));&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;&amp;nbsp;&amp;nbsp;when (0) 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;&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; If st1standardizedout(6) then st1standardizedout(6)= out__of; else st1standardizedout(6)='Y:1;N:0';&lt;/P&gt;&lt;P&gt;&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;&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;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;when (0) 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;&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; st1standardizedresp(6)=response;&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;&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; end;&lt;/P&gt;&lt;P&gt;Otherwise;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the 6th observation of standardized the out of variable has character values. I tried the above statement, but it did not work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Mar 2012 19:49:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21106#M4417</guid>
      <dc:creator>ThomasGeorge</dc:creator>
      <dc:date>2012-03-03T19:49:22Z</dc:date>
    </item>
    <item>
      <title>DO Loops &amp; Arrays Or Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21107#M4418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't understand what your input data look like at the point you are setting Station1 or why you would declare all of the arrays if you aren't going to use them in your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Two things though: (1) an array can only take character or numeric values, not both&lt;/P&gt;&lt;P&gt;(2) a select statements options can only be used once.&amp;nbsp; Thus, your second use of when(0) would never be executed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plus, like I've mentioned, from the code and data snippets you've presented, I DON'T understand what you are trying to do. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Mar 2012 19:59:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21107#M4418</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-03-03T19:59:17Z</dc:date>
    </item>
    <item>
      <title>DO Loops &amp; Arrays Or Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21108#M4419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am studying your code, so i was trying different things to see why it works one way, but does not the other. Thank you for the info on the select statement and array. Now the mod function, I realise that the MOD function excutes for every nth observation, But can you explain why the call missing function? and it's purpose in this code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Mar 2012 21:01:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21108#M4419</guid>
      <dc:creator>ThomasGeorge</dc:creator>
      <dc:date>2012-03-03T21:01:56Z</dc:date>
    </item>
    <item>
      <title>DO Loops &amp; Arrays Or Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21109#M4420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My original code was designed to read the 22 records that comprised each subject's data.&amp;nbsp; Some of the info was only captured on a specific record and some of the information was repeated 22 times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the mod function returned a 1, SAS was reading a subject's first record.&amp;nbsp; As such, all of the previous data was for the previous subject, thus was set to missing values.&amp;nbsp; Similarly, when reading the first nine records in each set, it was picking up the rotation data, when reading the next seven records was picking up the canmed data (and when reading the last record in that group it was also picking up the comment) and, finally, when reading the last seven records it was picking up the standardized data (and, for the last one where mod would return a 0, outputing the record).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same method should work for all of your files.&amp;nbsp; While I don't understand what you are trying to do now, it sounds like you are still trying to read the same data, just assign them to different variables and rename those variables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;PROC IMPORT OUT= WORK.have&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; DATAFILE= "C:\art\Thomas.xlsx"&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; DBMS=excel REPLACE;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; GETNAMES=YES;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;data want (keep=rot: can: stan: prg id: comment);&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; array rotation(9);&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; array canmed(7);&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; array standardized(6);&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; retain rotation: canmed: standardized: comment;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; select (mod(_n_,22));&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; when (0) do;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, 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; standardized(6)=response_;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, 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; output;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, 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; end;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; when (1) do;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, 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; call missing(of rotation(*));&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, 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; call missing(of canmed(*));&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, 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; call missing(of standardized(*));&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, 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; rotation(1)=response_;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, 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; end;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; when (2,3,4,5,6,7,8,9) rotation(mod(_n_,22))=response_;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; when (10,11,12,13,14,15,16) do;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, 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;&amp;nbsp;&amp;nbsp;&amp;nbsp; canmed(mod(_n_,22)-9)=response_;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if mod(_n_,22) eq 16 then&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; comment=Comments;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, 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;&amp;nbsp; end;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; otherwise standardized(mod(_n_,22)-16)=response_;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Mar 2012 22:04:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21109#M4420</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-03-03T22:04:18Z</dc:date>
    </item>
    <item>
      <title>DO Loops &amp; Arrays Or Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21110#M4421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wrote this code. I was wondering if there is a more efficient way of writing this out. I wanted to use First.SP_vs_MD because it changes between 1 and 0. But it did not work out so i wrote it out this way. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data station1 (drop=Response_);&lt;/P&gt;&lt;P&gt;set station1;&lt;/P&gt;&lt;P&gt;Response=Response_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data = station1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out = station1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;by ID_No_ SP_vs_MD;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data station1md (drop = comments PRG Evaluation_Type Question_ SP_vs_MD Response Out__Of ID);&lt;/P&gt;&lt;P&gt;set station1;&lt;/P&gt;&lt;P&gt;By ID_no_ ;&lt;/P&gt;&lt;P&gt;SP_MD = 1;&lt;/P&gt;&lt;P&gt;If question_ = "Q.1. Patients Needs &amp;amp; Feelings" then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Q1Resp = response;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Q1Out_of = Out__of;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;If question_ = "Q.2. Coherence" then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Q2Resp = response;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Q2Out_of = Out__of;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;If question_ = "Q.3. Verbal Expression" then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Q3Resp = response;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Q3Out_of = Out__of;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;If question_ = "Q.4. Non-Verbal Expression" then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Q4Resp = response;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Q4Out_of = Out__of;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;If question_ = "CanMEDs - Global Rating" then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Q5Resp = response;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Q5Out_of = Out__of;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end; &lt;/P&gt;&lt;P&gt;If question_ = "CanMEDs - Competency" then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Q6Resp = response_ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Q6Out_of = Out__of;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;if last.ID_no_ then&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;retain Q1Resp Q1Out_of Q2Resp Q2Out_of Q3Resp Q3Out_of Q4Resp Q4Out_of Q5Resp Q5Out_of Q6Resp Q6Out_of;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data station1sp (drop = comments PRG Evaluation_Type Question_ SP_vs_MD Response Out__Of ID);&lt;/P&gt;&lt;P&gt;set station1;&lt;/P&gt;&lt;P&gt;By ID_no_ ;&lt;/P&gt;&lt;P&gt;SP_MD = 0;&lt;/P&gt;&lt;P&gt;If question_ = "Q.2. Response to Feelings" then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Q1Resp = response;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Q1Out_of = Out__of;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;If question_ = "Q.3. Degree of Coherence" then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Q2Resp = response;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Q2Out_of = Out__of;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;If question_ = "Q.4. Verbal Expression" then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Q3Resp = response;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Q3Out_of = Out__of;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;If question_ = "Q.5. Non-Verbal Expression" then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Q4Resp = response;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Q4Out_of = Out__of;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;If question_ = "Q.1. Overall" then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Q5Resp = response;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Q5Out_of = Out__of;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end; &lt;/P&gt;&lt;P&gt;If question_ = "Q.6. Key Points" then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Q6Resp = response;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Q6Out_of = Out__of;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;if last.ID_no_ then&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;retain Q1Resp Q1Out_of Q2Resp Q2Out_of Q3Resp Q3Out_of Q4Resp Q4Out_of Q5Resp Q5Out_of Q6Resp Q6Out_of;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data station1modify;&lt;/P&gt;&lt;P&gt;set station1md station1sp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, how can i do this for all 7 stations instead of writing and copying down the codes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2012 16:28:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21110#M4421</guid>
      <dc:creator>ThomasGeorge</dc:creator>
      <dc:date>2012-03-06T16:28:09Z</dc:date>
    </item>
    <item>
      <title>DO Loops &amp; Arrays Or Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21111#M4422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You never responded to my last post and I really don't have any idea what the file looks like or where the variables come from that you refer to in your code.&amp;nbsp; I saw your post on SAS-L, but didn't respond to it for the same reason.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are following the method I had suggested, the variables you refer to don't exist.&amp;nbsp; Rather, the variables can be renamed and labeled during the same run as they are input, thus requiring only ONE program, and the only things that would have to change are the names of the 7 input files and possibly the station numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, it appears like you went a totally different route and I don't understand your questions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2012 16:43:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21111#M4422</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-03-06T16:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: DO Loops &amp; Arrays Or Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21112#M4423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My boss changed her mind. She now wants only 6 specific questions like i indicated in the code which is the same in all seven stations. She apparently changed her mind on how she wants to submit some proposal for grant. I am sorry for not responding to th last post on time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will post the file again on this discussion board.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2012 16:54:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21112#M4423</guid>
      <dc:creator>ThomasGeorge</dc:creator>
      <dc:date>2012-03-06T16:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: DO Loops &amp; Arrays Or Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21113#M4424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thomas, You only posted the data for 4 stations, but have indicated that you have seven.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each station has different questions, different numbers of questions, and the order of question groups appears to be different for the four stations' data that you posted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thus, what I was suggesting about using the same program for all seven, obviously wouldn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would start by writing the code, as I had suggested, for station 1, renaming the variables as desired and including labels for all of the variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, once you have that working, creating separate code for the other stations may only be a matter of creating separate (but similar) versions for the other stations.&amp;nbsp; The only things that would change or the variable lables, the number of variables and the order they are input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you create the seven files, that way, then you would be able to set them all together in one datastep, only keeping the variables that your boss currently wants included in the file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2012 17:22:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21113#M4424</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-03-06T17:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: DO Loops &amp; Arrays Or Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21114#M4425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Art,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Boss told me to just focus on the following questions, sincethese questions are the same with different evaluations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Canmeds ,Q.1.Patients needs and feelings&lt;/P&gt;&lt;P&gt;Standardized Pt., Q.2.Response to feelings&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Canmeds, Q.2. Coherence&lt;/P&gt;&lt;P&gt;Standardized, Pt. Q.3.Degree of Coherence&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Canmeds, Q.3.Verbal Expression&lt;/P&gt;&lt;P&gt;Standardized Pt., Q.4. Verbal Expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Canmeds, Q.4.Non-Verbal Expression&lt;/P&gt;&lt;P&gt;Standardized Pt., Q.5. Non-Verbal Expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Global Rating, Canmeds-Global rating&lt;/P&gt;&lt;P&gt;Standardized Pt., Q.1.Overall&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Competency, Canmeds-Competency&lt;/P&gt;&lt;P&gt; Standardized Pt., Q.6.KeyPoints &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;She wants both the response and ID variables. All 7 stations have the same pair of questions. Hopefully this helps Art. If not, ask me more.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2012 17:54:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21114#M4425</guid>
      <dc:creator>ThomasGeorge</dc:creator>
      <dc:date>2012-03-06T17:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: DO Loops &amp; Arrays Or Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21115#M4426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thomas, I'll see if I have time later to take a quick look, but you wouldn't be disagreeing with your boss AT ALL if you read in all of the data.&amp;nbsp; In fact, the way the spreadsheets are formatted, you don't really have a choice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pulling in all of the data up front, but isolating the data she wants, appears like the easiest and most well rounded approach.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2012 18:11:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21115#M4426</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-03-06T18:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: DO Loops &amp; Arrays Or Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21116#M4427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I figured it is best to import all the data from all the sheets which is what i have done. She wants only the 6 questions for now, where the number are due for some proposal submission for tomorrow. But i know that this is not the end of it. I have to conceputalize the best way to categorize and clean the data, so in the future I can just pull the variables she needs to do the analysis with the procs she wants. This is my new learning curve categorizing and cleaning data. Appreciate all your help by the way Art. Thomas. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2012 18:19:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21116#M4427</guid>
      <dc:creator>ThomasGeorge</dc:creator>
      <dc:date>2012-03-06T18:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: DO Loops &amp; Arrays Or Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21117#M4428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did all 7 stations maually. Used the replace function in notepad for each station and put it back into SAS. From the experience, i learnt that many of the wordings are different, thus i had to correct many questions way of asking. Nonetheless...i was wondering if there is a search and replace function in SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2012 20:18:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-Loops-Arrays-Or-Proc-Transpose/m-p/21117#M4428</guid>
      <dc:creator>ThomasGeorge</dc:creator>
      <dc:date>2012-03-06T20:18:40Z</dc:date>
    </item>
  </channel>
</rss>

