<?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 package cleanup for 9.1.3 in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/package-cleanup-for-9-1-3/m-p/66795#M7743</link>
    <description>hi,&lt;BR /&gt;
&lt;BR /&gt;
does anyone know the alternative to Package Cleanup Utility ( which is available  in SAS 9.2 version only) for SAS 9.1.3.&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/biwaag/63149/HTML/default/viewer.htm#a003311141.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/biwaag/63149/HTML/default/viewer.htm#a003311141.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
 There is a need to delete automatically most recent packages from publication channels.

Message was edited by: igor_protas</description>
    <pubDate>Fri, 28 Jan 2011 18:30:43 GMT</pubDate>
    <dc:creator>igor_protas</dc:creator>
    <dc:date>2011-01-28T18:30:43Z</dc:date>
    <item>
      <title>package cleanup for 9.1.3</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/package-cleanup-for-9-1-3/m-p/66795#M7743</link>
      <description>hi,&lt;BR /&gt;
&lt;BR /&gt;
does anyone know the alternative to Package Cleanup Utility ( which is available  in SAS 9.2 version only) for SAS 9.1.3.&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/biwaag/63149/HTML/default/viewer.htm#a003311141.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/biwaag/63149/HTML/default/viewer.htm#a003311141.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
 There is a need to delete automatically most recent packages from publication channels.

Message was edited by: igor_protas</description>
      <pubDate>Fri, 28 Jan 2011 18:30:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/package-cleanup-for-9-1-3/m-p/66795#M7743</guid>
      <dc:creator>igor_protas</dc:creator>
      <dc:date>2011-01-28T18:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: package cleanup for 9.1.3</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/package-cleanup-for-9-1-3/m-p/66796#M7744</link>
      <description>There is the solution. To delete packages from specifically named folders  on the channel using report dates and some delay interval (15 days) . For example, when report as of 28 jan is being published, then report as of 13 jan is being deleted&lt;BR /&gt;
&lt;BR /&gt;
Not the best algorythm, but it works&lt;BR /&gt;
&lt;BR /&gt;
ODS _ALL_ CLOSE;&lt;BR /&gt;
/* Diagnostic function */&lt;BR /&gt;
%macro chkrc(function);&lt;BR /&gt;
%if &amp;amp;rc = 0 %then %put "NOTE: &amp;amp;function succeeded.";&lt;BR /&gt;
%else %do;&lt;BR /&gt;
	%let msg = %sysfunc(sysmsg());&lt;BR /&gt;
	%put &amp;amp;function failed - &amp;amp;msg;&lt;BR /&gt;
%end;&lt;BR /&gt;
%mend;&lt;BR /&gt;
&lt;BR /&gt;
/* package preamble */&lt;BR /&gt;
%let package_options = ABSTRACT;&lt;BR /&gt;
%let pid = 0;&lt;BR /&gt;
%let rc = 0;&lt;BR /&gt;
%let namevalue=;&lt;BR /&gt;
%let abstract_text= %nrbquote(Published by Finance);&lt;BR /&gt;
%let description = %nrbquote(Corporate Loans &amp;amp;Repdate);&lt;BR /&gt;
%syscall package_begin(pid, description, namevalue, rc, package_options, abstract_text);&lt;BR /&gt;
%chkrc(Package Begin);&lt;BR /&gt;
&lt;BR /&gt;
filename b 'Corp_portf.html';&lt;BR /&gt;
&lt;BR /&gt;
%let description = %nrbquote(Corporate Loans &amp;amp;Repdate);&lt;BR /&gt;
%let namevalue = ;&lt;BR /&gt;
%let body = %nrbquote(fileref:b);&lt;BR /&gt;
%let frame=;&lt;BR /&gt;
%let contents=;&lt;BR /&gt;
%let pages=;&lt;BR /&gt;
%let burl=body0.html;&lt;BR /&gt;
%let curl=;&lt;BR /&gt;
%let furl=;&lt;BR /&gt;
%let purl=;&lt;BR /&gt;
%syscall insert_html(pid, body, burl, frame, furl, contents, curl, pages, purl, description, namevalue, rc);&lt;BR /&gt;
%chkrc(Insert Html);&lt;BR /&gt;
&lt;BR /&gt;
/* Publish the package */&lt;BR /&gt;
%let pubType = TO_SUBSCRIBERS;&lt;BR /&gt;
%let pub_properties = CHANNEL_STORE, COLLECTION_URL, METAUSER, METAPASS;&lt;BR /&gt;
%let channelURI = %nrbquote(SAS-OMA://10.1.50.53:8561/reposname=Foundation);&lt;BR /&gt;
&lt;BR /&gt;
%let channel = %nrbquote(FINANCE GENERAL);&lt;BR /&gt;
%let url = &lt;A href="http://SASMID:8300/sasdav/fgeneral/CP&amp;amp;Repdate" target="_blank"&gt;http://SASMID:8300/sasdav/fgeneral/CP&amp;amp;Repdate&lt;/A&gt;;&lt;BR /&gt;
%let muser = %nrbquote(Usrername);&lt;BR /&gt;
%let mpass = %nrbquote(********);&lt;BR /&gt;
%syscall package_publish(pid, pubType, rc, pub_properties, channelURI, url, muser, mpass, channel);&lt;BR /&gt;
%chkrc(package publish);&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc sql noprint;&lt;BR /&gt;
connect to oracle&lt;BR /&gt;
(user=userid orapw="********" path='owh.world');&lt;BR /&gt;
create table week_day_day as&lt;BR /&gt;
  select * from connection to oracle&lt;BR /&gt;
    ( select to_date(%bquote('&amp;amp;Repdate'),'dd.mm.yyyy') - 15 del_date from dual&lt;BR /&gt;
	);&lt;BR /&gt;
  disconnect from oracle;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
proc sql noprint;&lt;BR /&gt;
&lt;BR /&gt;
select datepart(w.del_date) format = rusdfdd10. into :del_date from work.week_day_day w; &lt;BR /&gt;
&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
%let plist=0;&lt;BR /&gt;
%let retType = FROM_WEBDAV;&lt;BR /&gt;
%let url = &lt;A href="http://SASMID:8300/sasdav/fgeneral/CP&amp;amp;del_date" target="_blank"&gt;http://SASMID:8300/sasdav/fgeneral/CP&amp;amp;del_date&lt;/A&gt;;&lt;BR /&gt;
%let rc=0;&lt;BR /&gt;
%let total=0;&lt;BR /&gt;
&lt;BR /&gt;
%syscall RETRIEVE_PACKAGE(plist,retType, url, total, rc);&lt;BR /&gt;
%chkrc(retrieve nested);&lt;BR /&gt;
&lt;BR /&gt;
%let packageId = 0;&lt;BR /&gt;
%let desc='';&lt;BR /&gt;
%let num=0;&lt;BR /&gt;
%let dt=0;&lt;BR /&gt;
%let nv='';&lt;BR /&gt;
%let ch='';&lt;BR /&gt;
%let rc=0;&lt;BR /&gt;
%syscall PACKAGE_FIRST(plist, packageId,&lt;BR /&gt;
   num, desc, dt, nv, ch, rc);&lt;BR /&gt;
%chkrc(package first);&lt;BR /&gt;
&lt;BR /&gt;
%syscall package_destroy(packageId,rc);</description>
      <pubDate>Mon, 31 Jan 2011 13:44:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/package-cleanup-for-9-1-3/m-p/66796#M7744</guid>
      <dc:creator>igor_protas</dc:creator>
      <dc:date>2011-01-31T13:44:22Z</dc:date>
    </item>
  </channel>
</rss>

