<?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 temporary dataset name in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/temporary-dataset-name/m-p/62048#M13501</link>
    <description>I want to create a temporary dataset with an arbitary name, but I don't want to overwrite any current objects in the work library. So I have a piece of code to find an available identifier for the dataset first,&lt;BR /&gt;
/*&lt;BR /&gt;
data _null_;&lt;BR /&gt;
	length str $ 6;&lt;BR /&gt;
	do until(not exist(str) and not exist(str, 'view'));&lt;BR /&gt;
		str = cats("_", put(floor(ranuni(0)*32768), best.));&lt;BR /&gt;
	end;&lt;BR /&gt;
	call symput("dsn", str);&lt;BR /&gt;
run;&lt;BR /&gt;
*/&lt;BR /&gt;
my two questions,&lt;BR /&gt;
(1) I know I cannot have conflict with current 'DATA' or 'VIEW' names, but are there other types of objects needs to be checked?&lt;BR /&gt;
(2) Is there an easier way of programming?&lt;BR /&gt;
Thanks!

Message was edited by: urchin</description>
    <pubDate>Wed, 19 Nov 2008 00:13:03 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-11-19T00:13:03Z</dc:date>
    <item>
      <title>temporary dataset name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/temporary-dataset-name/m-p/62048#M13501</link>
      <description>I want to create a temporary dataset with an arbitary name, but I don't want to overwrite any current objects in the work library. So I have a piece of code to find an available identifier for the dataset first,&lt;BR /&gt;
/*&lt;BR /&gt;
data _null_;&lt;BR /&gt;
	length str $ 6;&lt;BR /&gt;
	do until(not exist(str) and not exist(str, 'view'));&lt;BR /&gt;
		str = cats("_", put(floor(ranuni(0)*32768), best.));&lt;BR /&gt;
	end;&lt;BR /&gt;
	call symput("dsn", str);&lt;BR /&gt;
run;&lt;BR /&gt;
*/&lt;BR /&gt;
my two questions,&lt;BR /&gt;
(1) I know I cannot have conflict with current 'DATA' or 'VIEW' names, but are there other types of objects needs to be checked?&lt;BR /&gt;
(2) Is there an easier way of programming?&lt;BR /&gt;
Thanks!

Message was edited by: urchin</description>
      <pubDate>Wed, 19 Nov 2008 00:13:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/temporary-dataset-name/m-p/62048#M13501</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-11-19T00:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: temporary dataset name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/temporary-dataset-name/m-p/62049#M13502</link>
      <description>If you don't care about the name, you can just use &lt;BR /&gt;
&lt;BR /&gt;
DATA;&lt;BR /&gt;
&lt;MORE&gt;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
And SAS will create a name for you in format DATAn, where 'n' is the next available number in the work library.&lt;/MORE&gt;</description>
      <pubDate>Wed, 19 Nov 2008 02:21:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/temporary-dataset-name/m-p/62049#M13502</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2008-11-19T02:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: temporary dataset name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/temporary-dataset-name/m-p/62050#M13503</link>
      <description>Hey yes, nice proposition Doc@Duke&lt;BR /&gt;
&lt;BR /&gt;
And if urchin wants to use this generic dataset names later on he/she could do something like this:&lt;BR /&gt;
&lt;BR /&gt;
data;&lt;BR /&gt;
  a=1;&lt;BR /&gt;
run;&lt;BR /&gt;
%let ThisIstheFirstDS=&amp;amp;syslast;&lt;BR /&gt;
data;&lt;BR /&gt;
  a=2;&lt;BR /&gt;
run;&lt;BR /&gt;
%let ThisIstheSecondDS=&amp;amp;syslast;&lt;BR /&gt;
&lt;BR /&gt;
proc print data=&amp;amp;ThisIstheFirstDS;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Cheers, Patrick</description>
      <pubDate>Wed, 19 Nov 2008 10:57:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/temporary-dataset-name/m-p/62050#M13503</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2008-11-19T10:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: temporary dataset name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/temporary-dataset-name/m-p/62051#M13504</link>
      <description>Both of your minds are so sharp!  I end up with something like&lt;BR /&gt;
&lt;BR /&gt;
%macro doit(n);&lt;BR /&gt;
%do i=1 %to &amp;amp;n;&lt;BR /&gt;
data;stop;run;&lt;BR /&gt;
%let tmp&amp;amp;i = %sysfunc(tranwrd(&amp;amp;syslast, WORK., ));&lt;BR /&gt;
%end;&lt;BR /&gt;
proc datasets nolist;&lt;BR /&gt;
delete&lt;BR /&gt;
	%do i=1 %to &amp;amp;n;&lt;BR /&gt;
		&amp;amp;&amp;amp;tmp&amp;amp;i&lt;BR /&gt;
	%end;&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
%mend doit;</description>
      <pubDate>Wed, 19 Nov 2008 15:30:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/temporary-dataset-name/m-p/62051#M13504</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-11-19T15:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: temporary dataset name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/temporary-dataset-name/m-p/62052#M13505</link>
      <description>Don't forget, for extra protection: OPTIONS NOREPLACE. However, this may have to be carefully targeted if some of your data is replaceable.</description>
      <pubDate>Thu, 20 Nov 2008 15:29:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/temporary-dataset-name/m-p/62052#M13505</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-11-20T15:29:11Z</dc:date>
    </item>
  </channel>
</rss>

