BookmarkSubscribeRSS Feed
huntlake
Calcite | Level 5

Hello,

 

I'm looking for a way to remove the column name = from the Bookmark Title on an ODS PDF.  I am a fairly new SAS user - I've pieced this code together from multiple sources/articles.  

 

I'm also having an issue with the Notes field - there are several that are Null.  Because of the way I have the groups, if Notes = Null then it is leaving that obs out of the report.  I tricked it by adding a "_" if it's missing.  Is there a better way?  

Thank you in advance to any suggestions!  

 

Here is my code:  

 

ods escapechar = "^";

 

%macro printdcm(area=);

ods proclabel 'Management Overview';

proc report data=work.MANAGEMENT_REPORT (where=(m_area=&area)) split=' ' noheader contents=&area; /*split option is used to allow columns to wrap text*/

                title "Management Report";

                column cm_area provider_name plans_description src_group customer_header customer_notes service_date

                ps_pid tp_pid planned_services_description surface number_units status_desc;

                define cm_area / group noprint;

                define provider_name / group noprint;

                define plans_description / group noprint;

                define src_group / group noprint;

                define customer_header / group noprint;

                define customer_notes / order noprint;

                define service_date / order style(column)=[just=l cellwidth=1.5in];

                define ps_pid / order style(column)=[just=r cellwidth=.5in];

                define tp_pid / order style(column)=[just=r cellwidth=.5in];

                define planned_services_description / "Planned Services" style(column)=[just=l cellwidth=2.5in];

                define surface / "Surface" style(column)=[just=l cellwidth=1in];

                define number_units / "Units" right style(column)=[just=l cellwidth=.25in];

                break before provider_name / page;

                compute before _page_ / style=[backgroundcolor=bgr];

                                line "^S={font_weight=bold font_size=11 pt just=left}Management Area: " cm_area $20.;

                                line "^S={font_weight=bold font_size=13 pt just=left}" provider_name $20.;

                                line " ";

                endcomp;          

                compute before plans_description / style=[just=left];

                                line "^S={font_weight=bold font_size=11 pt}" plans_description $30.;

                endcomp;

                compute before src_group / style=[just=center backgroundcolor=gainsboro];

                                line "^S={font_size=11 pt font_weight=bold}" src_group $20.;

                endcomp;

                compute before customer_header / style=[just=left backgroundcolor=bibg];

                                line "^S={font_size=10 pt}" customer_header $200.;

                endcomp;

                compute after customer_notes / style=[just=left];

                                line "^S={font_weight=bold font_size=10 pt}Notes: ^S={}" customer_notes $500.;

                                line " ";

                endcomp;          

run;

%mend printdcm;

 

options orientation=landscape colorprinting=yes;

 

/* Cycle through PROC REPORT procedure twice - once for each

   Case Management Area to create separate nodes for the TOC */

 

ods document name=work.dcm(write);

                %printdcm (area='Area 1');

                %printdcm (area='Area 2');

ods document close;

 

/* Display the details of the ods document */

 

ods listing;

proc document name=work.dcm;  

                list / details levels=all;

run;

ods listing close;

 

/* Restructure the TOC by moving both 2nd nodes to a new node 1 */

 

proc document name=work.dcm_restructure(write);

                make Area1;

                make Area2;

run;

 

                dir ^^;

                dir Area1;

                dir;

                copy \work.dcm\Report#1\Report#1\Report#1 to ^;

                dir ^^;

                dir Area2;

                dir;

                copy \work.dcm\Report#2\Report#1\Report#1 to ^;

run;

quit;

               

/* Generate PDF */

 

ods pdf file='Management.pdf' style=DCM;  

proc document name=work.dcm_restructure;

                replay;

run;

quit;

 

ods pdf close;

 

/* Display the details of the ods document */

 

ods listing;

proc document name=work.dcm_restructure;  

                list / details levels=all;

run;

ods listing close;

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

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 0 replies
  • 755 views
  • 0 likes
  • 1 in conversation