BookmarkSubscribeRSS Feed
PPLee
Fluorite | Level 6

Hi!

 

I have encountered errors again while running the following codes.  Can you please help me look into the errors (as displayed below), and give me some advice? 

 

Thank you.

 

Best regards

Piea Peng

 

************************************************************

My codes:

************************************************************

 

ods listing close;
ods html body='/folders/myfolders/temp.htm';
ods trace output;

 

data temp;
tday=current_date();
call symput('asof', trim(left(put(tday,worddate20.))));
call symput('file', trim(left(put(tday,MMYYN6.))));
curhref="<L1></LI><A href=main.htm>"||put(tday,worddate20.)||"</A>";
keep curhref tday;
run;

 

title1 "<H2> Data Dictionary </H2>";

 

proc template;
define style styles.main;
parent=styles.default;
style Table from Output / cellspacing=0 frame=void RULES=NONE;

 

/* Blend headers */
style Header from HeadersAndFooters / background=color_list('bgA');

/*add a logo at the beginning of HTML */
style Body from Document / prehtml="<table width=100%> <td align=right>";
end;
run;

 

proc report data=temp
style(REPORT)={background=#002288}
style(HEADER)={foreground=#002288};
column curhref;
define curhref / order "Most Current Version";
run;

 

ods html close;
ods listing;

 

************************************************************

My errors:

************************************************************

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
NOTE: ODS statements in the SAS Studio environment may disable some output features.
73
74 ods listing close;
_______
1
75 ods html file='/folders/myfolders/temp.htm';
___ __
22 22
202 202
WARNING 1-322: Assuming the symbol CLOSE was misspelled as close;.
 
ERROR 22-322: Syntax error, expecting one of the following: ;, BODY, CLOSE, DATAPANEL, DPI, FILE, GPATH, IMAGE_DPI, PACKAGE, SGE,
STYLE.
 
ERROR 202-322: The option or parameter is not recognized and will be ignored.
 
76 ods trace output;
77 run;
78
79 data temp;
80 tday=current_date();
_
22
200
81 call symput('asof', trim(left(put(tday,worddate20.))));
______
22
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, /, ;, _DATA_, _LAST_, _NULL_.
 
ERROR 200-322: The symbol is not recognized and will be ignored.
 
ERROR 22-7: Invalid option name 'asof'.
 
82 call symput('file', trim(left(put(tday,MMYYN6.))));
______
22
83 curhref="<LI></LI><A href=main.htm>"|| put(tday,worddate20.)||"</A>";
_
22
76
ERROR 22-7: Invalid option name 'file'.
 
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, /, ;, _DATA_, _LAST_, _NULL_.
 
ERROR 76-322: Syntax error, statement will be ignored.
 
84 keep curhref tday;
85 run;
86
87 title1 "<H2> Data Dictionary </H2>";
88
89 proc template;
90 define style styles.main;
91 parent=styles.default;
92 style Table from Output /
93 cellspacing=0 frame=void RULES=NONE;
94
95 /* Blend headers */
96 style Header from HeadersAndFooters /
97 background=color_list('bgA');
98
99 /*add a logo at the beginning of HTML */
100 style Body from Document /
101 prehtml="<table width=100%> <td align=right>";
102 end;
103 run;
104
105 proc report data=temp
106 style(REPORT)={background=#002288}
107 style(HEADER)={foreground=#002288};
108 column curhref;
109 define curhref / order "Most Current Version";
110 run;
111
112 ods html close;
113 ods listing;
114 run;
115
116
117 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
129
 

 

1 REPLY 1
Reeza
Super User

Do you understand the code you're running here? There are few things that don't make sense and I'm wondering if you adapted your code for the forum and forgot to fix some things or are a new SAS user.

 

1. ODS LISTING is primarily on Base SAS and turning it off in SAS UE seems weird. If you've set it as your default setting you would have a path I assume but it shouldn't be at the top of the program or at the end. And even if you're using it you'll need to give it a path. 

 

2. ODS TRACE has two values that usually follow it, ON/OFF, not OUTPUT. I can't find OUTPUT in the documentation so not sure what you're intending there or if it's needed. https://documentation.sas.com/?docsetId=odsproc&docsetTarget=p1fpt3uuow90o3n155hs7bp1mo7f.htm&docset...

 

3. Current_date() is not a valid SAS function. Valid functions are here, you can find what you need there, most likely the date function. https://documentation.sas.com/?docsetId=lefunctionsref&docsetTarget=n01f5qrjoh9h4hn1olbdpb5pr2td.htm...

 


@PPLee wrote:

Hi!

 

I have encountered errors again while running the following codes.  Can you please help me look into the errors (as displayed below), and give me some advice? 

 

Thank you.

 

Best regards

Piea Peng

 

************************************************************

My codes:

************************************************************

 

ods listing close;
ods html body='/folders/myfolders/temp.htm';
ods trace output;

 

data temp;
tday=current_date();
call symput('asof', trim(left(put(tday,worddate20.))));
call symput('file', trim(left(put(tday,MMYYN6.))));
curhref="<L1></LI><A href=main.htm>"||put(tday,worddate20.)||"</A>";
keep curhref tday;
run;

 

title1 "<H2> Data Dictionary </H2>";

 

proc template;
define style styles.main;
parent=styles.default;
style Table from Output / cellspacing=0 frame=void RULES=NONE;

 

/* Blend headers */
style Header from HeadersAndFooters / background=color_list('bgA');

/*add a logo at the beginning of HTML */
style Body from Document / prehtml="<table width=100%> <td align=right>";
end;
run;

 

proc report data=temp
style(REPORT)={background=#002288}
style(HEADER)={foreground=#002288};
column curhref;
define curhref / order "Most Current Version";
run;

 

ods html close;
ods listing;

 

************************************************************

My errors:

************************************************************

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
NOTE: ODS statements in the SAS Studio environment may disable some output features.
73
74 ods listing close;
_______
1
75 ods html file='/folders/myfolders/temp.htm';
___ __
22 22
202 202
WARNING 1-322: Assuming the symbol CLOSE was misspelled as close;.
 
ERROR 22-322: Syntax error, expecting one of the following: ;, BODY, CLOSE, DATAPANEL, DPI, FILE, GPATH, IMAGE_DPI, PACKAGE, SGE,
STYLE.
 
ERROR 202-322: The option or parameter is not recognized and will be ignored.
 
76 ods trace output;
77 run;
78
79 data temp;
80 tday=current_date();
_
22
200
81 call symput('asof', trim(left(put(tday,worddate20.))));
______
22
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, /, ;, _DATA_, _LAST_, _NULL_.
 
ERROR 200-322: The symbol is not recognized and will be ignored.
 
ERROR 22-7: Invalid option name 'asof'.
 
82 call symput('file', trim(left(put(tday,MMYYN6.))));
______
22
83 curhref="<LI></LI><A href=main.htm>"|| put(tday,worddate20.)||"</A>";
_
22
76
ERROR 22-7: Invalid option name 'file'.
 
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, /, ;, _DATA_, _LAST_, _NULL_.
 
ERROR 76-322: Syntax error, statement will be ignored.
 
84 keep curhref tday;
85 run;
86
87 title1 "<H2> Data Dictionary </H2>";
88
89 proc template;
90 define style styles.main;
91 parent=styles.default;
92 style Table from Output /
93 cellspacing=0 frame=void RULES=NONE;
94
95 /* Blend headers */
96 style Header from HeadersAndFooters /
97 background=color_list('bgA');
98
99 /*add a logo at the beginning of HTML */
100 style Body from Document /
101 prehtml="<table width=100%> <td align=right>";
102 end;
103 run;
104
105 proc report data=temp
106 style(REPORT)={background=#002288}
107 style(HEADER)={foreground=#002288};
108 column curhref;
109 define curhref / order "Most Current Version";
110 run;
111
112 ods html close;
113 ods listing;
114 run;
115
116
117 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
129
 

 


 

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1215 views
  • 0 likes
  • 2 in conversation