<?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: File path error given using X Command in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/File-path-error-given-using-X-Command/m-p/951785#M372034</link>
    <description>Yes, the error is gaven by the space after "05.". However, even with the correct path I still don't get any generated SAS file.</description>
    <pubDate>Mon, 25 Nov 2024 11:31:19 GMT</pubDate>
    <dc:creator>OGA13</dc:creator>
    <dc:date>2024-11-25T11:31:19Z</dc:date>
    <item>
      <title>File path error given using X Command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-path-error-given-using-X-Command/m-p/951766#M372023</link>
      <description>&lt;P&gt;I'm trying to fetch files and put them in a single sas file using X Command.&lt;/P&gt;&lt;P&gt;The error is given because in the file path there is a space.&lt;/P&gt;&lt;P&gt;How can I fix it?&lt;/P&gt;&lt;PRE&gt;data helper;
    length Module $50 Function $100;
    set helper;
    Module = "HELPER";
	Path = "V:\Projects\BOE\_BI\Consulting\05. System\Macros\Horizon\"||strip(Module)|| "\" || strip(Function) || ".sas";
run;

proc print data=helper;
run;


%macro fetch_files(module=, output=);
	data _null_;
	    set &amp;amp;module end=last;
	    /* Construct the copy command */
	    if _n_ = 1 then call execute('X "copy ');

	    call execute('"', Path, '" + ');

	    /* Finalize the command when the last file is processed */
	    if last then call execute('"&amp;amp;output"');
	run;
%mend ; 


 %fetch_files(module=helper, output=helper.sas);&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Nov 2024 10:15:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-path-error-given-using-X-Command/m-p/951766#M372023</guid>
      <dc:creator>OGA13</dc:creator>
      <dc:date>2024-11-25T10:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: File path error given using X Command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-path-error-given-using-X-Command/m-p/951780#M372029</link>
      <description>&lt;P&gt;Then wrap the path or at least the portion with the blank in it into double quotes.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data helper;
  length Module $50 Function $100;
  set helper;
  Module = "HELPER";
/*Path =          "V:\Projects\BOE\_BI\Consulting\05. System\Macros\Horizon\"||strip(Module)|| "\" || strip(Function) || ".sas";      */
  Path = cats('"',"V:\Projects\BOE\_BI\Consulting\05. System\Macros\Horizon\",       Module ,  "\",         Function,    ".sas",'"');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2024 11:04:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-path-error-given-using-X-Command/m-p/951780#M372029</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-11-25T11:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: File path error given using X Command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-path-error-given-using-X-Command/m-p/951781#M372030</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/321116"&gt;@OGA13&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm trying to fetch files and put them in a single sas file using X Command.&lt;/P&gt;
&lt;P&gt;The error is given because in the file path there is a space.&lt;/P&gt;
&lt;P&gt;How can I fix it?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Show us the log.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Is the error because of the space after 05.&amp;nbsp;&amp;nbsp;&amp;nbsp; ?? Or is the error somewhere else?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you look in data set PATH, do you see an unnecessary space in variable PATH? If so, where is it?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2024 11:04:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-path-error-given-using-X-Command/m-p/951781#M372030</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-11-25T11:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: File path error given using X Command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-path-error-given-using-X-Command/m-p/951784#M372033</link>
      <description>&lt;P&gt;It seems that your suggestion fix the issue. But still, when I run the macro I don't see the desired file generated.&lt;BR /&gt;I'm sharing the LOG.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;MLOGIC(FETCH_FILES):  Beginning execution.
MLOGIC(FETCH_FILES):  Parameter MODULE has value helper
MLOGIC(FETCH_FILES):  Parameter OUTPUT has value helper.sas
MPRINT(FETCH_FILES):   data _null_;
MPRINT(FETCH_FILES):   set helper end=last;
MPRINT(FETCH_FILES):   if _n_ = 1 then call execute('X "copy ');
MPRINT(FETCH_FILES):   call execute(cats('"', Path, '" + '));
MPRINT(FETCH_FILES):   if last then call execute(cats('"', Path, '"','" &amp;amp;output"'));
MPRINT(FETCH_FILES):   run;

NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release.  Inserting white space between a quoted string
             and the succeeding identifier is recommended.
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release.  Inserting white space between a quoted string
             and the succeeding identifier is recommended.
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release.  Inserting white space between a quoted string
             and the succeeding identifier is recommended.
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release.  Inserting white space between a quoted string
             and the succeeding identifier is recommended.
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release.  Inserting white space between a quoted string
             and the succeeding identifier is recommended.
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release.  Inserting white space between a quoted string
             and the succeeding identifier is recommended.
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release.  Inserting white space between a quoted string
             and the succeeding identifier is recommended.
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release.  Inserting white space between a quoted string
             and the succeeding identifier is recommended.
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release.  Inserting white space between a quoted string
             and the succeeding identifier is recommended.
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release.  Inserting white space between a quoted string
             and the succeeding identifier is recommended.
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release.  Inserting white space between a quoted string
             and the succeeding identifier is recommended.
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release.  Inserting white space between a quoted string
             and the succeeding identifier is recommended.
NOTE: There were 11 observations read from the data set WORK.HELPER.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


NOTE: Line generated by the CALL EXECUTE routine.
2     + ""V:\Projects\BOE\_BI\Consulting\05. System\Macros\Horizon\HELPER\APPEND_GMAP.sas"" +
        --
        49
NOTE: Line generated by the CALL EXECUTE routine.
3     + ""V:\Projects\BOE\_BI\Consulting\05. System\Macros\Horizon\HELPER\APPLY_VAR_TYPE.sas"" +
        --
        49
NOTE: Line generated by the CALL EXECUTE routine.
4     + ""V:\Projects\BOE\_BI\Consulting\05. System\Macros\Horizon\HELPER\ASSIGN_RECORDID.sas"" +
        --
        49
NOTE: Line generated by the CALL EXECUTE routine.
5     + ""V:\Projects\BOE\_BI\Consulting\05. System\Macros\Horizon\HELPER\CREATE_HORIZON_TEMPLATE.sas"" +
        --
        49
NOTE: Line generated by the CALL EXECUTE routine.
6     + ""V:\Projects\BOE\_BI\Consulting\05. System\Macros\Horizon\HELPER\LOG_BACKUP.sas"" +
        --
        49
NOTE: Line generated by the CALL EXECUTE routine.
7     + ""V:\Projects\BOE\_BI\Consulting\05. System\Macros\Horizon\HELPER\LST_BACKUP.sas"" +
        --
        49
NOTE: Line generated by the CALL EXECUTE routine.
8     + ""V:\Projects\BOE\_BI\Consulting\05. System\Macros\Horizon\HELPER\MASTER_FORMOID.sas"" +
        --
        49
NOTE: Line generated by the CALL EXECUTE routine.
9     + ""V:\Projects\BOE\_BI\Consulting\05. System\Macros\Horizon\HELPER\POST_DOMAIN.sas"" +
        --
        49
NOTE: Line generated by the CALL EXECUTE routine.
10    + ""V:\Projects\BOE\_BI\Consulting\05. System\Macros\Horizon\HELPER\REFRESH_FROM_PILOT.sas"" +
        --
        49
NOTE: Line generated by the CALL EXECUTE routine.
11    + ""V:\Projects\BOE\_BI\Consulting\05. System\Macros\Horizon\HELPER\RENAME_SPEC.sas"" +
        --
        49
NOTE: Line generated by the CALL EXECUTE routine.
12    + ""V:\Projects\BOE\_BI\Consulting\05. System\Macros\Horizon\HELPER\REPORT_LOGMSG.sas"" +
        --
        49
NOTE: Line generated by the CALL EXECUTE routine.
13    + ""V:\Projects\BOE\_BI\Consulting\05. System\Macros\Horizon\HELPER\REPORT_LOGMSG.sas""" helper.sas"
        --
        49
MLOGIC(FETCH_FILES):  Ending execution.
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release.  Inserting white space between a quoted string
             and the succeeding identifier is recommended.

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Nov 2024 11:27:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-path-error-given-using-X-Command/m-p/951784#M372033</guid>
      <dc:creator>OGA13</dc:creator>
      <dc:date>2024-11-25T11:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: File path error given using X Command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-path-error-given-using-X-Command/m-p/951785#M372034</link>
      <description>Yes, the error is gaven by the space after "05.". However, even with the correct path I still don't get any generated SAS file.</description>
      <pubDate>Mon, 25 Nov 2024 11:31:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-path-error-given-using-X-Command/m-p/951785#M372034</guid>
      <dc:creator>OGA13</dc:creator>
      <dc:date>2024-11-25T11:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: File path error given using X Command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-path-error-given-using-X-Command/m-p/951786#M372035</link>
      <description>&lt;P&gt;1) do not use X for the job.&lt;/P&gt;
&lt;P&gt;2) if you have multiple files you want to copy to a single .sas file and all of then are in one directory you can do it like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* create some text files */
filename f "R:\test\";

data _null_;
file f(a.sas);
put "data _null_; run;";

file f(b.sas);
put "proc print data=sashelp.class; run;";

file f(c.sas);
put '%macro test(n); %do i = 1 to &amp;amp;n.; %put &amp;amp;=i.; %end; %mend;';

file f(d.sas);
put '%test(42)';
put "data _null_; run;";
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* get them all into one file */
filename in_list "R:\test\*.sas";
filename out "R:\out\allInOne.sas";

data _null_;
  infile in_list;
    file out;
  input;
    put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2024 11:33:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-path-error-given-using-X-Command/m-p/951786#M372035</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-11-25T11:33:01Z</dc:date>
    </item>
  </channel>
</rss>

