BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
JaySwan
Calcite | Level 5

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

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

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

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

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;

JaySwan
Calcite | Level 5

Thank you Cynthia, worked like a charm.

I used the footnote text from above...

Thanks again, and GO Patriots!

J

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

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
  • 1461 views
  • 0 likes
  • 2 in conversation