<?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 Use SAS to create sub dir on Windows inside an already existing parent dir (with name  month number) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Use-SAS-to-create-sub-dir-on-Windows-inside-an-already-existing/m-p/932116#M366692</link>
    <description>&lt;P&gt;Hi Forum,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would like SAS EG or SAS Studio to create a sub directory on Windows filesystem as the month previous to the one we are currently in, on the Windows file system however; so for example I would like that here&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Q:\\BLAHBLAH\blahblah\5&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Gets created on the previously existing&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Q:\\BLAHBLAH\blahblah\&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;From with the UNIX-based SAS which resides I-don't know-where-but-probably-something-like-/opt/sas/... on some server-side which I cannot see. (&lt;/SPAN&gt;&lt;SPAN&gt;I have no clue if I can write on that particular Q:\\ win-subdirectory but I tried having SAS output with ODS an excelfile in that path, this works.&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Since we are now in June the to be created sub dir should be '5' - so I created a variable which will return me the 5 like such&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;/*creates dir*/&lt;BR /&gt;%let P_month = %sysfunc(month(%sysfunc(intnx(month, %sysfunc(today()), -1))));&lt;BR /&gt;%put The Previous Month (based on one month back) is: &amp;amp;p_month;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works but;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How can I incorporate it into a statement to get the dir creation done?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;DLCREATEDIR is not working/unallowed probably, DCREATE will not return an error but also do nothing (as in I see no win dir getting created and no log error), is it possible its logging is incomplete?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;heleen&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jun 2024 12:36:34 GMT</pubDate>
    <dc:creator>heleen_w</dc:creator>
    <dc:date>2024-06-13T12:36:34Z</dc:date>
    <item>
      <title>Use SAS to create sub dir on Windows inside an already existing parent dir (with name  month number)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-SAS-to-create-sub-dir-on-Windows-inside-an-already-existing/m-p/932116#M366692</link>
      <description>&lt;P&gt;Hi Forum,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would like SAS EG or SAS Studio to create a sub directory on Windows filesystem as the month previous to the one we are currently in, on the Windows file system however; so for example I would like that here&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Q:\\BLAHBLAH\blahblah\5&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Gets created on the previously existing&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Q:\\BLAHBLAH\blahblah\&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;From with the UNIX-based SAS which resides I-don't know-where-but-probably-something-like-/opt/sas/... on some server-side which I cannot see. (&lt;/SPAN&gt;&lt;SPAN&gt;I have no clue if I can write on that particular Q:\\ win-subdirectory but I tried having SAS output with ODS an excelfile in that path, this works.&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Since we are now in June the to be created sub dir should be '5' - so I created a variable which will return me the 5 like such&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;/*creates dir*/&lt;BR /&gt;%let P_month = %sysfunc(month(%sysfunc(intnx(month, %sysfunc(today()), -1))));&lt;BR /&gt;%put The Previous Month (based on one month back) is: &amp;amp;p_month;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works but;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How can I incorporate it into a statement to get the dir creation done?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;DLCREATEDIR is not working/unallowed probably, DCREATE will not return an error but also do nothing (as in I see no win dir getting created and no log error), is it possible its logging is incomplete?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;heleen&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 12:36:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-SAS-to-create-sub-dir-on-Windows-inside-an-already-existing/m-p/932116#M366692</guid>
      <dc:creator>heleen_w</dc:creator>
      <dc:date>2024-06-13T12:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Use SAS to create sub dir on Windows inside an already existing parent dir (with name  month num</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-SAS-to-create-sub-dir-on-Windows-inside-an-already-existing/m-p/932119#M366695</link>
      <description>&lt;P&gt;If I understood you correctly, you are running SASon server, you are connected to the server by SAS EG,&amp;nbsp; and you want to create a new directory on your local drive?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this is the setup, then the answer is: you won't be able to do this.&lt;/P&gt;
&lt;P&gt;Such a try in real life could be compared to try of putting food into an oven using Zoom/Teams call.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the SAS Server could create an Excel file and you can see the file on Q: drive, this probably means the drive is a network drive and it is your local windows connecting to it, and for the server, what you can see as "Q:\\BLAHBLAH\blahblah" is probalbly "/..&amp;lt;some/sub/path/here&amp;gt;../&lt;SPAN&gt;BLAHBLAH/blahblah&lt;/SPAN&gt;/"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if you want create sub-dir there you should use, the server path.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 12:51:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-SAS-to-create-sub-dir-on-Windows-inside-an-already-existing/m-p/932119#M366695</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-06-13T12:51:20Z</dc:date>
    </item>
  </channel>
</rss>

