BookmarkSubscribeRSS Feed
KevinC_
Fluorite | Level 6
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;
2 REPLIES 2
ArtC
Rhodochrosite | Level 12
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_.
KevinC_
Fluorite | Level 6
Thank you for the information, ArtC! The code makes much more sense to me now. Thanks!

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

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2 replies
  • 1326 views
  • 0 likes
  • 2 in conversation