<?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 Macro to create patient profiles in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-create-patient-profiles/m-p/120503#M24765</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I Have created a macro for creating patient profiles.&lt;/P&gt;&lt;P&gt;%macro patprof ( subjid= );&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;%mend;&lt;/P&gt;&lt;P&gt;I have 550 patients in my study and I am calling my macro for every individual patient.&lt;/P&gt;&lt;P&gt;for example :-&lt;/P&gt;&lt;P&gt;%patprof(subjid= 101);&lt;/P&gt;&lt;P&gt;%Patprof(subjid=102);&lt;/P&gt;&lt;P&gt;%patprof(subjid=109);&lt;/P&gt;&lt;P&gt;is there any way that which improves my macro code so that I don't need to call my macro all 550 times for each patient.&lt;/P&gt;&lt;P&gt; My subjid are not consecutive numbers.&lt;/P&gt;&lt;P&gt;any help is appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Feb 2013 16:07:57 GMT</pubDate>
    <dc:creator>mano</dc:creator>
    <dc:date>2013-02-25T16:07:57Z</dc:date>
    <item>
      <title>Macro to create patient profiles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-create-patient-profiles/m-p/120503#M24765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I Have created a macro for creating patient profiles.&lt;/P&gt;&lt;P&gt;%macro patprof ( subjid= );&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;%mend;&lt;/P&gt;&lt;P&gt;I have 550 patients in my study and I am calling my macro for every individual patient.&lt;/P&gt;&lt;P&gt;for example :-&lt;/P&gt;&lt;P&gt;%patprof(subjid= 101);&lt;/P&gt;&lt;P&gt;%Patprof(subjid=102);&lt;/P&gt;&lt;P&gt;%patprof(subjid=109);&lt;/P&gt;&lt;P&gt;is there any way that which improves my macro code so that I don't need to call my macro all 550 times for each patient.&lt;/P&gt;&lt;P&gt; My subjid are not consecutive numbers.&lt;/P&gt;&lt;P&gt;any help is appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2013 16:07:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-to-create-patient-profiles/m-p/120503#M24765</guid>
      <dc:creator>mano</dc:creator>
      <dc:date>2013-02-25T16:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to create patient profiles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-create-patient-profiles/m-p/120504#M24766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would have to post your macro in order for anyone to help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2013 16:09:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-to-create-patient-profiles/m-p/120504#M24766</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-02-25T16:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to create patient profiles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-create-patient-profiles/m-p/120505#M24767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art is right ... without seeing your code we can give just the most general of answers.&amp;nbsp; With that in mind, there are two approaches that might be possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(1) You may be able to change your code so that it processes all patients using a BY SUBJID statement.&amp;nbsp; If appropriate, subset your data so it contains just the SUBJID values of interest (including the possibility of just a single SUBJID), and feed the subset to your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(2) You may be able to keep your code as is, but tell us a data set that contains all relevant values for SUBJID.&amp;nbsp; Then macro language could generate the 550 calls to your macro, instead of you having to type them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2013 17:00:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-to-create-patient-profiles/m-p/120505#M24767</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-02-25T17:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to create patient profiles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-create-patient-profiles/m-p/120506#M24768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on your information provided, if youe SUBJID is not a consecutive numbers, then try the following code..It might works...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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; proc sql noprint;&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; select distinct compress(subjid) into :_subjid separated by ' '&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; from have (keep = subjid);&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; quit;&lt;/P&gt;&lt;P&gt;&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; %let i = 1;&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; %let _subjid_ =&amp;nbsp; %scan(&amp;amp;_subjid.,&amp;amp;i.);&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; %do %while(&amp;amp;_subjid_ NE);&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; %patprof(subjid= &amp;amp;_subjid_.);&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; %let i = %eval(&amp;amp;i + 1);&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; %let _subjid_ = %scan(&amp;amp;_subjid.,&amp;amp;i.);&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; %end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend test;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%test;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it works...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Urvish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2013 06:51:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-to-create-patient-profiles/m-p/120506#M24768</guid>
      <dc:creator>UrvishShah</dc:creator>
      <dc:date>2013-02-26T06:51:10Z</dc:date>
    </item>
  </channel>
</rss>

