BookmarkSubscribeRSS Feed
Nasser_DRMCP
Lapis Lazuli | Level 10

Capture empty line.PNG

Hello

 

by executing this code, 2 empty lines appears  in the header (in yellow in the screenshot). I would like to remove them.

thanks a lot for your help

kind regards

Nasser

ODS TAGSETS.EXCELXP FILE = "&xlsfile."  style=normal  ;

	/* 1er onglet : mois courant sans cumul */
	ODS TAGSETS.EXCELXP options ( skip_space='1,0,0,0,0'  sheet_name='mois courant sans cumul' ) ;
	PROC REPORT DATA = work.T7_MEASURES_M0 (where=(INDEX(Measure,'sans cumul'))) nowd ;
	column AXE_PRODUIT GENERATION measure periode_month_M0  , value ;
	define AXE_PRODUIT / group 'Produit' ;
		COMPUTE AXE_PRODUIT ;
		IF AXE_PRODUIT NE '' then hold_axe_produit = AXE_PRODUIT ;
		IF AXE_PRODUIT EQ '' then AXE_PRODUIT = hold_axe_produit ;
		ENDCOMP ;
	define GENERATION / group 'Génération' ; 
		COMPUTE GENERATION ;
		IF GENERATION NE '' then hold_GENERATION = GENERATION ;
		IF GENERATION EQ '' then GENERATION = hold_GENERATION ;
		ENDCOMP ;
	define measure /  group 'Indicateur' ;
	define periode_month_M0 / across '' ;
	define value / '' ;
		compute value ;
 		if INDEX(measure,'Mont') then do ;
 		call define(_COL_,'FORMAT','12.2') ;
 		end;
 		else call define(_COL_,'FORMAT','percent12.9') ;
 		endcomp ;
  	RUN ;
ODS TAGSETS.EXCELXP CLOSE ;
1 REPLY 1
Cynthia_sas
Diamond | Level 26

Hi:

Instead of this:
column AXE_PRODUIT GENERATION measure periode_month_M0,value ;

use one of these options:
Option 1) Change only column statement:
column AXE_PRODUIT GENERATION measure value,periode_month_M0 ;
or
Option 2) Change column statement to move header up on same level as values for periode_month_M0 and also, change define statements:
column ('Produit' AXE_PRODUIT) ('Generation' GENERATION) ('Indicateur' measure) periode_month_M0,value;
define produit / group ' ';
define generation / group ' ';
define measure / ' ';

 

Cynthia

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1352 views
  • 1 like
  • 2 in conversation