<?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: PIPE command failing with job scheduled using Management Console in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/901797#M356372</link>
    <description>&lt;P&gt;My work is blocking this site for some reason.&amp;nbsp; Would you be able to post the macro here?&lt;/P&gt;</description>
    <pubDate>Mon, 06 Nov 2023 20:30:59 GMT</pubDate>
    <dc:creator>Anna_dlC</dc:creator>
    <dc:date>2023-11-06T20:30:59Z</dc:date>
    <item>
      <title>PIPE command failing with job scheduled using Management Console</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/901307#M356198</link>
      <description>&lt;P&gt;&lt;FONT size="4"&gt;&lt;SPAN class=""&gt;We have code that works perfectly fine when run manually in EG but for some reason fails when run through Management Console on a schedule. The error seems to revolve around the PIPE command, with the error message stating "insufficient authorization" . But I have no problem using it in EG.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;FONT size="4"&gt;&lt;SPAN class=""&gt;The input file containing the files to be ready can have multiple files in it at any given time. We use the pipe command to parse the file name list so that each file can go through our data validation code one by one.&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;FONT size="4"&gt;&lt;SPAN class=""&gt;Can anyone please tell me why it's not working? We need this code scheduled ASAP to run in Production&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 21:29:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/901307#M356198</guid>
      <dc:creator>Anna_dlC</dc:creator>
      <dc:date>2023-11-02T21:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: PIPE command failing with job scheduled using Management Console</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/901311#M356201</link>
      <description>&lt;P&gt;This is usually because&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;you are running as a different user&lt;/LI&gt;
&lt;LI&gt;you are running on a different machine&lt;/LI&gt;
&lt;LI&gt;cron jobs do not run your normal logon scripts which mess with your search path and other settings.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Reading a list of filenames from a text would be easy to do with SAS code.&amp;nbsp;Say more about what it is that using PIPE is letting you do that you couldn't do with SAS code?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 21:56:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/901311#M356201</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-11-02T21:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: PIPE command failing with job scheduled using Management Console</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/901312#M356202</link>
      <description>&lt;P&gt;Most likely it is because the SAS OPTION NOXCMD is set for SAS batch jobs. To change this modify the sasbatch_usermods.bat in each of your SAS server instances (SASApp, SASApp2 etc.) and add this option:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Set USERMODS_OPTIONS=-XCMD&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 22:17:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/901312#M356202</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-11-02T22:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: PIPE command failing with job scheduled using Management Console</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/901728#M356353</link>
      <description>&lt;P&gt;The PIPE is allowing me to read a list files from a server folder.&amp;nbsp; &amp;nbsp;The pipe reads in the contents of this entire folder and then my SAS code after that cherry picks only those starting with SFMC or Generate to be processed.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sfmc_recv.jpg" style="width: 902px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/89445i4F217D0C27919ECC/image-size/large?v=v2&amp;amp;px=999" role="button" title="sfmc_recv.jpg" alt="sfmc_recv.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 14:10:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/901728#M356353</guid>
      <dc:creator>Anna_dlC</dc:creator>
      <dc:date>2023-11-06T14:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: PIPE command failing with job scheduled using Management Console</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/901730#M356354</link>
      <description>&lt;P&gt;You should be able to do the same with DOPEN() and DREAD() functions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check out this macro to get a list of files in a directory:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/sasutils/macros/blob/master/dirtree.sas" target="_blank"&gt;https://github.com/sasutils/macros/blob/master/dirtree.sas&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 14:17:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/901730#M356354</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-11-06T14:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: PIPE command failing with job scheduled using Management Console</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/901797#M356372</link>
      <description>&lt;P&gt;My work is blocking this site for some reason.&amp;nbsp; Would you be able to post the macro here?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 20:30:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/901797#M356372</guid>
      <dc:creator>Anna_dlC</dc:creator>
      <dc:date>2023-11-06T20:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: PIPE command failing with job scheduled using Management Console</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/901798#M356373</link>
      <description>&lt;P&gt;I've sent this solution to our admin to see if it can be implemented.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 20:31:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/901798#M356373</guid>
      <dc:creator>Anna_dlC</dc:creator>
      <dc:date>2023-11-06T20:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: PIPE command failing with job scheduled using Management Console</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/901824#M356380</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/198936"&gt;@Anna_dlC&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;My work is blocking this site for some reason.&amp;nbsp; Would you be able to post the macro here?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="https://github.com/sasutils/macros/blob/master/dirtree.sas" target="_blank"&gt;https://github.com/sasutils/macros/blob/master/dirtree.sas&lt;/A&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro dirtree
/*---------------------------------------------------------------------------
Build dataset of files in directory tree(s)
----------------------------------------------------------------------------*/
(directory    /* Pipe delimited directory list (default=.) */
,out=dirtree  /* Output dataset name */
,maxdepth=120 /* Maximum tree depth */
);
/*---------------------------------------------------------------------------
Use SAS functions to gather list of files and directories

directory - Pipe delimited list of top level directories

out - Dataset to create
maxdepth - Maximum depth of subdirectories to query

Output dataset structure
--NAME-- Len  Format      Description
FILENAME $256             Name of file in directory
TYPE       $1             File or Directory? (F/D)
SIZE        8 COMMA20.    Filesize in bytes
DATE        4 YYMMDD10.   Date file last modified
TIME        4 TOD8.       Time of day file last modified
DEPTH       3             Tree depth
PATH     $256             Directory name

Size is not available for the directories.
LASTMOD timestamp is only available on Unix for directories.

Will not scan the subtree of a directory with a path that is
longer then 256 bytes. For such nodes TYPE will be set to L .

----------------------------------------------------------------------------*/
%local fileref ;
%let fileref=__FL__ ;
%if 0=%length(&amp;amp;directory) %then %let directory=. ;

* Setup dataset and seed with starting directory list ;
data &amp;amp;out;
  length filename $256 type $1 size 8 date time 4 depth 3 path $256 ;
  retain filename ' ' depth 0 type ' ' date . time . size . ;
  format size comma20. date yymmdd10. time tod8. ;
  do _n_=1 to countw(symget('directory'),'|');
    path=scan(symget('directory'),_n_,'|');
    output;
  end;
run;

%* Allow use of empty OUT= dataset parameter ;
%let out=&amp;amp;syslast;

data &amp;amp;out;
  modify &amp;amp;out;
  retain sep "%sysfunc(ifc(&amp;amp;sysscp=WIN,\,/))";
  retain maxdepth &amp;amp;maxdepth;
* Create FILEREF pointing to current file/directory ;
  rc1=filename("&amp;amp;fileref",catx('/',path,filename));
  if rc1 then do;
    length message $256;
    message=sysmsg();
    put 'ERROR: Unable to create fileref for ' path= filename= ;
    put 'ERROR- ' message ;
    stop;
  end;
* Try to open as a directory to determine type ;
  did=dopen("&amp;amp;fileref");
  type = ifc(did,'D','F');
  if type='D' then do;
* Make sure directory name is not too long to store. ;
    if length(catx('/',path,filename)) &amp;gt; vlength(path) then do;
      put 'NOTE: Directory name too long. ' path= filename= ;
      type='L';
      rc3=dclose(did);
    end;
    else do;
* Move filename into the PATH and if on Unix set lastmod ;
      path=catx(sep,path,filename);
      filename=' ';
      if sep='/' then do;
        lastmod = input(dinfo(did,doptname(did,5)),nldatm100.);
        date=datepart(lastmod);
        time=timepart(lastmod);
      end;
    end;
  end;
  else do;
* For a file try to open file and get file information ;
    fid=fopen("&amp;amp;fileref",'i',0,'b');
    if fid then do;
      lastmod = input(finfo(fid,foptname(fid, 5)), nldatm100.);
      date=datepart(lastmod);
      time=timepart(lastmod);
      size = input(finfo(fid,foptname(fid,ifn(sep='/',6,4))),32.);
      rc2 = fclose(fid);
    end;
  end;
* Update the observation in the dataset ;
  replace;
  if type='D' then do;
* When current file is a directory add directory members to dataset ;
    depth=depth+1;
    if depth &amp;gt; maxdepth then put 'NOTE: ' maxdepth= 'reached, not reading members of ' path= ;
    else do i=1 to dnum(did);
      filename=dread(did,i);
      output;
    end;
    rc3=dclose(did);
  end;
* Clear the fileref ;
  rc4=filename("&amp;amp;fileref");
run;

%mend dirtree;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Since you seem to want CSV files that are directly in that folder (not in some sub-directory) then use the MAXDEPTH=1 and filter the resulting dataset with same criteria you are using now to filter the output of whatever PIPEd command you are using.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 22:15:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/901824#M356380</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-11-06T22:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: PIPE command failing with job scheduled using Management Console</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/904151#M357222</link>
      <description>&lt;P&gt;Hi, I tried your macro but I'm a little confused at the results.&amp;nbsp; This is was old code with the PIPE&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Anna_dlC_0-1700596449109.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/90086i694BF14064E24E2F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Anna_dlC_0-1700596449109.png" alt="Anna_dlC_0-1700596449109.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;When I create that 'num_files' macro variable, my result is 3, which is how many of my target files are in that directory.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I run the code using your macro, num_files only resolves to 1?&amp;nbsp; Here is the log&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;56 %dirtree(/rsmprod/landing/RMD/OpticNerveSftp/SFMC/recv/);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;MLOGIC(DIRTREE): Beginning execution.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;MLOGIC(DIRTREE): This macro was compiled from the autocall file &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;/sasdata/cdm/mktgecicm/CLM_Operations/03SFMC/CJB_PRODUCTION_VALIDATION/sasautos/dirtree.sas&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;MLOGIC(DIRTREE): Parameter DIRECTORY has value /rsmprod/landing/RMD/OpticNerveSftp/SFMC/recv/&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;MLOGIC(DIRTREE): Parameter OUT has value dirtree_list&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;MLOGIC(DIRTREE): Parameter MAXDEPTH has value 1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;MLOGIC(DIRTREE): %LOCAL FILEREF &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;MLOGIC(DIRTREE): %LET (variable name is FILEREF)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;SYMBOLGEN: Macro variable DIRECTORY resolves to /rsmprod/landing/RMD/OpticNerveSftp/SFMC/recv/&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;MLOGIC(DIRTREE): %IF condition 0=%length(&amp;amp;directory) is FALSE&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;SYMBOLGEN: Macro variable OUT resolves to dirtree_list&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;NOTE: The data set WORK.DIRTREE_LIST has 1 observations and 7 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;NOTE: DATA statement used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;real time 0.00 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;cpu time 0.00 seconds&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;MLOGIC(DIRTREE): %LET (variable name is OUT)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;SYMBOLGEN: Macro variable SYSLAST resolves to WORK.DIRTREE_LIST &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;SYMBOLGEN: Macro variable OUT resolves to WORK.DIRTREE_LIST&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;SYMBOLGEN: Macro variable OUT resolves to WORK.DIRTREE_LIST&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;SYMBOLGEN: Macro variable SYSSCP resolves to LIN X64&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;SYMBOLGEN: Macro variable MAXDEPTH resolves to 1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;SYMBOLGEN: Macro variable FILEREF resolves to __FL__&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;SYMBOLGEN: Macro variable FILEREF resolves to __FL__&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;SYMBOLGEN: Macro variable FILEREF resolves to __FL__&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;SYMBOLGEN: Macro variable FILEREF resolves to __FL__&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;NOTE: maxdepth=1 reached, not reading members of path=/rsmprod/landing/RMD/OpticNerveSftp/SFMC/recv//BKUP&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;NOTE: The data set WORK.DIRTREE_LIST has been updated. There were 28 observations rewritten, 27 observations added and 0 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;observations deleted.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;NOTE: DATA statement used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;real time 0.04 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;cpu time 0.03 seconds&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;MLOGIC(DIRTREE): Ending execution.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;57 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;58 DATA _NULL_;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;59 call symput ('num_files',strip(_n_)); /* store the record number in a macro variable */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;60 RUN;&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;59:34 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;NOTE: DATA statement used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;real time 0.00 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;cpu time 0.00 seconds&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&lt;FONT face="courier new,courier" size="2" color="#800000"&gt;SYMBOLGEN: Macro variable NUM_FILES resolves to 1&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 19:57:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/904151#M357222</guid>
      <dc:creator>Anna_dlC</dc:creator>
      <dc:date>2023-11-21T19:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: PIPE command failing with job scheduled using Management Console</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/904152#M357223</link>
      <description>&lt;P&gt;Looks like the macro worked:&lt;/P&gt;
&lt;PRE&gt;NOTE: The data set WORK.DIRTREE_LIST has been updated. There were 28 observations rewritten, 27 observations added and 0
observations deleted.&lt;/PRE&gt;
&lt;P&gt;So it found 28 directories and files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do want in the macro variable NUM_FILES?&lt;/P&gt;
&lt;P&gt;Right now you are just converting the number one into a string , removing the resulting spaces and storing that into the macro variable by running this empty data step.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA _NULL_;
  call symput ('num_files',strip(_n_)); /* store the record number in a macro variable */
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It would be a lot easier to just do:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let num_files=1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;if that is what you want to put into NUM_FILES.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 21:19:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/904152#M357223</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-11-21T21:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: PIPE command failing with job scheduled using Management Console</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/904628#M357396</link>
      <description>&lt;P&gt;From the list in the directory, num_files should resolve to 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Anna_dlC_0-1701093738667.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/90212i10E8A0C8E1F65DCC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Anna_dlC_0-1701093738667.png" alt="Anna_dlC_0-1701093738667.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2023 14:02:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/904628#M357396</guid>
      <dc:creator>Anna_dlC</dc:creator>
      <dc:date>2023-11-27T14:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: PIPE command failing with job scheduled using Management Console</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/904634#M357398</link>
      <description>&lt;P&gt;If you want limit WHICH files then do that.&lt;/P&gt;
&lt;P&gt;From your photograph perhaps you want only take the files whose names start with 'GenerateFileSample'?&amp;nbsp; It is not clear whether or not the file extension matters and cannot see those in the photograph.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So look at the dataset,&amp;nbsp;DIRTREE_LIST, your macro call generated.&amp;nbsp; Explore it. Figure out what it has in it.&amp;nbsp; Then you can write code to filter it just the observations you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set DIRTREE_LIST end=eof;
  where filename=:'GenerateFileSample';
  if eof then call symputx('num_files',_n_);
run;
  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;</description>
      <pubDate>Mon, 27 Nov 2023 14:22:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/904634#M357398</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-11-27T14:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: PIPE command failing with job scheduled using Management Console</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/906252#M357848</link>
      <description>&lt;P&gt;Ultimately, I believe this is the easiest solution but I am having a devil of a time getting it implemented!&amp;nbsp; &amp;nbsp;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 15:01:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/906252#M357848</guid>
      <dc:creator>Anna_dlC</dc:creator>
      <dc:date>2023-12-05T15:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: PIPE command failing with job scheduled using Management Console</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/906254#M357849</link>
      <description>&lt;P&gt;That did the trick.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 15:02:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PIPE-command-failing-with-job-scheduled-using-Management-Console/m-p/906254#M357849</guid>
      <dc:creator>Anna_dlC</dc:creator>
      <dc:date>2023-12-05T15:02:42Z</dc:date>
    </item>
  </channel>
</rss>

