The SAS Output Delivery System and reporting techniques

ODS Proc Template Class BodyDate / Format Question

Accepted Solution Solved
Reply
Contributor
Posts: 24
Accepted Solution

ODS Proc Template Class BodyDate / Format Question

Looking to format the bodydate text below.

Ran the below and looks like I can not use a standard SAS Format in the class bodydate?
Where can I format it something like mm/dd/yyyy

(The below give me : 9:30 Tuesday, January 31, 2012)

Proc Template;

define style styles.pageno;

parent = styles.normal;

class bodydate / vjust=bottom just=left fontsize=10pt format mmddyy8. pretext="Report Date:";

class Pageno   / vjust=bottom just=left fontsize=10pt petext="Page Number:";

.......

TIA, Jay


Accepted Solutions
Solution
‎01-31-2012 11:07 AM
SAS Super FREQ
Posts: 8,868

Re: ODS Proc Template Class BodyDate / Format Question

Hi:

  If you look in the  doc, at the list of style attributes

http://support.sas.com/documentation/cdl/en/odsug/62755/HTML/default/viewer.htm#n19a4b40swc766n18qcz...

you will see that FORMAT is not a style attribute. What you are defining in your CLASS statement are the style attributes (like vjust= just= fontsize=) that belong to style elements (like bodydate and pageno).

You should be seeing this error message in your SAS log:

487 format mmddyy8.

------

22

202

ERROR 22-322: Syntax error, expecting one of the following: a quoted string, ;, ABSTRACT,

ACTIVELINKCOLOR, ASIS, ATTRPRIORITY, BACKGROUNDCOLOR, BACKGROUNDIMAGE,

BACKGROUNDPOSITION, BACKGROUNDREPEAT, BODYSCROLLBAR, BODYSIZE, BORDERBOTTOMCOLOR,

BORDERBOTTOMSTYLE, BORDERBOTTOMWIDTH, BORDERCOLLAPSE, BORDERCOLOR, BORDERCOLORDARK,

BORDERCOLORLIGHT, BORDERLEFTCOLOR, BORDERLEFTSTYLE, BORDERLEFTWIDTH,

BORDERRIGHTCOLOR, BORDERRIGHTSTYLE, BORDERRIGHTWIDTH, BORDERSPACING, BORDERSTYLE,

BORDERTOPCOLOR, BORDERTOPSTYLE, BORDERTOPWIDTH, BORDERWIDTH, CAPSTYLE, CELLPADDING,

CELLSPACING, CLASS, COLOR, CONNECT, CONTENTPOSITION, CONTENTSCROLLBAR, CONTENTSIZE,

CONTENTTYPE, CONTRASTCOLOR, CSSSTYLE, CSSTEXT, CURSOR, DATASKIN, DESCRIPTION,

DISPLAYOPTS, DOCTYPE, DROPSHADOW, ENDCOLOR, FILLPATTERN, FILLRULEWIDTH, FLYOVER,

FONT, FONTFAMILY, FONTSIZE, FONTSTYLE, FONTWEIGHT, FONTWIDTH, FRAME, FRAMEBORDER,

FRAMEBORDERWIDTH, FRAMESPACING, GRADIENTDIRECTION, HEIGHT, HREFTARGET, HTMLID,

HTMLSTYLE, IMAGESTYLE, JUST, KPISKIN, LINESTYLE, LINETHICKNESS, LINKCOLOR,

LISTENTRYANCHOR, LISTENTRYDBLSPACE, LISTSTYLEIMAGE, LISTSTYLEMARKER, LISTSTYLETYPE,

MARGIN, MARGINBOTTOM, MARGINLEFT, MARGINRIGHT, MARGINTOP, MARKERSIZE, MARKERSYMBOL,

MINOR, NEUTRALCOLOR, NOBREAKSPACE, OFFSET, OVERHANGFACTOR, PADDING, PADDINGBOTTOM,

PADDINGLEFT, PADDINGRIGHT, PADDINGTOP, PAGEBREAKHTML, POSTHTML, POSTIMAGE, POSTTEXT,

PREHTML, PREIMAGE, PRETEXT, PROTECTSPECIALCHARS, RULES, STARTCOLOR, TAGATTR,

TEXTALIGN, TEXTDECORATION, TEXTINDENT, TEXTJUSTIFY, THRESHOLD, TICKDISPLAY,

TRANSPARENCY, URL, VERTICALALIGN, VISITEDLINKCOLOR, VJUST, WATERMARK, WHITESPACE,

WIDTH.

ERROR 202-322: The option or parameter is not recognized and will be ignored.

488 pretext="Report Date:";

  Which also means your template will not be saved and you should also be seeing this warning (or one like it in your log -- if you were using ODS PDF, for example):

WARNING: Style STYLES.PAGENO not found; Printer style will be used instead.

  Usually, for paged destinations, I use TITLE and FOOTNOTE statements to accomplish special placement for the page number and/or date. That means I turn off the SAS options for date and numbering. And I usually want my page numbers to be at the bottom of the page, too.

  

  For example, if you look at this paper (see pages 14-15) http://support.sas.com/resources/papers/proceedings11/300-2011.pdf for information about inserting a page number. You can also use similar techniques to impact the date.

  The program below shows how to use the TITLE and FOOTNOTE statements for the page numbers and dates (without a changed style template). If you want to use the style template method of controlling information, then this Tech Support note worked for me, http://support.sas.com/kb/24/183.html (but not to format the date differently).

cynthia

options nodate nonumber;

ods escapechar='^';

   

ods pdf file='c:\temp\pageno.pdf' style=normal;

  title j=r f='Helvetica' h=10pt bold

        "Report Date: %SYSFUNC(TODAY(),Worddate.)";

  footnote h=10pt f='Helvetica' bold

           j=c 'Page No: ^{thispage}'

           j=r "Date: %sysfunc(today(),mmddyy10.)";

  proc print data=sashelp.class;

  run;

ods pdf close;

View solution in original post


All Replies
Solution
‎01-31-2012 11:07 AM
SAS Super FREQ
Posts: 8,868

Re: ODS Proc Template Class BodyDate / Format Question

Hi:

  If you look in the  doc, at the list of style attributes

http://support.sas.com/documentation/cdl/en/odsug/62755/HTML/default/viewer.htm#n19a4b40swc766n18qcz...

you will see that FORMAT is not a style attribute. What you are defining in your CLASS statement are the style attributes (like vjust= just= fontsize=) that belong to style elements (like bodydate and pageno).

You should be seeing this error message in your SAS log:

487 format mmddyy8.

------

22

202

ERROR 22-322: Syntax error, expecting one of the following: a quoted string, ;, ABSTRACT,

ACTIVELINKCOLOR, ASIS, ATTRPRIORITY, BACKGROUNDCOLOR, BACKGROUNDIMAGE,

BACKGROUNDPOSITION, BACKGROUNDREPEAT, BODYSCROLLBAR, BODYSIZE, BORDERBOTTOMCOLOR,

BORDERBOTTOMSTYLE, BORDERBOTTOMWIDTH, BORDERCOLLAPSE, BORDERCOLOR, BORDERCOLORDARK,

BORDERCOLORLIGHT, BORDERLEFTCOLOR, BORDERLEFTSTYLE, BORDERLEFTWIDTH,

BORDERRIGHTCOLOR, BORDERRIGHTSTYLE, BORDERRIGHTWIDTH, BORDERSPACING, BORDERSTYLE,

BORDERTOPCOLOR, BORDERTOPSTYLE, BORDERTOPWIDTH, BORDERWIDTH, CAPSTYLE, CELLPADDING,

CELLSPACING, CLASS, COLOR, CONNECT, CONTENTPOSITION, CONTENTSCROLLBAR, CONTENTSIZE,

CONTENTTYPE, CONTRASTCOLOR, CSSSTYLE, CSSTEXT, CURSOR, DATASKIN, DESCRIPTION,

DISPLAYOPTS, DOCTYPE, DROPSHADOW, ENDCOLOR, FILLPATTERN, FILLRULEWIDTH, FLYOVER,

FONT, FONTFAMILY, FONTSIZE, FONTSTYLE, FONTWEIGHT, FONTWIDTH, FRAME, FRAMEBORDER,

FRAMEBORDERWIDTH, FRAMESPACING, GRADIENTDIRECTION, HEIGHT, HREFTARGET, HTMLID,

HTMLSTYLE, IMAGESTYLE, JUST, KPISKIN, LINESTYLE, LINETHICKNESS, LINKCOLOR,

LISTENTRYANCHOR, LISTENTRYDBLSPACE, LISTSTYLEIMAGE, LISTSTYLEMARKER, LISTSTYLETYPE,

MARGIN, MARGINBOTTOM, MARGINLEFT, MARGINRIGHT, MARGINTOP, MARKERSIZE, MARKERSYMBOL,

MINOR, NEUTRALCOLOR, NOBREAKSPACE, OFFSET, OVERHANGFACTOR, PADDING, PADDINGBOTTOM,

PADDINGLEFT, PADDINGRIGHT, PADDINGTOP, PAGEBREAKHTML, POSTHTML, POSTIMAGE, POSTTEXT,

PREHTML, PREIMAGE, PRETEXT, PROTECTSPECIALCHARS, RULES, STARTCOLOR, TAGATTR,

TEXTALIGN, TEXTDECORATION, TEXTINDENT, TEXTJUSTIFY, THRESHOLD, TICKDISPLAY,

TRANSPARENCY, URL, VERTICALALIGN, VISITEDLINKCOLOR, VJUST, WATERMARK, WHITESPACE,

WIDTH.

ERROR 202-322: The option or parameter is not recognized and will be ignored.

488 pretext="Report Date:";

  Which also means your template will not be saved and you should also be seeing this warning (or one like it in your log -- if you were using ODS PDF, for example):

WARNING: Style STYLES.PAGENO not found; Printer style will be used instead.

  Usually, for paged destinations, I use TITLE and FOOTNOTE statements to accomplish special placement for the page number and/or date. That means I turn off the SAS options for date and numbering. And I usually want my page numbers to be at the bottom of the page, too.

  

  For example, if you look at this paper (see pages 14-15) http://support.sas.com/resources/papers/proceedings11/300-2011.pdf for information about inserting a page number. You can also use similar techniques to impact the date.

  The program below shows how to use the TITLE and FOOTNOTE statements for the page numbers and dates (without a changed style template). If you want to use the style template method of controlling information, then this Tech Support note worked for me, http://support.sas.com/kb/24/183.html (but not to format the date differently).

cynthia

options nodate nonumber;

ods escapechar='^';

   

ods pdf file='c:\temp\pageno.pdf' style=normal;

  title j=r f='Helvetica' h=10pt bold

        "Report Date: %SYSFUNC(TODAY(),Worddate.)";

  footnote h=10pt f='Helvetica' bold

           j=c 'Page No: ^{thispage}'

           j=r "Date: %sysfunc(today(),mmddyy10.)";

  proc print data=sashelp.class;

  run;

ods pdf close;

Contributor
Posts: 24

Re: ODS Proc Template Class BodyDate / Format Question

Posted in reply to Cynthia_sas

Thank you Cynthia, worked like a charm.

I used the footnote text from above...

Thanks again, and GO Patriots!

J

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

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