Help using Base SAS procedures

Proc Report Call Define

Reply
Regular Contributor
Posts: 173

Proc Report Call Define

Hello,

I am totally new at using proc report. I came across this code and I don't understand how this "CALL DEFINE" works:

COMPUTE DropOrderID;
IF SUBSTR(DropOrderID,4,2)='00'
THEN CALL DEFINE(_ROW_, "style", "STYLE=[BACKGROUND=#C4C9F4]");
ENDCOMP;



I know it prints a blue color for every new DropOrderID. But "CALL DEFINE" is not a SAS function, is it?
It is part of the proc report below.



ODS PDF STYLE=printer BOOKMARKLIST=HIDE FILE="&OUTPUT_DIR\POST_MOD_FULL_WATERFALL2.PDF";
ODS NOPROCTITLE;
TITLE FONT=COURIER HEIGHT=12PT J=CENTER "POST MOD CAMPAIGN &campaign_name.";
TITLE2 FONT=COURIER HEIGHT=10PT J=CENTER 'TMT WATERFALL';
PROC REPORT DATA=POST_MOD_FULL_WATERFALL HEADLINE CONTENTS='' NOWD;
COLUMN DropOrderID DropDescription Loans Balance Percent;
DEFINE DropOrderID / DISPLAY WIDTH=8 FORMAT=$8. ' Drop ID';
DEFINE DropDescription / DISPLAY WIDTH=120 FORMAT=$120. ' Drop Description';
DEFINE Loans / DISPLAY WIDTH=12 FORMAT=COMMA9. ' Count ';
DEFINE Balance / DISPLAY WIDTH=12 FORMAT=COMMA9. ' Balance ';
DEFINE Percent / DISPLAY WIDTH=12 FORMAT=PERCENT6.2 ' Percent ';
COMPUTE DropOrderID;
IF SUBSTR(DropOrderID,4,2)='00'
THEN CALL DEFINE(_ROW_, "style", "STYLE=[BACKGROUND=#C4C9F4]");
ENDCOMP;
RUN;
FOOTNOTE3 ;
ODS PDF CLOSE;
Valued Guide
Posts: 632

Re: Proc Report Call Define

CALL DEFINE is a routine specific to the COMPUTE block of PROC REPORT. As an executable function it allows the user to apply characteristics, in this case a style attribute, differentially. The first arg tells where to apply the attribute. In this case for the _ROW_.
Regular Contributor
Posts: 173

Re: Proc Report Call Define

Thank you for the information, ArtC! The code makes much more sense to me now. Thanks!
Ask a Question
Discussion stats
  • 2 replies
  • 143 views
  • 0 likes
  • 2 in conversation