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!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 941 views
  • 0 likes
  • 2 in conversation