<?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: Help! I'm newer, in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-I-m-newer/m-p/74824#M16127</link>
    <description>I agree with Cynthia's suggested approach and, if you're really, really interested in learning macros, the paper she suggested.&lt;BR /&gt;
&lt;BR /&gt;
However, since I wrote a macro (but didn't test it), I thought I'd share it before deleting it.&lt;BR /&gt;
&lt;BR /&gt;
options noxwait nxsync;&lt;BR /&gt;
%macro www(folder,subfolder,fname,numruns);&lt;BR /&gt;
  data _null_;&lt;BR /&gt;
    %do i=1 %to &amp;amp;numruns.;&lt;BR /&gt;
      call system ("md &amp;amp;folder.&amp;amp;subfolder.&amp;amp;fname.&amp;amp;i.");&lt;BR /&gt;
    %end;&lt;BR /&gt;
  run;&lt;BR /&gt;
%mend;&lt;BR /&gt;
&lt;BR /&gt;
%www(C:\saswork\,alex\,runs,50)&lt;BR /&gt;
&lt;BR /&gt;
Art</description>
    <pubDate>Sat, 25 Sep 2010 17:33:52 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2010-09-25T17:33:52Z</dc:date>
    <item>
      <title>Help! I'm newer,</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-I-m-newer/m-p/74820#M16123</link>
      <description>I'm just start to study SAS, I try to creat a program @ my window system, I try to create 50 folders names:runs1,runs2.....runs50 under c:\saswork\runs\ ...     like: "c:\saswork\runs\runs1,runs2--runs50" &lt;BR /&gt;
I tried X "copy macro" ,but need keep to close CMD.exe, can you someone can help me to make the program for me ?&lt;BR /&gt;
Thanks A Million in Advance.&lt;BR /&gt;
Sasjunior</description>
      <pubDate>Sat, 25 Sep 2010 11:47:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-I-m-newer/m-p/74820#M16123</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-09-25T11:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help! I'm newer,</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-I-m-newer/m-p/74821#M16124</link>
      <description>Without seeing more of your code and Log error messages it is hard to comment. I have a few suggestions...&lt;BR /&gt;
1) look up the correct syntax of the mkdir or md command on your operating system. I do not remember the MD command accepting a list of folders separated by commas&lt;BR /&gt;
2) search the forum and/or support.sas.com for examples of external file and folder manipulation -- there have been previous forum postings on these topics.&lt;BR /&gt;
3) look in the documentation (SAS Companion) for your operating system and/or consult with your SAS administrator to make sure that you correctly understand where you have permission to create folders -- for example if you are using SAS Enterprise Guide the X command may be disabled or you may not have write access to the location where you want to create folders.&lt;BR /&gt;
4) you refer to an X command to "copy macro" -- do you want to execute a mkdir command or a copy command or invoke a .bat or .cmd file?? Your description of what you want to do is inconsistent with what you describe&lt;BR /&gt;
5) look up the use of the options used in conjunction with the use of the X command - you should be able to find them in the same place you find the doc and examples of using the X command.&lt;BR /&gt;
&lt;BR /&gt;
Cynthia</description>
      <pubDate>Sat, 25 Sep 2010 14:05:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-I-m-newer/m-p/74821#M16124</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-09-25T14:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: Help! I'm newer,</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-I-m-newer/m-p/74822#M16125</link>
      <description>Hello,Cynthia thanks so much!&lt;BR /&gt;
**************************************************************************************&lt;BR /&gt;
data wjx; (defins Macros: runs1-runs50)&lt;BR /&gt;
  do i=1 to 50;&lt;BR /&gt;
 n='runs'||trim(left(i));  &lt;BR /&gt;
 output;&lt;BR /&gt;
end;&lt;BR /&gt;
 run;&lt;BR /&gt;
 options symbolgen;&lt;BR /&gt;
 data _null_;&lt;BR /&gt;
   set wjx;&lt;BR /&gt;
   call symput('runs'!!trim(left(i)),n);&lt;BR /&gt;
     run; &lt;BR /&gt;
%put _user_;&lt;BR /&gt;
   &lt;BR /&gt;
%let folder=C:\saswork\;                                                                                                                &lt;BR /&gt;
%let subfolder=alex\;                                                                                                                    &lt;BR /&gt;
*********************************************************************************************                                                                                                                                        &lt;BR /&gt;
x "md   &amp;amp;folder&amp;amp;subfolder&amp;amp;runs1"; *create a folder;     &lt;BR /&gt;
********************************************************************************************&lt;BR /&gt;
is have any way I can substitute "&amp;amp;runs1 " as automatic series  Macros from runs1 to runs50 to keep create a series folders? can I use do loop or array... to do that?&lt;BR /&gt;
I tried array, but itis very hard for me.&lt;BR /&gt;
:date _null_;&lt;BR /&gt;
array runs{50} runs1-runs50;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
%macro www(qqq);&lt;BR /&gt;
x "md   &amp;amp;folder&amp;amp;subfolder&amp;amp;qqq"&lt;BR /&gt;
%mend;&lt;BR /&gt;
%qqq(runs{50})&lt;BR /&gt;
&lt;BR /&gt;
after modification, my idea is possable?&lt;BR /&gt;
thanks again.&lt;BR /&gt;
SASjunior</description>
      <pubDate>Sat, 25 Sep 2010 15:16:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-I-m-newer/m-p/74822#M16125</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-09-25T15:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help! I'm newer,</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-I-m-newer/m-p/74823#M16126</link>
      <description>Hi:&lt;BR /&gt;
 &lt;BR /&gt;
  You may not need SAS macro processing at all. For example, if you read the documentation on the DCREATE function, &lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#a002986745.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#a002986745.htm&lt;/A&gt;&lt;BR /&gt;
     &lt;BR /&gt;
you will discover that you can create a directory without using SAS Macro processing at all. Using the DCREATE approach, you could create your numbered folders using a simple DO loop, much like you show in your first DATA step program.&lt;BR /&gt;
 &lt;BR /&gt;
  If you really, really want a SAS Macro approach, then you should read up a bit more on SAS Macro processing. This is a very good paper on the subject:&lt;BR /&gt;
 &lt;A href="http://www2.sas.com/proceedings/sugi28/056-28.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi28/056-28.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
  The program below illlustrates how to create the folders ZZ1, ZZ2 and ZZ3 in the c:\temp\ directory.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
data _null_;&lt;BR /&gt;
  do i = 1 to 3;&lt;BR /&gt;
    DirectoryName = catt('zz',put(i,1.0));&lt;BR /&gt;
    NewDirectory=dcreate(DirectoryName,'c:\temp\');&lt;BR /&gt;
    putlog newdirectory= directoryname=;&lt;BR /&gt;
  end;&lt;BR /&gt;
run;&lt;BR /&gt;
[pre]</description>
      <pubDate>Sat, 25 Sep 2010 17:20:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-I-m-newer/m-p/74823#M16126</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-09-25T17:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help! I'm newer,</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-I-m-newer/m-p/74824#M16127</link>
      <description>I agree with Cynthia's suggested approach and, if you're really, really interested in learning macros, the paper she suggested.&lt;BR /&gt;
&lt;BR /&gt;
However, since I wrote a macro (but didn't test it), I thought I'd share it before deleting it.&lt;BR /&gt;
&lt;BR /&gt;
options noxwait nxsync;&lt;BR /&gt;
%macro www(folder,subfolder,fname,numruns);&lt;BR /&gt;
  data _null_;&lt;BR /&gt;
    %do i=1 %to &amp;amp;numruns.;&lt;BR /&gt;
      call system ("md &amp;amp;folder.&amp;amp;subfolder.&amp;amp;fname.&amp;amp;i.");&lt;BR /&gt;
    %end;&lt;BR /&gt;
  run;&lt;BR /&gt;
%mend;&lt;BR /&gt;
&lt;BR /&gt;
%www(C:\saswork\,alex\,runs,50)&lt;BR /&gt;
&lt;BR /&gt;
Art</description>
      <pubDate>Sat, 25 Sep 2010 17:33:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-I-m-newer/m-p/74824#M16127</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2010-09-25T17:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help! I'm newer,</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-I-m-newer/m-p/74825#M16128</link>
      <description>&lt;B&gt;Cynthia &amp;amp; art297&lt;/B&gt;  &lt;BR /&gt;
&lt;U&gt; thanks a million again for helping a small guy.&lt;/U&gt;&lt;BR /&gt;
your both codes  work great. I think I need to spend a few years to catch up with  your tail.&lt;BR /&gt;
but I will study hard to do that.&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;Nice weekend!&lt;/B&gt;&lt;BR /&gt;
SASjunior</description>
      <pubDate>Sat, 25 Sep 2010 22:15:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-I-m-newer/m-p/74825#M16128</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-09-25T22:15:42Z</dc:date>
    </item>
  </channel>
</rss>

