Hi!
I have encountered errors while running the following codes, the errors of which varied in each run. Can you please help me look into the errors (as displayed below), and give me some advice?
Thank you.
Best regards
Piea Peng.
(Please note: I am using SAS University Edition and SAS 9.4)
******************************************************************************************
My codes:
******************************************************************************************
ods html body="C:/Users/pplee/Documents/SASUniversityEdition_1/myfolders_1/temp.htm";
data temp;
tday=current_date();
call symput('asof', trim(left(put(tday,worddate20.))));
call symput('file', trim(left(put(tday,MMYYN6.))));
curhref="<LI> </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;
style Header from HeadersAndFooters / background=color_list("bgA");
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;
%macro rawvar;
ods html body="/folders/myfolders_1/&rawvar..html";
proc print noobs data=WORK.IMPORT(where=(rawvar="&rawvar"));
title "Report for rawvar &rawvar";
run;
ods html close;
%mend;
proc sort data=WORK.IMPORT out=newdsn nodupkey;
by rawvar;
run;
data _null_ ;
set newdsn;
by rawvar;
call execute("%create("||rawvar||")");
run;
ods html body="/folders/myfolders_1/main.htm";
proc report data=WORK.IMPORT nowd;
column Module Nature rawvar;
define Module / group "Module" width=80 order=internal;
define Nature /group "Nature" width=11;
define rawvar /group width=80 ;
compute rawvar ;
href=trim(rawvar)||".html";
call define(_col_, "URLP", href);
endcomp;
title1 "Data Dictionary";
title2 "By Module and Nature";
title3 height=2 "Date As of &asof";
run;
ods html close;
ods html close;
ods html;
ods pdf;
******************************************************************************************
One of the errors I had is as follows:
******************************************************************************************
Hi:
I am not sure of your entire issue, but one of your issues is probably THIS:
ods html body="C:/Users/pplee/Documents/SASUniversityEdition_1/myfolders_1/temp.htm";
OR THIS
ods html body="/folders/myfolders_1/main.htm";
When you use SAS University Edition you must write to your shared folder location. You were instructed to define that location as
/folders/myfolders -- not /folders/myfolders_1
You also cannot write to a C: drive location when you use SAS University Edition in a Virtual Machine. If you have any doubt about the correct path, please right click on your MyFolders top node in the Server Files and Folders navigation pane on the left. Then select Properties after the right click. In the Location area of the Properties window, you will see the correct shared folder location, as it is known to SAS University Edition.
Hope this helps,
Cynthia
Hi Cynthia
Thank you very much for your prompt reply. I agree with your advice.
Best regards
Piea Peng
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.