The SAS Output Delivery System and reporting techniques

Dcoument's marging is inconsistent

Reply
Contributor
Posts: 33

Dcoument's marging is inconsistent

Hi,

Once in a while I got my reports completly wrong. Everythings is "pushed" to the left ( as if I had set a leftmargin).

Other times the document prints properly. Where could my problem be.

Regards, Rachid
*****************************************************************************************************************************************************************************************************
/*----------------------------------------------------------------------------------------------*/
/* CREATED IN January 2010 - by Russell Almeida Ergogroup & Rachid Amroun - Ergogroup */
/* */
/* Øvrige rapporter nr 7 Fordelingsliste for uadressert post (pr.rute) */
/* Dette er en rapport som skal støtte budet med å gi oversikt over antall kasser for */
/* personer som skal kunne motta reklame eller gratisavis pr. rute for en enhet (dvs. de har */
/* ikke reservert seg). Rapporten skal også inneholde totalt antall kasser som finnes på */
/* ruten og antall virksomheter som kan motta virksomhetsreklame. I tillegg skal det nederst */
/* summeres på tvers av alle ruter slik at man får totaltall for enheten. Det er ikke krav */
/* om stående A4 format på denne rapporten hvis det er behov for flere felter i bredden. */
/*----------------------------------------------------------------------------------------------*/


options nobyline nonumber linesize=100 pagesize=60 nocenter nodate;
options orientation=portrait;
options papersize=A4;
options leftmargin=0;
options rightmargin=0;

ODS _all_ close;

data _null_;
call symput('Org_Unit_Id',trim(put(&Org_Unit_Id.,best32.)));
run;

/*------------------------------------------------------------------------------*/
/* */
/* Calculate the sysdate value in the format required and store it in the */
/* in the macro variable to be used */
/* The ODS _ALL_ CLOSE statement closes all open ODS output destinations */
/* title => how many titles are in the document */
/* Justify => place in document / left-center-right) font, font height */
/* "variables are included replaced "by"(see desc. in next box below */
/* "VAL" => In wich order the variable has been placed. */
/*------------------------------------------------------------------------------*/
data _null_;
call symput('_sysdate',put(input("&sysdate.",date7.),ddmmyyp10.));
run;

ODS _ALL_ CLOSE;

ods pdf file="RD036.pdf" notoc style = printer;

ods escapechar ='~';

title1
justify = c font=Helvetica height=9pt bold '#ByVal1' ;

title2
justify = l font=arial height=8pt '#ByVal2 '
justify = r font=arial height=8pt "Utskriftsdato: &_sysdate. kl &systime. side ~{thispage} av ~{lastpage} ";

title3;

title4
justify = l font=arial height=8pt '#byval3';

title5
justify = l font=arial height=8pt 'Enhet: #byval4';

title6 '_____________________________________________________________________________________';


footnote1 '_____________________________________________________________________________________';

footnote2
justify = l font=arial height=6pt 'L = Leiligheter';

footnote3
justify = l font=arial height=6pt 'ER= Eneboliger og rekkehus';

footnote4
justify = l font=arial height=6pt 'V = Virksomheter';

footnote5;

footnote6
justify = l font=arial height=6pt '* Reservasjon mot reklame er fratrukket';

footnote7
justify = l font=arial height=6pt '** reservasjon mot gratisavis er fratrukket';

/*----------------------------------------------------------------------------------------------*/
/* proc report data => Specify the report definition to use */
/* Spacing => Specify the number of blank characters between columns */
/* Wrap => Display one value from each column of the report, on consecutive */
/* Split => lines if necessary, before displaying another value from the first column */
/* Specify the split character */
/* Style => Define how the text, background, cellspace, borders */
/* define => Reports is fetch in the order showed below */
/* - grouping + print or not. */
/* style - font - center left or right and flow "after" is removing extra spaces */
/* page breaking after the last column. */
/* BY => The sort is done in order and will be called up as a variable */
/* column => which columns to display in the report */
/* group => consolidates into one row all of the observations from the data set that */
/* have a unique combination of the formatted values for all GROUP variables */
/* no print=> display or not data */
/* define + group => Define the item, which must be a data set variable, as a group variable */
/* define+flow => Wrap the value of a character variable in its column */
/* define+left => Left-justify the formatted values of the report item within the column */
/* width and left-justify the column headers over the values */
/* run => Runs the proc report data " VL0608_103R_Party_Postbox */
/* ODS _ALL_ CLOSE => Closes all open ODS output destinations. */
/*----------------------------------------------------------------------------------------------*/

proc report data = VL0608_470R_Distribution_Lst_UAP(where = (org_unit_id eq &Org_Unit_Id. and org_unit_id ne .))
nowd
spacing = 30
wrap ls=100
split='~'
style(header)={background=white}
style(report)={rules=none frame=void cellspacing=0 borderwidth=0}
style(summary)={background=grayff} split='~';

BY Report_name Report_ID Org_unit_Nm Org_unit_id;
column
Report_ID
Report_name
Org_unit_Nm
Org_unit_id

Route_Number_Txt
Route_nm

SUM_L
SUM_ER
SUM_L_ER_res_GA
Mailbox_V_All_Cnt
SUM_L_ER_res_RKL
Sum_L_ER
SUM_L_ER_V_res_GA
RES_RKL_L_ER
RES_GA_L_ER
Reservation_RKL_V_Cnt;

define Report_ID/group noprint;
define Report_name/group noprint;
define Org_unit_Nm/group noprint;
define Org_unit_id/group noprint;

define Route_Number_Txt/display left 'RUTE'
style(column)=[cellwidth=50pt font=(Arial, 6pt) just = left]
style(header)= [font_weight=bold font=(Arial, 6pt) just = left];

define Route_nm/left flow 'RUTEBESKRIVELSE' spacing = 5
style(column)=[cellwidth=120pt font=(Arial, 6pt) just = left]
style(header)= [font_weight=bold font=(Arial, 6pt) just = left] flow;

define SUM_L/analysis sum right 'L*' spacing = 5
style(column)=[cellwidth=30pt font=(Arial, 6pt) just = right]
style(header)= [font_weight=bold font=(Arial, 6pt) just = right];

define SUM_ER/right 'ER*'
style(column)=[cellwidth=30pt font=(Arial, 6pt) just = right]
style(header)= [font_weight=bold font=(Arial, 6pt) just = right];

define SUM_L_ER_res_GA/right 'GA**'
style(column)=[cellwidth=30pt font=(Arial, 6pt) just = right]
style(header)= [font_weight=bold font=(Arial, 6pt) just = right];

define Mailbox_V_All_Cnt/right 'V*'
style(column)=[cellwidth=30pt font=(Arial, 6pt) just = right]
style(header)= [font_weight=bold font=(Arial, 6pt) just = right];

define SUM_L_ER_res_RKL/right 'SUM L+ER*'
style(column)=[cellwidth=50pt font=(Arial, 6pt) just = right]
style(header)= [font_weight=bold font=(Arial, 6pt) just = right];

define Sum_L_ER/right 'SUM L+ER~(inkl Res)'
style(column)=[cellwidth=50pt font=(Arial, 6pt) just = right]
style(header)= [font_weight=bold font=(Arial, 6pt) just = right];

define SUM_L_ER_V_res_GA/right 'SUM L+ER+V~(inkl Res)'
style(column)=[cellwidth=50pt font=(Arial, 6pt) just = right]
style(header)= [font_weight=bold font=(Arial, 6pt) just = right];

define RES_GA_L_ER/right 'RES GA'
style(column)=[cellwidth=40pt font=(Arial, 6pt) just = right]
style(header)= [font_weight=bold font=(Arial, 6pt) just = right];

define RES_RKL_L_ER/right 'RES R'
style(column)=[cellwidth=40pt font=(Arial, 6pt) just = right]
style(header)= [font_weight=bold font=(Arial, 6pt) just = right];

DEFINE Reservation_RKL_V_Cnt/RIGHT 'Res V'
style(column)=[cellwidth=40pt font=(Arial, 6pt) just = right]
style(header)= [font_weight=bold font=(Arial, 6pt) just = right];


break after Org_unit_id/ol summarize skip style = [font_weight=bold font=(Arial, 6pt) just = right CELLHEIGHT = 10] page ;

compute after Org_unit_id/ style = [font_weight=bold font=(Arial, 6pt) just = left];
Route_Number_Txt = 'SUM ANT' ;
str = repeat('_',164);
line @0 str $164.;

endcomp;

run;

ODS _all_ close;
SAS Super FREQ
Posts: 8,868

Re: Dcoument's marging is inconsistent

Posted in reply to RussellAlmeida
Hi:
There are many PROC REPORT options, such as FLOW, SPACING, HEADLINE, HEADSKIP, DOL, DUL, WIDTH, PANELS, OL, UL, WRAP etc that are LISTING only options. These options are ignored by ODS destinations, such as the PDF, RTF and HTML destinations.

It is not entirely clear to me why your left margin is "off" -- with PDF, the SYSPRINT options or SAS Universal Printing options can sometimes have an impact on PDF output. Especially if you set your margins to 0 in the system options, I'm not sure, exactly, where PDF then looks for a margin setting. PDF knows that printed documents have some kind of physical margin -- so I believe that PDF will need to set some default when you have your system option set to 0, because PDF "knows" that it is intended to be printed.

Also, writing lines of underscores (such as you're doing for the title and the footnote and in the LINE statement) may not look in PDF the same as it looks in LISTING.

For help with your centering issue, you may find more help by opening a track with Tech Support.

cynthia
Contributor
Posts: 33

Re: Dcoument's marging is inconsistent

Posted in reply to Cynthia_sas
Cynthia,

Thanks a lot, I will.

Regards, Rachid
Contributor
Posts: 33

Re: Dcoument's marging is inconsistent

Posted in reply to RussellAlmeida
Hi,

I added _odsstyle=printer. In my stored Process and since then I havent seen the error again.

Lets hope it was it...

Regards

RAMR
Ask a Question
Discussion stats
  • 3 replies
  • 180 views
  • 0 likes
  • 2 in conversation