<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Is there a way to dynamically assign an html fileref? in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-dynamically-assign-an-html-fileref/m-p/142729#M11282</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;
data have;
&amp;nbsp; input branch team customer;
&amp;nbsp; cards;
1 1 1
1 1 2
1 2 3
2 1 1
2 1 2
2 2 1
;
run;
proc sort data=have;
&amp;nbsp; by branch team;
run;

%let root=c:\art ;
data _null_;
 set have;
 by&amp;nbsp; branch team;
 if _n_ eq 1 then call execute('options noxwait;');
 if first.team then do;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute(cats("x 'mkdir &amp;amp;root\",branch,"\",team,"\';"));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute(catt("proc export data=have(where=(branch=",branch," and team=",team,")) outfile='&amp;amp;root\",branch,"\",team,"\",team,".txt' dbms=TAB replace;run ;"));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute(catt("ods listing close;ods html file='&amp;amp;root\",branch,"\",team,"\",team,".html' style=sasweb; proc print noobs data=have(where=(branch=",branch," and team=",team,"));run;ods listing ;ods html close;"));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;

run;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: xia keshan Find a little problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 03 May 2014 04:44:08 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2014-05-03T04:44:08Z</dc:date>
    <item>
      <title>Is there a way to dynamically assign an html fileref?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-dynamically-assign-an-html-fileref/m-p/142723#M11276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the following example, which doesn't work, I am breaking a dataset into separate files within separate directories.&amp;nbsp; The directories get created like I want them to and, if I remove the ods related lines, all of the text files get created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What would I have to change/add to get the ods part to work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input branch team customer;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;1 1 1&lt;/P&gt;&lt;P&gt;1 1 2&lt;/P&gt;&lt;P&gt;1 2 3&lt;/P&gt;&lt;P&gt;2 1 1&lt;/P&gt;&lt;P&gt;2 1 2&lt;/P&gt;&lt;P&gt;2 2 1&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by branch team;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let root=c:\art;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; retain filename htmlname;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by branch team;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if first.branch then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc = DCREATE(catx('_','Branch',branch),"&amp;amp;root.");&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if first.team then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc = DCREATE(catx('_','Team',team),catt("&amp;amp;root.\Branch_",branch));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; filename = catt("&amp;amp;root.\Branch_",branch,'\Team_',team,'\Team_',team,'.txt');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; htmlname=catt("&amp;amp;root.\Branch_",branch,'\Team_',team,'\Team_',team,'.html');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; filename hdummy htmlname;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ODS HTML BODY=hdummy;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; file dummy filevar=filename;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put branch team customer;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if last.team then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ods html close;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 19:26:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-dynamically-assign-an-html-fileref/m-p/142723#M11276</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-05-02T19:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to dynamically assign an html fileref?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-dynamically-assign-an-html-fileref/m-p/142724#M11277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are attempting to create a single HTML document that has references/links to the text files or displays the content of the text files?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 20:02:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-dynamically-assign-an-html-fileref/m-p/142724#M11277</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-05-02T20:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to dynamically assign an html fileref?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-dynamically-assign-an-html-fileref/m-p/142725#M11278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to create 4 html files that are basically the same as the 4 txt files that are produced by the code, and in the same four directories.&amp;nbsp; Thus, in answer to your question, the content.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 20:06:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-dynamically-assign-an-html-fileref/m-p/142725#M11278</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-05-02T20:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to dynamically assign an html fileref?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-dynamically-assign-an-html-fileref/m-p/142726#M11279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was thinking File Print ODS&amp;nbsp; with Put _ods_ might help but it looks like the fileref has to be set outside of the data step writing the output. The 9.2 documention says explicitly not to use the filevar option which I though might be a way to get there.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 20:54:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-dynamically-assign-an-html-fileref/m-p/142726#M11279</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-05-02T20:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to dynamically assign an html fileref?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-dynamically-assign-an-html-fileref/m-p/142727#M11280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following creates blank html files.&amp;nbsp; Anyone know how to correct the code so that the html files include the same data as the txt files?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input branch team customer;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;1 1 1&lt;/P&gt;&lt;P&gt;1 1 2&lt;/P&gt;&lt;P&gt;1 2 3&lt;/P&gt;&lt;P&gt;2 1 1&lt;/P&gt;&lt;P&gt;2 1 2&lt;/P&gt;&lt;P&gt;2 2 1&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by branch team;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let root=c:\art;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; select distinct &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; catt("&amp;amp;root.\Branch_",branch,'\Team_',team,'\Team_',team,'.html')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; into :fnames separated by ","&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from have&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; order by branch,team&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;%let counter=&amp;amp;sqlobs.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename code2run temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; file code2run;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length fname $80;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put 'Select (counter);';&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=1 to &amp;amp;counter;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put 'when (' @;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put i @;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put ') do;';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put 'ODS HTML BODY="' @;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fname=scan("&amp;amp;fnames.",i,',');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put fname @;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put '";';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put 'end;';&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put 'otherwise;end;';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if _n_ eq 1 then counter=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; retain filename;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by branch team;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if first.branch then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc = DCREATE(catx('_','Branch',branch),"&amp;amp;root.");&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if first.team then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc = DCREATE(catx('_','Team',team),catt("&amp;amp;root.\Branch_",branch));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; filename = catt("&amp;amp;root.\Branch_",branch,'\Team_',team,'\Team_',team,'.txt');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %include code2run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; counter+1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; file print ods={variables=(branch&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; team&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customer)};&lt;/P&gt;&lt;P&gt;&amp;nbsp; put _ods_ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; file dummy filevar=filename;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put branch team customer;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if last.team then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ods html close;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 22:41:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-dynamically-assign-an-html-fileref/m-p/142727#M11280</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-05-02T22:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to dynamically assign an html fileref?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-dynamically-assign-an-html-fileref/m-p/142728#M11281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What do your txt files contain ? Have they already existed in those directories ? or these txt files are generated from other where ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Arthur.T,&lt;/P&gt;&lt;P&gt;You already have these txt files in different directories? and want generate html files for those txt files and populate them into the same directories separately ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 May 2014 03:09:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-dynamically-assign-an-html-fileref/m-p/142728#M11281</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-05-03T03:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to dynamically assign an html fileref?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-dynamically-assign-an-html-fileref/m-p/142729#M11282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;
data have;
&amp;nbsp; input branch team customer;
&amp;nbsp; cards;
1 1 1
1 1 2
1 2 3
2 1 1
2 1 2
2 2 1
;
run;
proc sort data=have;
&amp;nbsp; by branch team;
run;

%let root=c:\art ;
data _null_;
 set have;
 by&amp;nbsp; branch team;
 if _n_ eq 1 then call execute('options noxwait;');
 if first.team then do;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute(cats("x 'mkdir &amp;amp;root\",branch,"\",team,"\';"));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute(catt("proc export data=have(where=(branch=",branch," and team=",team,")) outfile='&amp;amp;root\",branch,"\",team,"\",team,".txt' dbms=TAB replace;run ;"));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute(catt("ods listing close;ods html file='&amp;amp;root\",branch,"\",team,"\",team,".html' style=sasweb; proc print noobs data=have(where=(branch=",branch," and team=",team,"));run;ods listing ;ods html close;"));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;

run;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: xia keshan Find a little problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 May 2014 04:44:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-dynamically-assign-an-html-fileref/m-p/142729#M11282</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-05-03T04:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to dynamically assign an html fileref?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-dynamically-assign-an-html-fileref/m-p/142730#M11283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No.&amp;nbsp; You will need to create 4 blocks of code to produce 4 distinct ODS outputs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODS LISTING FILE='BRANCH_1\TEAM_1.txt' ;&lt;/P&gt;&lt;P&gt;ODS HTML file='BRANCH_1\TEAM_1.html' ;&lt;/P&gt;&lt;P&gt;proc print ;&lt;/P&gt;&lt;P&gt;where branch=1 and team=1 ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;ODS LISTING CLOSE;&lt;/P&gt;&lt;P&gt;ODS HTML CLOSE;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 May 2014 14:06:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-dynamically-assign-an-html-fileref/m-p/142730#M11283</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-05-03T14:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to dynamically assign an html fileref?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-dynamically-assign-an-html-fileref/m-p/142731#M11284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="645292" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/"&gt;&lt;/A&gt;: Nice way to solve the problem.&amp;nbsp; Very much appreciated.&lt;/P&gt;&lt;P&gt;I had to change a couple of minor things to keep the file and path names in the desired naming format, and I kept the dcreate function as the code will be run on both EG and different operating systems:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input branch team customer;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;1 1 1&lt;/P&gt;&lt;P&gt;1 1 2&lt;/P&gt;&lt;P&gt;1 2 3&lt;/P&gt;&lt;P&gt;2 1 1&lt;/P&gt;&lt;P&gt;2 1 2&lt;/P&gt;&lt;P&gt;2 2 1&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by branch team;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let root=c:\art;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if _n_ eq 1 then call execute('options noxwait;');&lt;/P&gt;&lt;P&gt;&amp;nbsp; by branch team;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if first.branch then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc = DCREATE(catx('_','Branch',branch),"&amp;amp;root.");&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if first.team then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc = DCREATE(catx('_','Team',team),catt("&amp;amp;root.\Branch_",branch));&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute(catt("proc export data=have (where=(branch=",branch,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "and team=",team,")) outfile='&amp;amp;root.\Branch_",branch,"\Team_",team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "\Team_",team,".txt' dbms=TAB replace;run ;"));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute(catt("ods listing close;ods html file='&amp;amp;root.\Branch_",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; branch,"\Team_",team,"\Team_",team,".html' style=sasweb;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc print noobs data=have(where=(branch=",branch," and team=",team,"));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;ods listing ;ods html close;"));&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 May 2014 14:19:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-dynamically-assign-an-html-fileref/m-p/142731#M11284</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-05-03T14:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to dynamically assign an html fileref?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-dynamically-assign-an-html-fileref/m-p/142732#M11285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, but KSharp's use of call execute got around the need to hard code the individual blocks.&amp;nbsp; Since there are a large number of branch/team combinations his approach will definitely be a lot easier to maintain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Art&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 May 2014 14:31:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-dynamically-assign-an-html-fileref/m-p/142732#M11285</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-05-03T14:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to dynamically assign an html fileref?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-dynamically-assign-an-html-fileref/m-p/142733#M11286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Under the Arthur.T 's helpful idea, I got the final code like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data have;
&amp;nbsp; input branch team customer;
&amp;nbsp; cards;
1 1 1
1 1 2
1 2 3
2 1 1
2 1 2
2 2 1
;

proc sort data=have(keep=branch team) out=temp nodupkey;
&amp;nbsp; by branch team;
run;

%let root=c:\art;

data _null_;
&amp;nbsp; set temp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; rc = DCREATE(catx('_','Branch',branch),"&amp;amp;root.");
&amp;nbsp;&amp;nbsp;&amp;nbsp; rc = DCREATE(catx('_','Team',team),catt("&amp;amp;root.\Branch_",branch));
&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute(catt("proc export data=have (where=(branch=",branch,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "and team=",team,")) outfile='&amp;amp;root.\Branch_",branch,"\Team_",team,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "\Team_",team,".txt' dbms=TAB replace;run ;"));
&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute(catt("ods listing close;ods html file='&amp;amp;root.\Branch_",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; branch,"\Team_",team,"\Team_",team,".html' style=sasweb;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc print noobs data=have(where=(branch=",branch," and team=",team,"));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;ods listing ;ods html close;"));
run;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 May 2014 14:47:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-dynamically-assign-an-html-fileref/m-p/142733#M11286</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-05-03T14:47:05Z</dc:date>
    </item>
  </channel>
</rss>

