Data visualization with SAS programming

adding page just with the text to the ods pdf output

Reply
New Contributor
Posts: 4

adding page just with the text to the ods pdf output

[ Edited ]

My question is a follow-up to my previous question to the topic: https://communities.sas.com/t5/ODS-and-Base-Reporting/issues-with-pdf-output-using-sgplot/m-p/434142.

 

So far, the output had 2 pages with 6 graphs per each page. Now, I would like to add empty page at the beginning of the pdf document that would be ready to contain title and some text notes (and simple bookmark would be included). The added part to the previous code is signed by /**additional code - start**/, /**additional code - end**/, but it doesn´t work 100%. Thank you for any suggestion which way to go.

 

data out_i_a;
  set sashelp.retail;
run;

data out_ii_b;
  set sashelp.retail;
run;

data y;
  length saz tef x1 x2 $100;
  input saz $ tef $ x1 $ x2;
  datalines;
I A desc1 desc1a
II B desc2 desc2a
;
run;

%macro jed();

  proc sql;
    select count(*) into: pocet from y;
  quit;

  ods _all_ close;
  options /*papersize="ISO A4"*/
  orientation=portrait;
  ods pdf file="\\srv284\nt284g\PROJECTS\JJ\lapse_monitoring\lm201802\GRAFY\AA_BB_CC.pdf" /*style=bigger*/
  pdftoc=1;
  ods graphics / width=10cm height=8cm;

  /*additional code - start*/
  ods pdf bookmarkgen;
  title "TITEL-TEST";
  ods layout gridded columns=1;
  ods region;
  ODS PROCLABEL "desc desc";
  ods pdf text="text text text text";
  ods layout end;
  /**additional code - end**/

  /* overall title */
  %do i=1 %to &pocet;

    data _null_;
      set y (obs=&i);
      call symput("saz" ,strip(saz));
      call symput("tef" ,strip(tef));
      call symput("x1" ,strip(x1));
      call symput("x2" ,strip(x2));
    run;

    /* switch on bookmarks */
    ods pdf bookmarkgen;
    /* overall title before layout */
    title "TITLE - &saz. &tef.";
    ods layout gridded columns=2;
ods region;
  ODS PROCLABEL "&saz. &tef. &x1.";

  proc sgplot data=out_&saz._&tef. des="sugus";
    series x=date y=sales / legendlabel="sales";
    series x=date y=year/y2axis legendlabel="year";
    xaxis label="date";
    yaxis label="sales";
    y2axis label="year";
    TITLE "&saz. &tef. Y1 - #";
  run;
/* switch off bookmarks */
  ods pdf nobookmarkgen;
ods region;
  ODS PROCLABEL "&saz. &tef. &x1.";

  proc sgplot data=out_&saz._&tef.;
    series x=date y=sales / legendlabel="sales";
    series x=date y=year/y2axis legendlabel="year";
    xaxis label="date";
    yaxis label="sales";
    y2axis label="year";
    TITLE "&saz. &tef. Y1 - rate";
  run;

ods region;
  ODS PROCLABEL "&saz. &tef. &x1.";

  proc sgplot data=out_&saz._&tef.;
    series x=date y=sales / legendlabel="sales";
    series x=date y=year/y2axis legendlabel="year";
    xaxis label="date";
    yaxis label="sales";
    y2axis label="year";
    TITLE "&saz. &tef. Y1 - #";
  run;

ods region;
  ODS PROCLABEL "&saz. &tef. &x1.";

  proc sgplot data=out_&saz._&tef.;
    series x=date y=sales / legendlabel="sales";
    series x=date y=year/y2axis legendlabel="year";
    xaxis label="date";
    yaxis label="sales";
    y2axis label="year";
    TITLE "&saz. &tef. Y1 - rate";
  run;

ods region;
  ODS PROCLABEL "&saz. &tef. &x1.";

  proc sgplot data=out_&saz._&tef.;
    series x=date y=sales / legendlabel="sales";
    series x=date y=year/y2axis legendlabel="year";
    xaxis label="date";
    yaxis label="sales";
    y2axis label="year";
    TITLE "&saz. &tef. Y1 - #";
  run;

ods region;
  ODS PROCLABEL "&saz. &tef. &x1.";

  proc sgplot data=out_&saz._&tef.;
    series x=date y=sales / legendlabel="sales";
    series x=date y=year/y2axis legendlabel="year";
    xaxis label="date";
    yaxis label="sales";
    y2axis label="year";
    TITLE "&saz. &tef. Y1 - rate";
  run;
/* end layout at end of page */
ods layout end;
ods pdf startpage=now;
  %end;

  ods pdf close;
%mend;

%jed;

 

 

Ask a Question
Discussion stats
  • 0 replies
  • 196 views
  • 0 likes
  • 1 in conversation