<?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: Proc report vertical border for headers between two across groups (ods excel) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-vertical-border-for-headers-between-two-across/m-p/726913#M225961</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/372778"&gt;@RJB_NZ&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&lt;BR /&gt;That makes a lot of sense, unfortunately it doesn't work for me.&lt;BR /&gt;Did it work for you when you tested it inside my code?&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Can't test code without data and I'm way too lazy to try to dummy something up that would use all the Excel options plus the report code.&lt;/P&gt;</description>
    <pubDate>Tue, 16 Mar 2021 20:59:50 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-03-16T20:59:50Z</dc:date>
    <item>
      <title>Proc report vertical border for headers between two across groups (ods excel)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-vertical-border-for-headers-between-two-across/m-p/726603#M225796</link>
      <description>&lt;P&gt;Hello I'm looking to put vertical borders between the different parts of my (non-trivial) table. I almost got there...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm getting this (notice the gaps in the lines at cells D2 and G2):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RJB_NZ_0-1615862498814.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55980i54BB70C494C12123/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RJB_NZ_0-1615862498814.png" alt="RJB_NZ_0-1615862498814.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I'd like to have this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RJB_NZ_1-1615862540872.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55981i40BF50E3790F3FFE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RJB_NZ_1-1615862540872.png" alt="RJB_NZ_1-1615862540872.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let TempPath = %sysfunc(getoption(work)); * ref to Work library;
%put &amp;amp;=TempPath;

ODS excel 
	file = "&amp;amp;TempPath./Shoes Test.xlsx"
	style= Listing
	options (	embedded_titles='OFF' 
				sheet_interval="none" 
				sheet_name='Shoes Tests' 
				gridlines ='off' 
				absolute_column_width='23, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12' 
				absolute_row_height='15.75' 
			);

	data altered_shoes;
		set sashelp.shoes;
		where product in ('Sandal' 'Slipper' 'Sport Shoe');
		if product = 'Sandal' then month = '31Jan2020'd;
		if product = 'Slipper' then month = '31Dec2020'd;
		if product = 'Sport Shoe' then month = '31Jan2021'd;
	run;

	proc format;
		value $MergeAcross_Headers
			'Month Diff', 'Jan 21 - Dec 20', 'Year Diff', 'Jan 21 - Jan 20' = MERGEACROSS:2
		;
		value $DummyWhiteOut
			'Dummy Value' = lightgrey
		;
		value $tester
			'Jan 21'd = solid
		;
		value $header_rborder
			'Products sold', 'Sales amount' = solid
		;
	run;

	proc report data=altered_shoes
					style(header)=[tagattr=$MergeAcross_Headers. color=$DummyWhiteOut. borderrightstyle=$header_rborder.];
		format month Mon_YY. ;
		column ('Dummy Value'(''('Global Regions' Region)))
			   ('Products sold' month),stores 
			   ('Sales amount' month), sales 
			   ('Month Diff' ('' ('Jan 21 - Dec 20' Month_Diff)))
			   ('Year Diff' ('' ('Jan 21 - Jan 20' Year_Diff)))
				boarder_formater;
		define Region  		/ '' group order=internal;
		define month 		/ '' across order=internal
								   style(header)=[borderrightstyle=$tester.]; *&amp;lt;&amp;lt;&amp;lt;&amp;lt; Not working :-(    ;
		define stores  		/ '';
		define sales   		/ '';
		define Month_Diff 	/ computed format=dollar.2 ''
								   style(column)=[ tagattr='MERGEACROSS:2'];
		define Year_Diff 	/ computed format=dollar.2 ''
								   style(column)=[ tagattr='MERGEACROSS:2'];
		define boarder_formater / noprint;
		
		compute Year_Diff;
				Month_Diff = _c5_ - _c7_;
				Year_Diff = _c6_ - _c7_;
		endcomp;	
		compute boarder_formater;
		   		call define(4, "style/merge", "style=[borderrightstyle=solid]");
		   		call define(7, "style/merge", "style=[borderrightstyle=solid]");
		endcomp;
	run;

ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Rodney&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 02:52:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-vertical-border-for-headers-between-two-across/m-p/726603#M225796</guid>
      <dc:creator>RJB_NZ</dc:creator>
      <dc:date>2021-03-16T02:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report vertical border for headers between two across groups (ods excel)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-vertical-border-for-headers-between-two-across/m-p/726604#M225797</link>
      <description>PS the $tester. method worked when I had a character variable as my across group, but I haven't been able to get it to work with a date variable.</description>
      <pubDate>Tue, 16 Mar 2021 02:55:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-vertical-border-for-headers-between-two-across/m-p/726604#M225797</guid>
      <dc:creator>RJB_NZ</dc:creator>
      <dc:date>2021-03-16T02:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report vertical border for headers between two across groups (ods excel)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-vertical-border-for-headers-between-two-across/m-p/726781#M225896</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/372778"&gt;@RJB_NZ&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;PS the $tester. method worked when I had a character variable as my across group, but I haven't been able to get it to work with a date variable.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Conflicting value/format. Your MONTH variable is a DATE, which is numeric from the format you apply. The format you attempt to create $tester would be for CHARACTER values. Your attempt to use "Jan 21"d as a "date" fails for two reasons. First literal dates must be in the form of 'ddMONyy'd or 'ddMONyyyy'd, the day of the month MUST be present in a literal date.&lt;/P&gt;
&lt;P&gt;Second you are using format on a date to create a group, so you don't know which underlying value of the variable may actually be there.&lt;/P&gt;
&lt;P&gt;Try creating a format like&lt;/P&gt;
&lt;PRE&gt;value tester
'01JAN2021'd - '31JAN2021'd = 'solid'
;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 14:46:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-vertical-border-for-headers-between-two-across/m-p/726781#M225896</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-03-16T14:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report vertical border for headers between two across groups (ods excel)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-vertical-border-for-headers-between-two-across/m-p/726908#M225958</link>
      <description>Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&lt;BR /&gt;That makes a lot of sense, unfortunately it doesn't work for me.&lt;BR /&gt;Did it work for you when you tested it inside my code?&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Mar 2021 20:55:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-vertical-border-for-headers-between-two-across/m-p/726908#M225958</guid>
      <dc:creator>RJB_NZ</dc:creator>
      <dc:date>2021-03-16T20:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report vertical border for headers between two across groups (ods excel)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-vertical-border-for-headers-between-two-across/m-p/726913#M225961</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/372778"&gt;@RJB_NZ&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&lt;BR /&gt;That makes a lot of sense, unfortunately it doesn't work for me.&lt;BR /&gt;Did it work for you when you tested it inside my code?&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Can't test code without data and I'm way too lazy to try to dummy something up that would use all the Excel options plus the report code.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 20:59:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-vertical-border-for-headers-between-two-across/m-p/726913#M225961</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-03-16T20:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report vertical border for headers between two across groups (ods excel)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-vertical-border-for-headers-between-two-across/m-p/726914#M225962</link>
      <description>The data step in my code creates the data for you.&lt;BR /&gt;&lt;BR /&gt;The only thing you have to do to run my code is if your server is Windows based then change the / to a \ within the statement &amp;lt;&amp;lt;&amp;lt; ODS excel file = "&amp;amp;TempPath./Shoes Test.xlsx" &amp;gt;&amp;gt;&amp;gt;</description>
      <pubDate>Tue, 16 Mar 2021 21:04:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-vertical-border-for-headers-between-two-across/m-p/726914#M225962</guid>
      <dc:creator>RJB_NZ</dc:creator>
      <dc:date>2021-03-16T21:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report vertical border for headers between two across groups (ods excel)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-vertical-border-for-headers-between-two-across/m-p/726916#M225964</link>
      <description>Sorry, that's assuming that you have access to sashelp.shoes</description>
      <pubDate>Tue, 16 Mar 2021 21:09:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-vertical-border-for-headers-between-two-across/m-p/726916#M225964</guid>
      <dc:creator>RJB_NZ</dc:creator>
      <dc:date>2021-03-16T21:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report vertical border for headers between two across groups (ods excel)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-vertical-border-for-headers-between-two-across/m-p/729918#M227221</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Andy from&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SAS Technical Support found an answer for this: adding 'JAN21' to the $header_rborder format.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Yes a character value format for a date (numeric) field that been turned into a header...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let TempPath = %sysfunc(getoption(work)); * ref to Work library;
%put &amp;amp;=TempPath;

	data altered_shoes;
		set sashelp.shoes;
		where product in ('Sandal' 'Slipper' 'Sport Shoe');
		if product = 'Sandal' then month = '31Jan2020'd;
		if product = 'Slipper' then month = '31Dec2020'd;
		if product = 'Sport Shoe' then month = '31Jan2021'd;
	run;

	proc format;
		value $MergeAcross_Headers
			'Month Diff', 'Jan 21 - Dec 20', 'Year Diff', 'Jan 21 - Jan 20' = MERGEACROSS:2
		;
		value $DummyWhiteOut
			'Dummy Value' = lightgray
		;
		value $header_rborder
			'Products sold', 'Sales amount', 'JAN21' = solid
		;
	run;

ODS excel 
	file = "&amp;amp;TempPath./Shoes Test.xlsx"
	style= Listing
	options (	embedded_titles='OFF' 
				sheet_interval="none" 
				sheet_name='Shoes Tests' 
				gridlines ='off' 
				absolute_column_width='23, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12' 
				absolute_row_height='15.75' 
			);



	proc report data=altered_shoes
					style(header)=[tagattr=$MergeAcross_Headers. color=$DummyWhiteOut. borderrightstyle=$header_rborder.];
		format month MonYY. ;
		column ('Dummy Value'(''('Global Regions' Region)))
			   ('Products sold' month),stores 
			   ('Sales amount' month), sales 
			   ('Month Diff' ('' ('Jan 21 - Dec 20' Month_Diff)))
			   ('Year Diff' ('' ('Jan 21 - Jan 20' Year_Diff)))
				boarder_formater;
		define Region  		/ '' group order=internal;
		define month 		/ '' across order=internal;
		define stores  		/ '';
		define sales   		/ '';
		define Month_Diff 	/ computed format=dollar.2 ''
								   style(column)=[ tagattr='MERGEACROSS:2'];
		define Year_Diff 	/ computed format=dollar.2 ''
								   style(column)=[ tagattr='MERGEACROSS:2'];
		define boarder_formater / noprint;
		
		compute Year_Diff;
				Month_Diff = _c5_ - _c7_;
				Year_Diff = _c6_ - _c7_;
		endcomp;	
		compute boarder_formater;
		   		call define(4, "style/merge", "style=[borderrightstyle=solid]");
		   		call define(7, "style/merge", "style=[borderrightstyle=solid]");
		endcomp;
	run;

ods excel close;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now I just need to calculate the 'JAN21' label and put it into a macro variable so that my code survives month to month &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 01:17:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-vertical-border-for-headers-between-two-across/m-p/729918#M227221</guid>
      <dc:creator>RJB_NZ</dc:creator>
      <dc:date>2021-03-30T01:17:42Z</dc:date>
    </item>
  </channel>
</rss>

