Published on :
Configuration INTERNAL_CREATION

Report Configuration and Style Macros

This code is also available in: Deutsch Español Français
This program prepares the SAS© environment for report execution. It defines data and output paths (based on a root variable &folder_path), dynamically calculates current date and month, defines a standardized color palette, and creates the '%worksheet_title' macro using PROC ODSTEXT to format Excel sheet titles.
Data Analysis

Type : INTERNAL_CREATION


The script does not access any external data tables. It only initializes macro variables and defines style elements.

1 Code Block
GLOBAL STATEMENTS
Explanation :
Definition of macro variables containing relative paths for raw data, production, and final outputs.
Copied!
1%let data_path = &folder_path./
2DATA;
3%let production_path = &folder_path./production;
4%let outpath = &production_path./OUTPUT;
5 
2 Code Block
GLOBAL STATEMENTS
Explanation :
Dynamic calculation of current dates (Month/Year and full Date) via the %SYSFUNC function and storage in macro variables.
Copied!
1%let currMonthYear = %sysfunc(today(), YYMM.);
2%put &=currMonthYear;
3%let currDate = %sysfunc(today(), WEEKDATE.);
4%put &=currDate;
3 Code Block
GLOBAL STATEMENTS
Explanation :
Initialization of style constants: hexadecimal color codes and font sizes to standardize report appearance.
Copied!
1%let sasBlue = CX0766D1;
2/* ... autres définitions de couleurs ... */
3%let ws_title_text = 20pt;
4%let titleFmt = height=16pt justify=left color=&sasDarkBlue;
4 Code Block
PROC ODSTEXT
Explanation :
Definition of the '%worksheet_title' macro which uses the ODSTEXT procedure to insert a formatted title (color, size, cell merging) into the active ODS destination (e.g., Excel).
Copied!
1%macro worksheet_title(title_string);
2 PROC ODSTEXT;
3 p &title_string / style = [color = &sasDarkBlue
4 fontsize = &ws_title_text
5 tagattr = 'mergeacross:5'];
6 QUIT;
7%mend;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.