<?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 create multiple sheets in excel for each subjects (patient profile listing) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696377#M212688</link>
    <description>&lt;P&gt;For each subject add this - Subject1 could be a macro variable:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods tagsets.excelxp options(sheet_interval="NONE" sheet_name="Subject1")&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You should move the ODS statement creating the spreadsheet file before the start of the loop as you only need&amp;nbsp; to do that once - assuming you only want one workbook.&lt;/P&gt;</description>
    <pubDate>Tue, 03 Nov 2020 23:47:11 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2020-11-03T23:47:11Z</dc:date>
    <item>
      <title>How to create multiple sheets in excel for each subjects (patient profile listing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696364#M212686</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create a sheet per subject in excel for my patient profile listings.&lt;/P&gt;&lt;P&gt;So far I was able to create one sheet for all domains in one sheet per subject, but now i need to create multiple sheets per subject. I'm afraid this statement might prevent it from happening&amp;nbsp;&amp;nbsp;&lt;CODE class=" language-sas"&gt;ods tagsets.excelxp options&lt;FONT face="arial black,avant garde"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;STRONG&gt;sheet_interval="NONE")&lt;/STRONG&gt;&lt;/FONT&gt; &lt;/CODE&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO profile;
	%do i=1 %to &amp;amp;subj_n.;
		%let select_subj = %scan(&amp;amp;subj., &amp;amp;i., '#');  *Creating macro variables to select patients one by one;

	options;
		ods listing close;
		ods html close;
		ods escapechar='^';
		ods tagsets.excelxp options&lt;FONT face="arial black,avant garde"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;STRONG&gt;sheet_interval="NONE")&lt;/STRONG&gt;&lt;/FONT&gt; file="Patient Profile Subject &amp;amp;select_subj..xls";
		option formchar="|----|+|---+=|-/\&amp;lt;&amp;gt;*" ls=70 ps=70 missing = " " nobyline nocenter nodate nonumber orientation=landscape;
		title; 
		title1 j=l "4" j=r "DNDI-Master";
	 
		footnote;
		footnote1 j=l " ";
		 
		*****	dm report	********;
		proc report data = raw.demographics (where=(sub_profile_id="&amp;amp;select_subj.")) split = "|" spacing = 3 missing nowindows headline headskip style(header)={textalign=l} spanrows;
			columns ("Dataset(s) : Demographics, Informedconsentconsenteme_2" sub_profile_id dsstdat version_id icprsubj age sex_decode race);
		
			define sub_profile_id /group left width = 38 "Subject ID";
			define dsstdat /display left width = 40 "Informed Consent Date|/dsstdat";
			define version_id /display left width = 40 "Protocol Version Number|/version_id";
			define icprsubj /display left width = 40 "Previous Subject Number|/icprsubj";
			define age /display left width = 40 "Age|/icprsubj";
			define sex_decode /display left width = 40 "Gender|/sex_decode";
			define race /display left width = 20 "Race|/multi vars";
		run;


       *****	Adverse events report	********;
		proc report data = raw.adverse_events (where=(sub_profile_id="&amp;amp;select_subj.")) split = "|" spacing = 3 missing nowindows headline headskip style(header)={textalign=l} spanrows;
			columns ("Dataset(s) : Adverse_events" aestdtc aeendtc interval_name_ aeterm aeongo_decode aesev_decode aefrq_decode);
					
			define aestdtc /display left width = 2 "Start Date|/aestdtc";
			define aeendtc /display left width = 2 "End Date|/aeendtc";
			define interval_name /display left width = 2 "interval Name|/interval_name";
			define aeterm /display left width = 2 "Adverse Event Term|/aeterm";
			define aeongo_decode /display left width = 20 "Ongoing?|/aeongo_decode";
			define aesev_decode /display left width = 2 "Severity|/aesev_decode";
			define aefrq_decode /display left width = 2 "Pattern|/aefrq_decode";
		run;

 
%end;
%mend profile;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Nov 2020 23:08:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696364#M212686</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2020-11-03T23:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple sheets in excel for each subjects (patient profile listing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696377#M212688</link>
      <description>&lt;P&gt;For each subject add this - Subject1 could be a macro variable:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods tagsets.excelxp options(sheet_interval="NONE" sheet_name="Subject1")&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You should move the ODS statement creating the spreadsheet file before the start of the loop as you only need&amp;nbsp; to do that once - assuming you only want one workbook.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 23:47:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696377#M212688</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-11-03T23:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple sheets in excel for each subjects (patient profile listing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696390#M212696</link>
      <description>&lt;P&gt;Not sure if I'm doing this correctly bc it's not working. Below is my code, thank you:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc sql;
	select unique(sub_profile_id) into : subj /*separated by "#"*/ from raw.demographics; 
	select count(sub_profile_id) into : subj_n from raw.demographics;  
quit;

%put &amp;amp;subj &amp;amp;subj_n;

%MACRO profile;
      &lt;STRONG&gt;ods listing close;
         ods escapechar='^';
         ods tagsets.excelxp options(sheet_interval="NONE" sheet_name="&amp;amp;subj.") file="..\..\DM\Patient Profile Subject.xls";&lt;/STRONG&gt;
	%do i=1 %to &amp;amp;subj_n.;
		%let select_subj = %scan(&amp;amp;subj., &amp;amp;i., '#');  *Creating macro variables to select patients one by one;

	options;
	
 
		option formchar="|----|+|---+=|-/\&amp;lt;&amp;gt;*" ls=70 ps=70 missing = " " nobyline nocenter nodate nonumber orientation=landscape;
		title; 
		title1 j=l "4" j=r "Master";
	 
		footnote;
		footnote1 j=l " ";
		 
		*****	dm report	********;
		proc report data = raw.demographics (where=(sub_profile_id="&amp;amp;select_subj.")) split = "|" spacing = 3 missing nowindows headline headskip style(header)={textalign=l} spanrows;
			columns ("Dataset(s) : Demographics, Informedconsentconsenteme_2" sub_profile_id dsstdat version_id icprsubj age sex_decode race);
		
			define sub_profile_id /group left width = 38 "Subject ID";
			define dsstdat /display left width = 40 "Informed Consent Date|/dsstdat";
			define version_id /display left width = 40 "Protocol Version Number|/version_id";
			define icprsubj /display left width = 40 "Previous Subject Number|/icprsubj";
			define age /display left width = 40 "Age|/icprsubj";
			define sex_decode /display left width = 40 "Gender|/sex_decode";
			define race /display left width = 20 "Race|/multi vars";
		run;


       *****	Adverse events report	********;
		proc report data = raw.adverse_events (where=(sub_profile_id="&amp;amp;select_subj.")) split = "|" spacing = 3 missing nowindows headline headskip style(header)={textalign=l} spanrows;
			columns ("Dataset(s) : Adverse_events" aestdtc aeendtc interval_name_ aeterm aeongo_decode aesev_decode aefrq_decode);
					
			define aestdtc /display left width = 2 "Start Date|/aestdtc";
			define aeendtc /display left width = 2 "End Date|/aeendtc";
			define interval_name /display left width = 2 "interval Name|/interval_name";
			define aeterm /display left width = 2 "Adverse Event Term|/aeterm";
			define aeongo_decode /display left width = 20 "Ongoing?|/aeongo_decode";
			define aesev_decode /display left width = 2 "Severity|/aesev_decode";
			define aefrq_decode /display left width = 2 "Pattern|/aefrq_decode";
		run;

 
%end;
%mend profile;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 02:34:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696390#M212696</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2020-11-04T02:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple sheets in excel for each subjects (patient profile listing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696392#M212698</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO profile;
      ods listing close;
         ods escapechar='^';
         ods tagsets.excelxp file="..\..\DM\Patient Profile Subject.xls";
	%do i=1 %to &amp;amp;subj_n.;
		%let select_subj = %scan(&amp;amp;subj., &amp;amp;i., '#');  *Creating macro variables to select patients one by one;

	options;
	
         ods tagsets.excelxp options(sheet_interval="NONE" sheet_name="&amp;amp;subj.");
 
		option formchar="|----|+|---+=|-/\&amp;lt;&amp;gt;*" ls=70 ps=70 missing = " " nobyline nocenter nodate nonumber orientation=landscape;
		title; 
		title1 j=l "4" j=r "Master";
	 
		footnote;
		footnote1 j=l " ";
		 
		*****	dm report	********;
		proc report data = raw.demographics (where=(sub_profile_id="&amp;amp;select_subj.")) split = "|" spacing = 3 missing nowindows headline headskip style(header)={textalign=l} spanrows;
			columns ("Dataset(s) : Demographics, Informedconsentconsenteme_2" sub_profile_id dsstdat version_id icprsubj age sex_decode race);
		
			define sub_profile_id /group left width = 38 "Subject ID";
			define dsstdat /display left width = 40 "Informed Consent Date|/dsstdat";
			define version_id /display left width = 40 "Protocol Version Number|/version_id";
			define icprsubj /display left width = 40 "Previous Subject Number|/icprsubj";
			define age /display left width = 40 "Age|/icprsubj";
			define sex_decode /display left width = 40 "Gender|/sex_decode";
			define race /display left width = 20 "Race|/multi vars";
		run;


       *****	Adverse events report	********;
		proc report data = raw.adverse_events (where=(sub_profile_id="&amp;amp;select_subj.")) split = "|" spacing = 3 missing nowindows headline headskip style(header)={textalign=l} spanrows;
			columns ("Dataset(s) : Adverse_events" aestdtc aeendtc interval_name_ aeterm aeongo_decode aesev_decode aefrq_decode);
					
			define aestdtc /display left width = 2 "Start Date|/aestdtc";
			define aeendtc /display left width = 2 "End Date|/aeendtc";
			define interval_name /display left width = 2 "interval Name|/interval_name";
			define aeterm /display left width = 2 "Adverse Event Term|/aeterm";
			define aeongo_decode /display left width = 20 "Ongoing?|/aeongo_decode";
			define aesev_decode /display left width = 2 "Severity|/aesev_decode";
			define aefrq_decode /display left width = 2 "Pattern|/aefrq_decode";
		run;

 
%end;
%mend profile;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Nov 2020 02:55:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696392#M212698</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-11-04T02:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple sheets in excel for each subjects (patient profile listing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696393#M212699</link>
      <description>it's only outputting one subject</description>
      <pubDate>Wed, 04 Nov 2020 03:21:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696393#M212699</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2020-11-04T03:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple sheets in excel for each subjects (patient profile listing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696394#M212700</link>
      <description>&lt;P&gt;You need a changing sheet name. Try this then:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods tagsets.excelxp options(sheet_interval="NONE" sheet_name="&amp;amp;select_subj.");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 03:38:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696394#M212700</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-11-04T03:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple sheets in excel for each subjects (patient profile listing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696396#M212701</link>
      <description>&lt;P&gt;Didn't work. Do you think it's the proc sql or proc report step? this is what it displays in the log for proc report. not sure what the previous programmer add "separated by '#'", but if that's not entered then the log will only display only one subject&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;11436   proc sql;
11437       select unique(sub_profile_id) into : subj separated by "#" from dmlst.demographics;
11437 !                                                                                         /*dndiraw.demographics;
11437 ! */
11438       select count(sub_profile_id) into : subj_n from dmlst.demographics;
11438 !                                                                         /*dndiraw.demographics;*/
11439   quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.03 seconds
      cpu time            0.04 seconds


11440
11441   %put &amp;amp;subj &amp;amp;subj_n;
01-COV-TEST10-ePRO#01-COV-TEST11-ePRO#01-COV-TEST12-ePRO#01-COV-TEST13-ePRO#01-COV-TEST14-ePRO#01-COV-TEST15-ePRO#01-COV
-TEST2-ePRO#01-COV-TEST3-ePRO#01-COV-TEST4-ePRO#01-COV-TEST5-ePRO#01-COV-TEST6-ePRO#01-COV-TEST7-ePRO#01-COV-TEST8-ePRO#
01-COV-TEST9-ePRO#01-COVDC100004#01-COVDC100014#01-COVDC100015#01-COVDC100016#01COVDC100001#01COVEG100001#01COVKE100001#
AndrewTest#AndrewTest10#AndrewTest3#AndrewTest5#AndrewTest6#AndrewTest8#COVIDTEST#Dan_language
test#Grace3_Language#Laurie_English
Dynamics#Laurie_TEST_ENGLISH#Laurie_Visits#Mind725aTUE#Mindy10#Mindy12#Mindy25Aug#Mindy825#Mindy9#MindyEPRO#MindyFriday#
MindyTuesday#MindyTuesday2#TEST123#TEST865#TEST987#TESTING2020#TESTPATIENT#TESTTEST#kathy10#kathy100#kathy12#kathy4#mind
y11#mindy6#mindy7#mindyTHUENG       57&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	select unique(sub_profile_id) into : subj separated by "#" from dmlst.demographics; /*dndiraw.demographics;*/
	select count(sub_profile_id) into : subj_n from dmlst.demographics; /*dndiraw.demographics;*/
quit;

%put &amp;amp;subj &amp;amp;subj_n;

/*********************************************************************************/
/*****	Creating macro ptpf to generate each patient profile report.	******;*/
/*******************************************************************************;*/
%MACRO ptpt;

		 ods listing close;
         ods escapechar='^';
         ods excel file="..\..\DM\Patient Profile Subject.xls";


	%do i=1  %to &amp;amp;subj_n.;
		%let select_subj = %scan(&amp;amp;subj., &amp;amp;i., '#');  *Creating macro variables to select patients one by one;


		************************************************************************************************************************
		**********************************	Generating pdf reports with patients profiles	************************************
		************************************************************************************************************************;
		options;
		 
		ods excel options(sheet_interval="NONE" sheet_name="&amp;amp;select_subj.") ;

option formchar="|----|+|---+=|-/\&amp;lt;&amp;gt;*" ls=70 ps=70 missing = " " nobyline nocenter nodate nonumber orientation=landscape;


	*****	dm report	********;
		proc report data = dmlst.demographics (where=(sub_profile_id="&amp;amp;select_subj.")) split = "|" spacing = 3 missing nowindows headline headskip style(header)={textalign=l} spanrows;
			columns ("Dataset(s) : Demographics, Informedconsentconsenteme_2" sub_profile_id dsstdat version_id icprsubj age sex_decode race);
		
			define sub_profile_id /group left width = 38 "Subject ID";
			define dsstdat /display left width = 40 "Informed Consent Date|/dsstdat";
			define version_id /display left width = 40 "Protocol Version Number|/version_id";
			define icprsubj /display left width = 40 "Previous Subject Number|/icprsubj";
			define age /display left width = 40 "Age|/icprsubj";
			define sex_decode /display left width = 40 "Gender|/sex_decode";
			define race /display left width = 20 "Race|/multi vars";
		run;
		&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Nov 2020 04:00:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696396#M212701</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2020-11-04T04:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple sheets in excel for each subjects (patient profile listing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696404#M212705</link>
      <description>&lt;P&gt;What does "didn't work" mean? Being more descriptive would be helpful. OK, let's try something simpler then:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;* First ODS;
ods excel options(sheet_interval="NONE") file="..\..\DM\Patient Profile Subject.xls";
* Second ODS;
ods excel options(sheet_name="Sheet&amp;amp;i.") ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That means you should end up with a series of sheets labelled sheet1, sheet2 and so on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 06:19:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696404#M212705</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-11-04T06:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple sheets in excel for each subjects (patient profile listing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696657#M212821</link>
      <description>&lt;P&gt;Ok I am able to have all subjects in one workbook but it's all in one sheet. If i comment out "(sheet_interval="NONE")" i'm able to create multiple sheet per subject but then it would go back to step 1 where it is only displaying one Proc Report.&amp;nbsp; Any suggestion would help, thank you!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;MACRO ptpf;

	 ods listing close;
     ods escapechar='^';
	* First ODS;
      ods excel options(sheet_interval="NONE") file="..\..\DM\MMPlisting_report\Patient Profile Subject.xls";

	%do i=1  %to &amp;amp;subj_n.;
		%let select_subj = %scan(&amp;amp;subj., &amp;amp;i., '#');  *Creating macro variables to select patients one by one;


		************************************************************************************************************************
		**********************************	Generating pdf reports with patients profiles	************************************
		************************************************************************************************************************;
		options;
	
		* Second ODS;
		ods excel options(sheet_name="Sheet&amp;amp;i.") ;


***** dm report ********;
proc report data = raw.demographics (where=(sub_profile_id="&amp;amp;select_subj.")) split = "|" spacing = 3 missing nowindows headline headskip style(header)={textalign=l} spanrows;
columns ("Dataset(s) : Demographics, Informedconsentconsenteme_2" sub_profile_id dsstdat );

define sub_profile_id /group left width = 38 "Subject ID";
define dsstdat /display left width = 40 "Informed Consent Date|/dsstdat";
 
run;






%end;
ods excel close;
%mend ptpf;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 20:16:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696657#M212821</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2020-11-04T20:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple sheets in excel for each subjects (patient profile listing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696682#M212836</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;sheet_interval="group"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and run the PROC REPORT without the WHERE.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 20:52:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696682#M212836</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-04T20:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple sheets in excel for each subjects (patient profile listing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696690#M212839</link>
      <description>unfortunately it didn't work</description>
      <pubDate>Wed, 04 Nov 2020 21:04:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696690#M212839</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2020-11-04T21:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple sheets in excel for each subjects (patient profile listing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696709#M212851</link>
      <description>&lt;P&gt;See my example in your new post.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 22:36:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696709#M212851</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-11-04T22:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple sheets in excel for each subjects (patient profile listing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696713#M212855</link>
      <description>unfortunately still doesn't work. seems like the options are overriding each other, maybe bc of the do loop or the multiple proc reports</description>
      <pubDate>Wed, 04 Nov 2020 22:50:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696713#M212855</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2020-11-04T22:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple sheets in excel for each subjects (patient profile listing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696733#M212861</link>
      <description>&lt;P&gt;I don't understand how you want to organize the workbook(s).&lt;/P&gt;
&lt;P&gt;You said one sheet per subject, but you are printing different data domains (DEMOG, AE, etc).&lt;/P&gt;
&lt;P&gt;Did you mean one workbook per subject with one sheet per data domain?&lt;/P&gt;
&lt;P&gt;Or did you mean multiple sheets per subject?&lt;/P&gt;
&lt;P&gt;Are you trying to stack DEMOG and AE into the same sheet? That could look pretty ugly.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 23:44:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696733#M212861</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-11-04T23:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple sheets in excel for each subjects (patient profile listing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696734#M212862</link>
      <description>&lt;P&gt;Before make the macro get the logic to work first with hard coded values.&lt;/P&gt;
&lt;P&gt;Pick one or two subjects.&lt;/P&gt;
&lt;P&gt;Code the steps you want and see if you can get the layout you want.&lt;/P&gt;
&lt;P&gt;Then try to use macro code the generate the code.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 23:46:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696734#M212862</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-11-04T23:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple sheets in excel for each subjects (patient profile listing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696736#M212864</link>
      <description>&lt;P&gt;Sorry, but I've finally realised that the EXCEL destination works differently to the EXCELXP tagset. This works fine for me using the sheet interval NOW, not NONE.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel file = "Test1.xlsx";

ods excel options(sheet_interval="NOW" sheet_name="Males");

proc print data= sashelp.class;
  where sex = 'M';
run;

ods excel options(sheet_interval="NOW" sheet_name="Females");

proc print data= sashelp.class;
  where sex = 'F';
run;

ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Nov 2020 23:57:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696736#M212864</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-11-04T23:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple sheets in excel for each subjects (patient profile listing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696750#M212869</link>
      <description>&lt;P&gt;Yes, I want to stack Demog, AE, along with other domains, exactly&amp;nbsp; like it is done in pdf/rtf.&lt;/P&gt;&lt;P&gt;So the final result with give me&amp;nbsp;to one workbook&amp;nbsp; with one sheet for ALL domains per subject.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it doesn't look bad when I use ods excel options(sheet_interval="NONE") ; (see screenshot of output)&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51395iB647A0503245C5A4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2020 02:30:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696750#M212869</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2020-11-05T02:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple sheets in excel for each subjects (patient profile listing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696952#M212967</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/111564"&gt;@HitmonTran&lt;/a&gt;&amp;nbsp;- Did you miss my earlier reply using SHEET_INTERVAL = NOW? Try my test program. If it works for you then use the same approach in your macro.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2020 19:08:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696952#M212967</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-11-05T19:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple sheets in excel for each subjects (patient profile listing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696957#M212968</link>
      <description>Yes I saw but it didn't work. The team and I came to the conclusion that we might just need to create multiple workbooks per subject instead.</description>
      <pubDate>Thu, 05 Nov 2020 19:40:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/696957#M212968</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2020-11-05T19:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple sheets in excel for each subjects (patient profile listing)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/697030#M212988</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/111564"&gt;@HitmonTran&lt;/a&gt;&amp;nbsp; - This is what I get when running my test program - a single workbook with two tabs, one for Males and one for Females. This is what I thought you wanted - being able to split reports between tabs? If my understanding is incorrect then what do you actually want?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="screenshot34.JPG" style="width: 475px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51438i0634247BDCF1409A/image-dimensions/475x482?v=v2" width="475" height="482" role="button" title="screenshot34.JPG" alt="screenshot34.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2020 23:34:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-multiple-sheets-in-excel-for-each-subjects-patient/m-p/697030#M212988</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-11-05T23:34:08Z</dc:date>
    </item>
  </channel>
</rss>

