HI, Voilà my proc report , I wonder why the datflag variable can be coloried and datflagN No.. something wrong here ?!
proc report data= data_dif nowd out=work.test02
style(header) = [ background = $col_header. font_size= 10pt ];
column STUDY NAMING_CONVENTION_CHANGE DTER DELIVERABLE_UNIT_CODE UNIT_AMOUNT Planned_delivery_date
STUDY_MILESTONES IRIS_COMMENT CRO_COMMENTS AGREEMENT_CRO_ON_ORDER EFFECTIVE_DELIVERY_DATE
DELIVERED_AMOUNT STATUS IRIS_ACCEPTATION KPI1_VOLUME KPI2_DELAY KPI3_QUALITY QUALITY_DETAILS
DATE_OF_INVOICE STADE_PGM1_PGM2 DELETED Record_Type datflag datflagn;
define STUDY / style(header) = [ background =lightblue font_size= 10pt ] ;
define NAMING_CONVENTION_CHANGE / style(header) = [ background =lightblue font_size= 10pt ] ;
define DTER / style(header) = [ background =lightblue font_size= 10pt ] ;
define DELIVERABLE_UNIT_CODE / style(header) = [ background =lightblue font_size= 10pt ] ;
define UNIT_AMOUNT / style(header) = [ background =lightblue font_size= 10pt ] ;
define Planned_delivery_date / style(header) = [ background =lightblue font_size= 10pt ] ;
define STUDY_MILESTONES / style(header) = [ background =lightblue font_size= 10pt ] ;
define IRIS_COMMENT / style(header) = [ background =lightblue font_size= 10pt ] ;
define CRO_COMMENTS / style(header) = [ background =lightgreen font_size= 10pt ] ;
define AGREEMENT_CRO_ON_ORDER / style(header) = [ background =lightgreen font_size= 10pt ] ;
define EFFECTIVE_DELIVERY_DATE / style(header) = [ background =lightgreen font_size= 10pt ] ;
define DELIVERED_AMOUNT / style(header) = [ background =lightgreen font_size= 10pt ] ;
define STATUS / style(header) = [ background =lightgreen font_size= 10pt ] ;
define IRIS_ACCEPTATION / style(header) = [ background =lightblue font_size= 10pt ] ;
define KPI1_VOLUME / style(header) = [ background =lightgreen font_size= 10pt ] ;
define KPI2_DELAY / style(header) = [ background =lightgreen font_size= 10pt ] ;
define KPI3_QUALITY / style(header) = [ background =lightblue font_size= 10pt ] ;
define QUALITY_DETAILS / style(header) = [ background =lightblue font_size= 10pt ] ;
define DATE_OF_INVOICE / style(header) = [ background =lightgreen font_size= 10pt ] ;
define STADE_PGM1_PGM2 / style(header) = [ background =lightgreen font_size= 10pt ] ;
define DELETED / style(header) = [ background =lightblue font_size= 10pt ] ;
define Record_Type / style(header) = [ background =red font_size= 10pt ] ;
compute Record_Type;
if Record_Type in ("Manuel" "M" ) then call define(_row_,"style","style={background=Lightred}") ;
if Record_Type in ("Automatique" "A") then call define(_row_,"style","style={background=Lightblue}") ;
endcomp;
compute CRO_COMMENTS;
call define(_COL_,"style","style={background=lightgreen}");
endcomp;
compute AGREEMENT_CRO_ON_ORDER;
call define(_COL_,"style","style={background=lightgreen}");
endcomp;
compute EFFECTIVE_DELIVERY_DATE;
call define(_COL_,"style","style={background=lightgreen}");
endcomp;
compute DELIVERED_AMOUNT;
call define(_COL_,"style","style={background=lightgreen}");
endcomp;
compute STATUS;
call define(_COL_,"style","style={background=lightgreen}");
endcomp;
compute KPI1_VOLUME;
call define(_COL_,"style","style={background=lightgreen}");
endcomp;
compute KPI2_DELAY;
call define(_COL_,"style","style={background=lightgreen}");
endcomp;
compute DATE_OF_INVOICE;
call define(_COL_,"style","style={background=lightgreen}");
endcomp;
compute STADE_PGM1_PGM2;
call define(_COL_,"style","style={background=lightgreen}");
endcomp;
compute datflagn;
if index(datflagn,'UNIT_AMOUNT') then call define(UNIT_AMOUNT,"style","style={background=red}");
if index(datflagn,'PLANNED_DELIVERY_DATE') then call define(PLANNED_DELIVERY_DATE,"style","style={background=red}");
endcomp;
compute datflag;
if index(datflag,'DTER') then call define("DTER","style","style={background=red}");
if index(datflag,'DELIVERABLE_UNIT_CODE') then call define("DELIVERABLE_UNIT_CODE","style","style={background=red}");
if index(datflag,'STUDY_MILESTONES') then call define("STUDY_MILESTONES","style","style={background=red}");
if index(datflag,'IRIS_COMMENTS') then call define("IRIS_COMMENTS","style","style={background=red}");
if index(datflag,'CRO_COMMENTS') then call define("CRO_COMMENTS","style","style={background=red}");
if index(datflag,'AGREEMENT_CRO_ON_ORDER') then call define("AGREEMENT_CRO_ON_ORDER","style","style={background=red}");
if index(datflag,'STATUS') then call define("STATUS","style","style={background=red}");
if index(datflag,'IRIS_ACCEPTATION') then call define("IRIS_ACCEPTATION","style","style={background=red}");
endcomp;
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.